summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty
diff options
context:
space:
mode:
author Branimir Karadžić <branimirkaradzic@gmail.com>2016-02-07 09:50:16 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-02-07 09:50:16 +0100
commit5bc83a25063330ab9177a291ab984c5c7052aa02 (patch)
tree0d4547b361b228c17d535b2fa756ec0a52356e6b /3rdparty
parent88efd657dbd30fd509de64e8a3e87f04fd4f1638 (diff)
Update BGFX (nw)
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/bgfx/.appveyor.yml22
-rw-r--r--3rdparty/bgfx/.travis.yml22
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h2
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/LICENSE.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/Math.hpp90
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/ProcessCommon.hpp51
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/ProcessRGB.cpp719
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/ProcessRGB.hpp9
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/Tables.cpp109
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/Tables.hpp25
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/Types.hpp17
-rw-r--r--3rdparty/bgfx/3rdparty/etc2/Vector.hpp222
-rw-r--r--3rdparty/bgfx/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore2
-rw-r--r--3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucdarwin.h2
-rw-r--r--3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnuclinux.h2
-rw-r--r--3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucwin32.h2
-rw-r--r--3rdparty/bgfx/3rdparty/nvtt/nvcore/defsvcwin32.h2
-rw-r--r--3rdparty/bgfx/3rdparty/nvtt/nvmath/nvmath.h5
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp228
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h134
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp25
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp49
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h15
-rw-r--r--3rdparty/bgfx/3rdparty/pvrtc/BitScale.h2
-rw-r--r--3rdparty/bgfx/3rdparty/remotery/lib/Remotery.c3
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_image.c1
-rw-r--r--3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h15
-rw-r--r--3rdparty/bgfx/README.md18
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h51
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h36
-rw-r--r--3rdparty/bgfx/examples/08-update/update.cpp10
-rw-r--r--3rdparty/bgfx/examples/09-hdr/hdr.cpp4
-rw-r--r--3rdparty/bgfx/examples/13-stencil/stencil.cpp4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp8
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc6
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp15
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp22
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h14
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h25
-rw-r--r--3rdparty/bgfx/examples/27-terrain/terrain.cpp26
-rw-r--r--3rdparty/bgfx/examples/common/aviwriter.h6
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.cpp23
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_ios.mm10
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp155
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp35
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h47
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h84
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h102
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h27
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h27
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h27
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h14
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h26
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h26
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h28
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h46
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h22
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h17
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h26
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h25
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h26
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h25
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h30
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h33
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h132
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp34
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h35
-rw-r--r--3rdparty/bgfx/examples/common/shaderlib.sh30
-rw-r--r--3rdparty/bgfx/examples/runtime/gamecontrollerdb.txt35
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.binbin603 -> 603 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm.binbin3573 -> 3573 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_csm.binbin6510 -> 6534 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear.binbin3545 -> 3545 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_csm.binbin6398 -> 6422 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_omni.binbin5203 -> 5203 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_omni.binbin5231 -> 5231 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard.binbin3457 -> 3457 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_csm.binbin6046 -> 6070 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear.binbin3429 -> 3429 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_csm.binbin5934 -> 5958 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_omni.binbin5087 -> 5087 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_omni.binbin5115 -> 5115 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf.binbin11918 -> 11918 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_csm.binbin39963 -> 40071 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.binbin10842 -> 10850 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin35579 -> 35715 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin12436 -> 12436 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_omni.binbin13524 -> 13524 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm.binbin3749 -> 3717 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.binbin7214 -> 7206 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.binbin3721 -> 3689 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin7102 -> 7094 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin5379 -> 5347 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.binbin5407 -> 5375 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.binbin4815 -> 4239 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.binbin5631 -> 5631 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.binbin428 -> 477 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.binbin2274 -> 2278 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.binbin553 -> 557 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.binbin137 -> 141 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.binbin618 -> 622 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.binbin218 -> 222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.binbin137 -> 141 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.binbin696 -> 700 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.binbin1088 -> 1092 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.binbin618 -> 622 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.binbin1656 -> 1664 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.binbin1469 -> 1473 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.binbin1793 -> 1797 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.binbin1433 -> 1381 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.binbin525 -> 529 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.binbin1673 -> 1677 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.binbin1661 -> 1661 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.binbin556 -> 560 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.binbin137 -> 141 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.binbin1278 -> 1206 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.binbin183 -> 187 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.binbin459 -> 463 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.binbin429 -> 433 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.binbin431 -> 435 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.binbin429 -> 433 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.binbin404 -> 408 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.binbin47438 -> 47442 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.binbin2726 -> 2730 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.binbin4507 -> 4511 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.binbin2722 -> 2726 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.binbin4471 -> 4475 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.binbin3772 -> 3776 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.binbin3776 -> 3780 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.binbin2686 -> 2690 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.binbin4375 -> 4379 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.binbin2682 -> 2686 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.binbin4419 -> 4423 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.binbin3744 -> 3748 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.binbin3728 -> 3732 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.binbin7591 -> 7591 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.binbin24496 -> 24496 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.binbin7267 -> 7267 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin22316 -> 22316 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin7961 -> 7965 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.binbin8665 -> 8669 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.binbin2806 -> 2810 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.binbin4891 -> 4895 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.binbin2790 -> 2794 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin4827 -> 4831 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin3872 -> 3876 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.binbin3888 -> 3892 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.binbin572 -> 576 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.binbin960 -> 964 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.binbin1152 -> 1156 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.binbin269 -> 273 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.binbin221 -> 225 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.binbin333 -> 337 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.binbin261 -> 265 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.binbin218 -> 222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.binbin380 -> 384 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.binbin384 -> 388 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.binbin960 -> 964 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.binbin1152 -> 1156 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.binbin1910 -> 1914 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.binbin572 -> 576 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.binbin227 -> 231 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.binbin201 -> 205 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.binbin201 -> 205 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.binbin227 -> 231 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.binbin201 -> 205 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.binbin201 -> 205 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.binbin277 -> 281 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.binbin227 -> 231 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.binbin374 -> 378 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.binbin218 -> 222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.binbin2061 -> 2065 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.binbin2464 -> 2468 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.binbin3300 -> 3304 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.binbin269 -> 354 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.binbin149 -> 153 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.binbin1976 -> 1980 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.binbin572 -> 576 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.binbin218 -> 222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.binbin2169 -> 2173 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.binbin1018 -> 1022 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.binbin217 -> 221 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.binbin427 -> 431 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.binbin262 -> 266 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.binbin325 -> 329 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.binbin813 -> 817 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.binbin337 -> 341 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.binbin1089 -> 1093 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.binbin1083 -> 1087 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.binbin461 -> 465 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.binbin1089 -> 1093 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.binbin665 -> 669 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.binbin577 -> 581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.binbin653 -> 657 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.binbin672 -> 676 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.binbin443 -> 447 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.binbin474 -> 478 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.binbin982 -> 986 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.binbin553 -> 557 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.binbin682 -> 686 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.binbin355 -> 359 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.binbin283 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.binbin802 -> 806 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.binbin1451 -> 1455 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.binbin818 -> 822 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.binbin1515 -> 1519 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.binbin1462 -> 1466 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.binbin1398 -> 1402 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.binbin283 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.binbin754 -> 758 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.binbin351 -> 355 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.binbin577 -> 581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.binbin754 -> 758 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.binbin541 -> 545 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.binbin437 -> 441 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.binbin283 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.binbin545 -> 549 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.binbin577 -> 581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.binbin738 -> 742 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.binbin283 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.binbin283 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.binbin541 -> 545 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.binbin577 -> 581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.binbin629 -> 633 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.binbin319 -> 323 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.binbin355 -> 359 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.binbin373 -> 371 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.binbin320 -> 318 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.binbin4213 -> 4207 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.binbin10222 -> 10204 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.binbin4257 -> 4251 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.binbin10442 -> 10424 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.binbin7587 -> 7581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.binbin7541 -> 7535 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.binbin4085 -> 4079 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.binbin9678 -> 9660 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.binbin4117 -> 4111 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.binbin9814 -> 9796 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.binbin7448 -> 7442 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.binbin7414 -> 7408 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.binbin15736 -> 15670 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.binbin63472 -> 63214 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.binbin15787 -> 15721 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin63918 -> 63660 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin19328 -> 19262 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.binbin19273 -> 19207 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.binbin4635 -> 4633 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.binbin12152 -> 12150 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.binbin4679 -> 4677 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin12372 -> 12370 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin8011 -> 8009 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.binbin7965 -> 7963 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.binbin1746 -> 1708 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.binbin302 -> 300 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.binbin254 -> 252 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.binbin421 -> 417 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.binbin1746 -> 1708 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.binbin8652 -> 8588 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.binbin302 -> 398 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.binbin355 -> 353 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.binbin302 -> 300 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.binbin3976 -> 3970 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.binbin9840 -> 9822 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.binbin4020 -> 4014 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.binbin10060 -> 10042 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.binbin7231 -> 7225 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.binbin7185 -> 7179 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.binbin3854 -> 3848 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.binbin9320 -> 9302 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.binbin3886 -> 3880 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.binbin9456 -> 9438 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.binbin7098 -> 7092 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.binbin7064 -> 7058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.binbin15123 -> 15057 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.binbin61633 -> 61375 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.binbin15168 -> 15102 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin62055 -> 61797 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin18584 -> 18518 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.binbin18535 -> 18469 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.binbin4373 -> 4371 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.binbin11670 -> 11668 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.binbin4417 -> 4415 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin11890 -> 11888 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin7630 -> 7628 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.binbin7584 -> 7582 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.binbin1619 -> 1581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.binbin290 -> 288 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.binbin242 -> 240 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.binbin356 -> 352 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.binbin1619 -> 1581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.binbin8286 -> 8222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.binbin290 -> 380 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.binbin623 -> 700 bytes
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxdefines.h4
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxplatform.h77
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfx.h135
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h157
-rw-r--r--3rdparty/bgfx/makefile29
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua2
-rw-r--r--3rdparty/bgfx/scripts/genie.lua18
-rw-r--r--3rdparty/bgfx/scripts/makedisttex.lua19
-rw-r--r--3rdparty/bgfx/scripts/shader.mk29
-rw-r--r--3rdparty/bgfx/scripts/shaderc.lua6
-rw-r--r--3rdparty/bgfx/scripts/texturec.lua4
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp166
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h48
-rw-r--r--3rdparty/bgfx/src/bgfx_shader.sh26
-rw-r--r--3rdparty/bgfx/src/config.h37
-rw-r--r--3rdparty/bgfx/src/glcontext_eagl.mm2
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.cpp2
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.cpp2
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm2
-rw-r--r--3rdparty/bgfx/src/glcontext_ppapi.cpp2
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.cpp2
-rw-r--r--3rdparty/bgfx/src/glimports.h6
-rw-r--r--3rdparty/bgfx/src/image.cpp1226
-rw-r--r--3rdparty/bgfx/src/image.h31
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp66
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.h1
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp25
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp213
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h12
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp158
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h19
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm28
-rw-r--r--3rdparty/bgfx/src/renderer_null.cpp9
-rw-r--r--3rdparty/bgfx/src/shader_dx9bc.cpp3
-rw-r--r--3rdparty/bgfx/src/shader_dxbc.cpp3
-rw-r--r--3rdparty/bgfx/tools/geometryc/geometryc.cpp6
-rw-r--r--3rdparty/bgfx/tools/makedisttex.cpp195
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.cpp2839
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.h134
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp354
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp1185
-rw-r--r--3rdparty/bgfx/tools/texturec/texturec.cpp362
-rw-r--r--3rdparty/bx/.appveyor.yml21
-rw-r--r--3rdparty/bx/.travis.yml20
-rw-r--r--3rdparty/bx/README.md3
-rw-r--r--3rdparty/bx/include/bx/bx.h27
-rw-r--r--3rdparty/bx/include/bx/config.h1
-rw-r--r--3rdparty/bx/include/bx/error.h111
-rw-r--r--3rdparty/bx/include/bx/fpumath.h18
-rw-r--r--3rdparty/bx/include/bx/handlealloc.h2
-rw-r--r--3rdparty/bx/include/bx/os.h15
-rw-r--r--3rdparty/bx/include/bx/platform.h36
-rw-r--r--3rdparty/bx/include/bx/readerwriter.h159
-rw-r--r--3rdparty/bx/makefile5
-rw-r--r--3rdparty/bx/scripts/genie.lua8
-rw-r--r--3rdparty/bx/scripts/toolchain.lua103
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin422176 -> 422176 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin396856 -> 396856 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin399872 -> 400384 bytes
-rw-r--r--3rdparty/bx/tools/bin2c/bin2c.cpp6
380 files changed, 7500 insertions, 3876 deletions
diff --git a/3rdparty/bgfx/.appveyor.yml b/3rdparty/bgfx/.appveyor.yml
new file mode 100644
index 00000000000..852cf22cf98
--- /dev/null
+++ b/3rdparty/bgfx/.appveyor.yml
@@ -0,0 +1,22 @@
+shallow_clone: true
+
+os:
+ - Visual Studio 2015
+
+environment:
+ matrix:
+ - TOOLSET: vs2010
+ - TOOLSET: vs2012
+ - TOOLSET: vs2013
+ - TOOLSET: vs2015
+
+configuration:
+ - Debug
+ - Release
+
+install:
+ - git clone https://github.com/bkaradzic/bx ..\bx
+ - ..\bx\tools\bin\windows\genie --with-tools %TOOLSET%
+
+build:
+ project: .build/projects/$(TOOLSET)/bgfx.sln
diff --git a/3rdparty/bgfx/.travis.yml b/3rdparty/bgfx/.travis.yml
new file mode 100644
index 00000000000..8c081703032
--- /dev/null
+++ b/3rdparty/bgfx/.travis.yml
@@ -0,0 +1,22 @@
+language: cpp
+matrix:
+ include:
+ - compiler: gcc
+ os: linux
+ - compiler: clang
+ os: osx
+
+before_script:
+ git clone https://github.com/bkaradzic/bx ../bx
+
+script:
+ make build
+
+branches:
+ only:
+ - master
+
+notifications:
+ email: false
+
+osx_image: xcode7.3
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
index 17e646e0773..7daa83b3604 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
@@ -42,6 +42,7 @@
#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) ); } \
@@ -52,6 +53,7 @@
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_
diff --git a/3rdparty/bgfx/3rdparty/etc2/LICENSE.txt b/3rdparty/bgfx/3rdparty/etc2/LICENSE.txt
new file mode 100644
index 00000000000..2254f9ece88
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/LICENSE.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2013, Bartosz Taudul <wolf.pld@gmail.com>
+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 <organization> 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 <COPYRIGHT HOLDER> 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.
diff --git a/3rdparty/bgfx/3rdparty/etc2/Math.hpp b/3rdparty/bgfx/3rdparty/etc2/Math.hpp
new file mode 100644
index 00000000000..3a92a2e7317
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/Math.hpp
@@ -0,0 +1,90 @@
+#ifndef __DARKRL__MATH_HPP__
+#define __DARKRL__MATH_HPP__
+
+#include <algorithm>
+#include <math.h>
+
+#include "Types.hpp"
+
+template<typename T>
+inline T AlignPOT( T val )
+{
+ if( val == 0 ) return 1;
+ val--;
+ for( unsigned int i=1; i<sizeof( T ) * 8; i <<= 1 )
+ {
+ val |= val >> i;
+ }
+ return val + 1;
+}
+
+inline int CountSetBits( uint32 val )
+{
+ val -= ( val >> 1 ) & 0x55555555;
+ val = ( ( val >> 2 ) & 0x33333333 ) + ( val & 0x33333333 );
+ val = ( ( val >> 4 ) + val ) & 0x0f0f0f0f;
+ val += val >> 8;
+ val += val >> 16;
+ return val & 0x0000003f;
+}
+
+inline int CountLeadingZeros( uint32 val )
+{
+ val |= val >> 1;
+ val |= val >> 2;
+ val |= val >> 4;
+ val |= val >> 8;
+ val |= val >> 16;
+ return 32 - CountSetBits( val );
+}
+
+inline float sRGB2linear( float v )
+{
+ const float a = 0.055f;
+ if( v <= 0.04045f )
+ {
+ return v / 12.92f;
+ }
+ else
+ {
+ return powf( ( v + a ) / ( 1 + a ), 2.4f );
+ }
+}
+
+inline float linear2sRGB( float v )
+{
+ const float a = 0.055f;
+ if( v <= 0.0031308f )
+ {
+ return 12.92f * v;
+ }
+ else
+ {
+ return ( 1 + a ) * pow( v, 1/2.4f ) - a;
+ }
+}
+
+template<class T>
+inline T SmoothStep( T x )
+{
+ return x*x*(3-2*x);
+}
+
+inline uint8 clampu8( int32 val )
+{
+ return std::min( std::max( 0, val ), 255 );
+}
+
+template<class T>
+inline T sq( T val )
+{
+ return val * val;
+}
+
+static inline int mul8bit( int a, int b )
+{
+ int t = a*b + 128;
+ return ( t + ( t >> 8 ) ) >> 8;
+}
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/etc2/ProcessCommon.hpp b/3rdparty/bgfx/3rdparty/etc2/ProcessCommon.hpp
new file mode 100644
index 00000000000..7e6addbcdc2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/ProcessCommon.hpp
@@ -0,0 +1,51 @@
+#ifndef __PROCESSCOMMON_HPP__
+#define __PROCESSCOMMON_HPP__
+
+#include <assert.h>
+#include <stddef.h>
+
+#include "Types.hpp"
+
+template<class T>
+static size_t GetLeastError( const T* err, size_t num )
+{
+ size_t idx = 0;
+ for( size_t i=1; i<num; i++ )
+ {
+ if( err[i] < err[idx] )
+ {
+ idx = i;
+ }
+ }
+ return idx;
+}
+
+static uint64 FixByteOrder( uint64 d )
+{
+ return ( ( d & 0x00000000FFFFFFFF ) ) |
+ ( ( d & 0xFF00000000000000 ) >> 24 ) |
+ ( ( d & 0x000000FF00000000 ) << 24 ) |
+ ( ( d & 0x00FF000000000000 ) >> 8 ) |
+ ( ( d & 0x0000FF0000000000 ) << 8 );
+}
+
+template<class T, class S>
+static uint64 EncodeSelectors( uint64 d, const T terr[2][8], const S tsel[16][8], const uint32* id )
+{
+ size_t tidx[2];
+ tidx[0] = GetLeastError( terr[0], 8 );
+ tidx[1] = GetLeastError( terr[1], 8 );
+
+ d |= tidx[0] << 26;
+ d |= tidx[1] << 29;
+ for( int i=0; i<16; i++ )
+ {
+ uint64 t = tsel[i][tidx[id[i]%2]];
+ d |= ( t & 0x1 ) << ( i + 32 );
+ d |= ( t & 0x2 ) << ( i + 47 );
+ }
+
+ return d;
+}
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.cpp b/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.cpp
new file mode 100644
index 00000000000..de03845c838
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.cpp
@@ -0,0 +1,719 @@
+#include <string.h>
+
+#include "Math.hpp"
+#include "ProcessCommon.hpp"
+#include "ProcessRGB.hpp"
+#include "Tables.hpp"
+#include "Types.hpp"
+#include "Vector.hpp"
+
+#include <bx/endian.h>
+
+#ifdef __SSE4_1__
+# ifdef _MSC_VER
+# include <intrin.h>
+# include <Windows.h>
+# else
+# include <x86intrin.h>
+# endif
+#endif
+
+namespace
+{
+
+typedef uint16 v4i[4];
+
+void Average( const uint8* data, v4i* a )
+{
+#ifdef __SSE4_1__
+ __m128i d0 = _mm_loadu_si128(((__m128i*)data) + 0);
+ __m128i d1 = _mm_loadu_si128(((__m128i*)data) + 1);
+ __m128i d2 = _mm_loadu_si128(((__m128i*)data) + 2);
+ __m128i d3 = _mm_loadu_si128(((__m128i*)data) + 3);
+
+ __m128i d0l = _mm_unpacklo_epi8(d0, _mm_setzero_si128());
+ __m128i d0h = _mm_unpackhi_epi8(d0, _mm_setzero_si128());
+ __m128i d1l = _mm_unpacklo_epi8(d1, _mm_setzero_si128());
+ __m128i d1h = _mm_unpackhi_epi8(d1, _mm_setzero_si128());
+ __m128i d2l = _mm_unpacklo_epi8(d2, _mm_setzero_si128());
+ __m128i d2h = _mm_unpackhi_epi8(d2, _mm_setzero_si128());
+ __m128i d3l = _mm_unpacklo_epi8(d3, _mm_setzero_si128());
+ __m128i d3h = _mm_unpackhi_epi8(d3, _mm_setzero_si128());
+
+ __m128i sum0 = _mm_add_epi16(d0l, d1l);
+ __m128i sum1 = _mm_add_epi16(d0h, d1h);
+ __m128i sum2 = _mm_add_epi16(d2l, d3l);
+ __m128i sum3 = _mm_add_epi16(d2h, d3h);
+
+ __m128i sum0l = _mm_unpacklo_epi16(sum0, _mm_setzero_si128());
+ __m128i sum0h = _mm_unpackhi_epi16(sum0, _mm_setzero_si128());
+ __m128i sum1l = _mm_unpacklo_epi16(sum1, _mm_setzero_si128());
+ __m128i sum1h = _mm_unpackhi_epi16(sum1, _mm_setzero_si128());
+ __m128i sum2l = _mm_unpacklo_epi16(sum2, _mm_setzero_si128());
+ __m128i sum2h = _mm_unpackhi_epi16(sum2, _mm_setzero_si128());
+ __m128i sum3l = _mm_unpacklo_epi16(sum3, _mm_setzero_si128());
+ __m128i sum3h = _mm_unpackhi_epi16(sum3, _mm_setzero_si128());
+
+ __m128i b0 = _mm_add_epi32(sum0l, sum0h);
+ __m128i b1 = _mm_add_epi32(sum1l, sum1h);
+ __m128i b2 = _mm_add_epi32(sum2l, sum2h);
+ __m128i b3 = _mm_add_epi32(sum3l, sum3h);
+
+ __m128i a0 = _mm_srli_epi32(_mm_add_epi32(_mm_add_epi32(b2, b3), _mm_set1_epi32(4)), 3);
+ __m128i a1 = _mm_srli_epi32(_mm_add_epi32(_mm_add_epi32(b0, b1), _mm_set1_epi32(4)), 3);
+ __m128i a2 = _mm_srli_epi32(_mm_add_epi32(_mm_add_epi32(b1, b3), _mm_set1_epi32(4)), 3);
+ __m128i a3 = _mm_srli_epi32(_mm_add_epi32(_mm_add_epi32(b0, b2), _mm_set1_epi32(4)), 3);
+
+ _mm_storeu_si128((__m128i*)&a[0], _mm_packus_epi32(_mm_shuffle_epi32(a0, _MM_SHUFFLE(3, 0, 1, 2)), _mm_shuffle_epi32(a1, _MM_SHUFFLE(3, 0, 1, 2))));
+ _mm_storeu_si128((__m128i*)&a[2], _mm_packus_epi32(_mm_shuffle_epi32(a2, _MM_SHUFFLE(3, 0, 1, 2)), _mm_shuffle_epi32(a3, _MM_SHUFFLE(3, 0, 1, 2))));
+#else
+ uint32 r[4];
+ uint32 g[4];
+ uint32 b[4];
+
+ memset(r, 0, sizeof(r));
+ memset(g, 0, sizeof(g));
+ memset(b, 0, sizeof(b));
+
+ for( int j=0; j<4; j++ )
+ {
+ for( int i=0; i<4; i++ )
+ {
+ int index = (j & 2) + (i >> 1);
+ b[index] += *data++;
+ g[index] += *data++;
+ r[index] += *data++;
+ data++;
+ }
+ }
+
+ a[0][0] = uint16( (r[2] + r[3] + 4) / 8 );
+ a[0][1] = uint16( (g[2] + g[3] + 4) / 8 );
+ a[0][2] = uint16( (b[2] + b[3] + 4) / 8 );
+ a[0][3] = 0;
+ a[1][0] = uint16( (r[0] + r[1] + 4) / 8 );
+ a[1][1] = uint16( (g[0] + g[1] + 4) / 8 );
+ a[1][2] = uint16( (b[0] + b[1] + 4) / 8 );
+ a[1][3] = 0;
+ a[2][0] = uint16( (r[1] + r[3] + 4) / 8 );
+ a[2][1] = uint16( (g[1] + g[3] + 4) / 8 );
+ a[2][2] = uint16( (b[1] + b[3] + 4) / 8 );
+ a[2][3] = 0;
+ a[3][0] = uint16( (r[0] + r[2] + 4) / 8 );
+ a[3][1] = uint16( (g[0] + g[2] + 4) / 8 );
+ a[3][2] = uint16( (b[0] + b[2] + 4) / 8 );
+ a[3][3] = 0;
+#endif
+}
+
+void CalcErrorBlock( const uint8* data, uint err[4][4] )
+{
+#ifdef __SSE4_1__
+ __m128i d0 = _mm_loadu_si128(((__m128i*)data) + 0);
+ __m128i d1 = _mm_loadu_si128(((__m128i*)data) + 1);
+ __m128i d2 = _mm_loadu_si128(((__m128i*)data) + 2);
+ __m128i d3 = _mm_loadu_si128(((__m128i*)data) + 3);
+
+ __m128i dm0 = _mm_and_si128(d0, _mm_set1_epi32(0x00FFFFFF));
+ __m128i dm1 = _mm_and_si128(d1, _mm_set1_epi32(0x00FFFFFF));
+ __m128i dm2 = _mm_and_si128(d2, _mm_set1_epi32(0x00FFFFFF));
+ __m128i dm3 = _mm_and_si128(d3, _mm_set1_epi32(0x00FFFFFF));
+
+ __m128i d0l = _mm_unpacklo_epi8(dm0, _mm_setzero_si128());
+ __m128i d0h = _mm_unpackhi_epi8(dm0, _mm_setzero_si128());
+ __m128i d1l = _mm_unpacklo_epi8(dm1, _mm_setzero_si128());
+ __m128i d1h = _mm_unpackhi_epi8(dm1, _mm_setzero_si128());
+ __m128i d2l = _mm_unpacklo_epi8(dm2, _mm_setzero_si128());
+ __m128i d2h = _mm_unpackhi_epi8(dm2, _mm_setzero_si128());
+ __m128i d3l = _mm_unpacklo_epi8(dm3, _mm_setzero_si128());
+ __m128i d3h = _mm_unpackhi_epi8(dm3, _mm_setzero_si128());
+
+ __m128i sum0 = _mm_add_epi16(d0l, d1l);
+ __m128i sum1 = _mm_add_epi16(d0h, d1h);
+ __m128i sum2 = _mm_add_epi16(d2l, d3l);
+ __m128i sum3 = _mm_add_epi16(d2h, d3h);
+
+ __m128i sum0l = _mm_unpacklo_epi16(sum0, _mm_setzero_si128());
+ __m128i sum0h = _mm_unpackhi_epi16(sum0, _mm_setzero_si128());
+ __m128i sum1l = _mm_unpacklo_epi16(sum1, _mm_setzero_si128());
+ __m128i sum1h = _mm_unpackhi_epi16(sum1, _mm_setzero_si128());
+ __m128i sum2l = _mm_unpacklo_epi16(sum2, _mm_setzero_si128());
+ __m128i sum2h = _mm_unpackhi_epi16(sum2, _mm_setzero_si128());
+ __m128i sum3l = _mm_unpacklo_epi16(sum3, _mm_setzero_si128());
+ __m128i sum3h = _mm_unpackhi_epi16(sum3, _mm_setzero_si128());
+
+ __m128i b0 = _mm_add_epi32(sum0l, sum0h);
+ __m128i b1 = _mm_add_epi32(sum1l, sum1h);
+ __m128i b2 = _mm_add_epi32(sum2l, sum2h);
+ __m128i b3 = _mm_add_epi32(sum3l, sum3h);
+
+ __m128i a0 = _mm_add_epi32(b2, b3);
+ __m128i a1 = _mm_add_epi32(b0, b1);
+ __m128i a2 = _mm_add_epi32(b1, b3);
+ __m128i a3 = _mm_add_epi32(b0, b2);
+
+ _mm_storeu_si128((__m128i*)&err[0], a0);
+ _mm_storeu_si128((__m128i*)&err[1], a1);
+ _mm_storeu_si128((__m128i*)&err[2], a2);
+ _mm_storeu_si128((__m128i*)&err[3], a3);
+#else
+ uint terr[4][4];
+
+ memset(terr, 0, 16 * sizeof(uint));
+
+ for( int j=0; j<4; j++ )
+ {
+ for( int i=0; i<4; i++ )
+ {
+ int index = (j & 2) + (i >> 1);
+ uint d = *data++;
+ terr[index][0] += d;
+ d = *data++;
+ terr[index][1] += d;
+ d = *data++;
+ terr[index][2] += d;
+ data++;
+ }
+ }
+
+ for( int i=0; i<3; i++ )
+ {
+ err[0][i] = terr[2][i] + terr[3][i];
+ err[1][i] = terr[0][i] + terr[1][i];
+ err[2][i] = terr[1][i] + terr[3][i];
+ err[3][i] = terr[0][i] + terr[2][i];
+ }
+ for( int i=0; i<4; i++ )
+ {
+ err[i][3] = 0;
+ }
+#endif
+}
+
+uint CalcError( const uint block[4], const v4i& average )
+{
+ uint err = 0x3FFFFFFF; // Big value to prevent negative values, but small enough to prevent overflow
+ err -= block[0] * 2 * average[2];
+ err -= block[1] * 2 * average[1];
+ err -= block[2] * 2 * average[0];
+ err += 8 * ( sq( average[0] ) + sq( average[1] ) + sq( average[2] ) );
+ return err;
+}
+
+void ProcessAverages( v4i* a )
+{
+#ifdef __SSE4_1__
+ for( int i=0; i<2; i++ )
+ {
+ __m128i d = _mm_loadu_si128((__m128i*)a[i*2].data());
+
+ __m128i t = _mm_add_epi16(_mm_mullo_epi16(d, _mm_set1_epi16(31)), _mm_set1_epi16(128));
+
+ __m128i c = _mm_srli_epi16(_mm_add_epi16(t, _mm_srli_epi16(t, 8)), 8);
+
+ __m128i c1 = _mm_shuffle_epi32(c, _MM_SHUFFLE(3, 2, 3, 2));
+ __m128i diff = _mm_sub_epi16(c, c1);
+ diff = _mm_max_epi16(diff, _mm_set1_epi16(-4));
+ diff = _mm_min_epi16(diff, _mm_set1_epi16(3));
+
+ __m128i co = _mm_add_epi16(c1, diff);
+
+ c = _mm_blend_epi16(co, c, 0xF0);
+
+ __m128i a0 = _mm_or_si128(_mm_slli_epi16(c, 3), _mm_srli_epi16(c, 2));
+
+ _mm_storeu_si128((__m128i*)a[4+i*2].data(), a0);
+ }
+
+ for( int i=0; i<2; i++ )
+ {
+ __m128i d = _mm_loadu_si128((__m128i*)a[i*2].data());
+
+ __m128i t0 = _mm_add_epi16(_mm_mullo_epi16(d, _mm_set1_epi16(15)), _mm_set1_epi16(128));
+ __m128i t1 = _mm_srli_epi16(_mm_add_epi16(t0, _mm_srli_epi16(t0, 8)), 8);
+
+ __m128i t2 = _mm_or_si128(t1, _mm_slli_epi16(t1, 4));
+
+ _mm_storeu_si128((__m128i*)a[i*2].data(), t2);
+ }
+#else
+ for( int i=0; i<2; i++ )
+ {
+ for( int j=0; j<3; j++ )
+ {
+ int32 c1 = mul8bit( a[i*2+1][j], 31 );
+ int32 c2 = mul8bit( a[i*2][j], 31 );
+
+ int32 diff = c2 - c1;
+ if( diff > 3 ) diff = 3;
+ else if( diff < -4 ) diff = -4;
+
+ int32 co = c1 + diff;
+
+ a[5+i*2][j] = ( c1 << 3 ) | ( c1 >> 2 );
+ a[4+i*2][j] = ( co << 3 ) | ( co >> 2 );
+ }
+ }
+
+ for( int i=0; i<4; i++ )
+ {
+ a[i][0] = g_avg2[mul8bit( a[i][0], 15 )];
+ a[i][1] = g_avg2[mul8bit( a[i][1], 15 )];
+ a[i][2] = g_avg2[mul8bit( a[i][2], 15 )];
+ }
+#endif
+}
+
+void EncodeAverages( uint64& _d, const v4i* a, size_t idx )
+{
+ uint64 d = _d;
+ d |= ( idx << 24 );
+ size_t base = idx << 1;
+
+ if( ( idx & 0x2 ) == 0 )
+ {
+ for( int i=0; i<3; i++ )
+ {
+ d |= uint64( a[base+0][i] >> 4 ) << ( i*8 );
+ d |= uint64( a[base+1][i] >> 4 ) << ( i*8 + 4 );
+ }
+ }
+ else
+ {
+ for( int i=0; i<3; i++ )
+ {
+ d |= uint64( a[base+1][i] & 0xF8 ) << ( i*8 );
+ int32 c = ( ( a[base+0][i] & 0xF8 ) - ( a[base+1][i] & 0xF8 ) ) >> 3;
+ c &= ~0xFFFFFFF8;
+ d |= ((uint64)c) << ( i*8 );
+ }
+ }
+ _d = d;
+}
+
+uint64 CheckSolid( const uint8* src )
+{
+#ifdef __SSE4_1__
+ __m128i d0 = _mm_loadu_si128(((__m128i*)src) + 0);
+ __m128i d1 = _mm_loadu_si128(((__m128i*)src) + 1);
+ __m128i d2 = _mm_loadu_si128(((__m128i*)src) + 2);
+ __m128i d3 = _mm_loadu_si128(((__m128i*)src) + 3);
+
+ __m128i c = _mm_shuffle_epi32(d0, _MM_SHUFFLE(0, 0, 0, 0));
+
+ __m128i c0 = _mm_cmpeq_epi8(d0, c);
+ __m128i c1 = _mm_cmpeq_epi8(d1, c);
+ __m128i c2 = _mm_cmpeq_epi8(d2, c);
+ __m128i c3 = _mm_cmpeq_epi8(d3, c);
+
+ __m128i m0 = _mm_and_si128(c0, c1);
+ __m128i m1 = _mm_and_si128(c2, c3);
+ __m128i m = _mm_and_si128(m0, m1);
+
+ if (!_mm_testc_si128(m, _mm_set1_epi32(-1)))
+ {
+ return 0;
+ }
+#else
+ const uint8* ptr = src + 4;
+ for( int i=1; i<16; i++ )
+ {
+ if( memcmp( src, ptr, 4 ) != 0 )
+ {
+ return 0;
+ }
+ ptr += 4;
+ }
+#endif
+ return 0x02000000 |
+ ( uint( src[0] & 0xF8 ) << 16 ) |
+ ( uint( src[1] & 0xF8 ) << 8 ) |
+ ( uint( src[2] & 0xF8 ) );
+}
+
+void PrepareAverages( v4i a[8], const uint8* src, uint err[4] )
+{
+ Average( src, a );
+ ProcessAverages( a );
+
+ uint errblock[4][4];
+ CalcErrorBlock( src, errblock );
+
+ for( int i=0; i<4; i++ )
+ {
+ err[i/2] += CalcError( errblock[i], a[i] );
+ err[2+i/2] += CalcError( errblock[i], a[i+4] );
+ }
+}
+
+void FindBestFit( uint64 terr[2][8], uint16 tsel[16][8], v4i a[8], const uint32* id, const uint8* data )
+{
+ for( size_t i=0; i<16; i++ )
+ {
+ uint16* sel = tsel[i];
+ uint bid = id[i];
+ uint64* ter = terr[bid%2];
+
+ uint8 b = *data++;
+ uint8 g = *data++;
+ uint8 r = *data++;
+ data++;
+
+ int dr = a[bid][0] - r;
+ int dg = a[bid][1] - g;
+ int db = a[bid][2] - b;
+
+#ifdef __SSE4_1__
+ // Reference implementation
+
+ __m128i pix = _mm_set1_epi32(dr * 77 + dg * 151 + db * 28);
+ // Taking the absolute value is way faster. The values are only used to sort, so the result will be the same.
+ __m128i error0 = _mm_abs_epi32(_mm_add_epi32(pix, g_table256_SIMD[0]));
+ __m128i error1 = _mm_abs_epi32(_mm_add_epi32(pix, g_table256_SIMD[1]));
+ __m128i error2 = _mm_abs_epi32(_mm_sub_epi32(pix, g_table256_SIMD[0]));
+ __m128i error3 = _mm_abs_epi32(_mm_sub_epi32(pix, g_table256_SIMD[1]));
+
+ __m128i index0 = _mm_and_si128(_mm_cmplt_epi32(error1, error0), _mm_set1_epi32(1));
+ __m128i minError0 = _mm_min_epi32(error0, error1);
+
+ __m128i index1 = _mm_sub_epi32(_mm_set1_epi32(2), _mm_cmplt_epi32(error3, error2));
+ __m128i minError1 = _mm_min_epi32(error2, error3);
+
+ __m128i minIndex0 = _mm_blendv_epi8(index0, index1, _mm_cmplt_epi32(minError1, minError0));
+ __m128i minError = _mm_min_epi32(minError0, minError1);
+
+ // Squaring the minimum error to produce correct values when adding
+ __m128i minErrorLow = _mm_shuffle_epi32(minError, _MM_SHUFFLE(1, 1, 0, 0));
+ __m128i squareErrorLow = _mm_mul_epi32(minErrorLow, minErrorLow);
+ squareErrorLow = _mm_add_epi64(squareErrorLow, _mm_loadu_si128(((__m128i*)ter) + 0));
+ _mm_storeu_si128(((__m128i*)ter) + 0, squareErrorLow);
+ __m128i minErrorHigh = _mm_shuffle_epi32(minError, _MM_SHUFFLE(3, 3, 2, 2));
+ __m128i squareErrorHigh = _mm_mul_epi32(minErrorHigh, minErrorHigh);
+ squareErrorHigh = _mm_add_epi64(squareErrorHigh, _mm_loadu_si128(((__m128i*)ter) + 1));
+ _mm_storeu_si128(((__m128i*)ter) + 1, squareErrorHigh);
+
+ // Taking the absolute value is way faster. The values are only used to sort, so the result will be the same.
+ error0 = _mm_abs_epi32(_mm_add_epi32(pix, g_table256_SIMD[2]));
+ error1 = _mm_abs_epi32(_mm_add_epi32(pix, g_table256_SIMD[3]));
+ error2 = _mm_abs_epi32(_mm_sub_epi32(pix, g_table256_SIMD[2]));
+ error3 = _mm_abs_epi32(_mm_sub_epi32(pix, g_table256_SIMD[3]));
+
+ index0 = _mm_and_si128(_mm_cmplt_epi32(error1, error0), _mm_set1_epi32(1));
+ minError0 = _mm_min_epi32(error0, error1);
+
+ index1 = _mm_sub_epi32(_mm_set1_epi32(2), _mm_cmplt_epi32(error3, error2));
+ minError1 = _mm_min_epi32(error2, error3);
+
+ __m128i minIndex1 = _mm_blendv_epi8(index0, index1, _mm_cmplt_epi32(minError1, minError0));
+ minError = _mm_min_epi32(minError0, minError1);
+
+ // Squaring the minimum error to produce correct values when adding
+ minErrorLow = _mm_shuffle_epi32(minError, _MM_SHUFFLE(1, 1, 0, 0));
+ squareErrorLow = _mm_mul_epi32(minErrorLow, minErrorLow);
+ squareErrorLow = _mm_add_epi64(squareErrorLow, _mm_loadu_si128(((__m128i*)ter) + 2));
+ _mm_storeu_si128(((__m128i*)ter) + 2, squareErrorLow);
+ minErrorHigh = _mm_shuffle_epi32(minError, _MM_SHUFFLE(3, 3, 2, 2));
+ squareErrorHigh = _mm_mul_epi32(minErrorHigh, minErrorHigh);
+ squareErrorHigh = _mm_add_epi64(squareErrorHigh, _mm_loadu_si128(((__m128i*)ter) + 3));
+ _mm_storeu_si128(((__m128i*)ter) + 3, squareErrorHigh);
+ __m128i minIndex = _mm_packs_epi32(minIndex0, minIndex1);
+ _mm_storeu_si128((__m128i*)sel, minIndex);
+#else
+ int pix = dr * 77 + dg * 151 + db * 28;
+
+ for( int t=0; t<8; t++ )
+ {
+ const int64* tab = g_table256[t];
+ uint idx = 0;
+ uint64 err = sq( tab[0] + pix );
+ for( int j=1; j<4; j++ )
+ {
+ uint64 local = sq( tab[j] + pix );
+ if( local < err )
+ {
+ err = local;
+ idx = j;
+ }
+ }
+ *sel++ = idx;
+ *ter++ += err;
+ }
+#endif
+ }
+}
+
+#ifdef __SSE4_1__
+// Non-reference implementation, but faster. Produces same results as the AVX2 version
+void FindBestFit( uint32 terr[2][8], uint16 tsel[16][8], v4i a[8], const uint32* id, const uint8* data )
+{
+ for( size_t i=0; i<16; i++ )
+ {
+ uint16* sel = tsel[i];
+ uint bid = id[i];
+ uint32* ter = terr[bid%2];
+
+ uint8 b = *data++;
+ uint8 g = *data++;
+ uint8 r = *data++;
+ data++;
+
+ int dr = a[bid][0] - r;
+ int dg = a[bid][1] - g;
+ int db = a[bid][2] - b;
+
+ // The scaling values are divided by two and rounded, to allow the differences to be in the range of signed int16
+ // This produces slightly different results, but is significant faster
+ __m128i pixel = _mm_set1_epi16(dr * 38 + dg * 76 + db * 14);
+ __m128i pix = _mm_abs_epi16(pixel);
+
+ // Taking the absolute value is way faster. The values are only used to sort, so the result will be the same.
+ // Since the selector table is symmetrical, we need to calculate the difference only for half of the entries.
+ __m128i error0 = _mm_abs_epi16(_mm_sub_epi16(pix, g_table128_SIMD[0]));
+ __m128i error1 = _mm_abs_epi16(_mm_sub_epi16(pix, g_table128_SIMD[1]));
+
+ __m128i index = _mm_and_si128(_mm_cmplt_epi16(error1, error0), _mm_set1_epi16(1));
+ __m128i minError = _mm_min_epi16(error0, error1);
+
+ // Exploiting symmetry of the selector table and use the sign bit
+ // This produces slightly different results, but is needed to produce same results as AVX2 implementation
+ __m128i indexBit = _mm_andnot_si128(_mm_srli_epi16(pixel, 15), _mm_set1_epi8(-1));
+ __m128i minIndex = _mm_or_si128(index, _mm_add_epi16(indexBit, indexBit));
+
+ // Squaring the minimum error to produce correct values when adding
+ __m128i squareErrorLo = _mm_mullo_epi16(minError, minError);
+ __m128i squareErrorHi = _mm_mulhi_epi16(minError, minError);
+
+ __m128i squareErrorLow = _mm_unpacklo_epi16(squareErrorLo, squareErrorHi);
+ __m128i squareErrorHigh = _mm_unpackhi_epi16(squareErrorLo, squareErrorHi);
+
+ squareErrorLow = _mm_add_epi32(squareErrorLow, _mm_loadu_si128(((__m128i*)ter) + 0));
+ _mm_storeu_si128(((__m128i*)ter) + 0, squareErrorLow);
+ squareErrorHigh = _mm_add_epi32(squareErrorHigh, _mm_loadu_si128(((__m128i*)ter) + 1));
+ _mm_storeu_si128(((__m128i*)ter) + 1, squareErrorHigh);
+
+ _mm_storeu_si128((__m128i*)sel, minIndex);
+ }
+}
+#endif
+
+uint8_t convert6(float f)
+{
+ int i = (std::min(std::max(static_cast<int>(f), 0), 1023) - 15) >> 1;
+ return (i + 11 - ((i + 11) >> 7) - ((i + 4) >> 7)) >> 3;
+}
+
+uint8_t convert7(float f)
+{
+ int i = (std::min(std::max(static_cast<int>(f), 0), 1023) - 15) >> 1;
+ return (i + 9 - ((i + 9) >> 8) - ((i + 6) >> 8)) >> 2;
+}
+
+std::pair<uint64, uint64> Planar(const uint8* src)
+{
+ int32 r = 0;
+ int32 g = 0;
+ int32 b = 0;
+
+ for (int i = 0; i < 16; ++i)
+ {
+ b += src[i * 4 + 0];
+ g += src[i * 4 + 1];
+ r += src[i * 4 + 2];
+ }
+
+ int32 difRyz = 0;
+ int32 difGyz = 0;
+ int32 difByz = 0;
+ int32 difRxz = 0;
+ int32 difGxz = 0;
+ int32 difBxz = 0;
+
+ const int32 scaling[] = { -255, -85, 85, 255 };
+
+ for (int i = 0; i < 16; ++i)
+ {
+ int32 difB = (static_cast<int>(src[i * 4 + 0]) << 4) - b;
+ int32 difG = (static_cast<int>(src[i * 4 + 1]) << 4) - g;
+ int32 difR = (static_cast<int>(src[i * 4 + 2]) << 4) - r;
+
+ difRyz += difR * scaling[i % 4];
+ difGyz += difG * scaling[i % 4];
+ difByz += difB * scaling[i % 4];
+
+ difRxz += difR * scaling[i / 4];
+ difGxz += difG * scaling[i / 4];
+ difBxz += difB * scaling[i / 4];
+ }
+
+ const float scale = -4.0f / ((255 * 255 * 8.0f + 85 * 85 * 8.0f) * 16.0f);
+
+ float aR = difRxz * scale;
+ float aG = difGxz * scale;
+ float aB = difBxz * scale;
+
+ float bR = difRyz * scale;
+ float bG = difGyz * scale;
+ float bB = difByz * scale;
+
+ float dR = r * (4.0f / 16.0f);
+ float dG = g * (4.0f / 16.0f);
+ float dB = b * (4.0f / 16.0f);
+
+ // calculating the three colors RGBO, RGBH, and RGBV. RGB = df - af * x - bf * y;
+ float cofR = (aR * 255.0f + (bR * 255.0f + dR));
+ float cofG = (aG * 255.0f + (bG * 255.0f + dG));
+ float cofB = (aB * 255.0f + (bB * 255.0f + dB));
+ float chfR = (aR * -425.0f + (bR * 255.0f + dR));
+ float chfG = (aG * -425.0f + (bG * 255.0f + dG));
+ float chfB = (aB * -425.0f + (bB * 255.0f + dB));
+ float cvfR = (aR * 255.0f + (bR * -425.0f + dR));
+ float cvfG = (aG * 255.0f + (bG * -425.0f + dG));
+ float cvfB = (aB * 255.0f + (bB * -425.0f + dB));
+
+ // convert to r6g7b6
+ int32 coR = convert6(cofR);
+ int32 coG = convert7(cofG);
+ int32 coB = convert6(cofB);
+ int32 chR = convert6(chfR);
+ int32 chG = convert7(chfG);
+ int32 chB = convert6(chfB);
+ int32 cvR = convert6(cvfR);
+ int32 cvG = convert7(cvfG);
+ int32 cvB = convert6(cvfB);
+
+ // Error calculation
+ int32 ro0 = coR;
+ int32 go0 = coG;
+ int32 bo0 = coB;
+ int32 ro1 = (ro0 >> 4) | (ro0 << 2);
+ int32 go1 = (go0 >> 6) | (go0 << 1);
+ int32 bo1 = (bo0 >> 4) | (bo0 << 2);
+ int32 ro2 = (ro1 << 2) + 2;
+ int32 go2 = (go1 << 2) + 2;
+ int32 bo2 = (bo1 << 2) + 2;
+
+ int32 rh0 = chR;
+ int32 gh0 = chG;
+ int32 bh0 = chB;
+ int32 rh1 = (rh0 >> 4) | (rh0 << 2);
+ int32 gh1 = (gh0 >> 6) | (gh0 << 1);
+ int32 bh1 = (bh0 >> 4) | (bh0 << 2);
+
+ int32 rh2 = rh1 - ro1;
+ int32 gh2 = gh1 - go1;
+ int32 bh2 = bh1 - bo1;
+
+ int32 rv0 = cvR;
+ int32 gv0 = cvG;
+ int32 bv0 = cvB;
+ int32 rv1 = (rv0 >> 4) | (rv0 << 2);
+ int32 gv1 = (gv0 >> 6) | (gv0 << 1);
+ int32 bv1 = (bv0 >> 4) | (bv0 << 2);
+
+ int32 rv2 = rv1 - ro1;
+ int32 gv2 = gv1 - go1;
+ int32 bv2 = bv1 - bo1;
+
+ uint64 error = 0;
+
+ for (int i = 0; i < 16; ++i)
+ {
+ int32 cR = clampu8((rh2 * (i / 4) + rv2 * (i % 4) + ro2) >> 2);
+ int32 cG = clampu8((gh2 * (i / 4) + gv2 * (i % 4) + go2) >> 2);
+ int32 cB = clampu8((bh2 * (i / 4) + bv2 * (i % 4) + bo2) >> 2);
+
+ int32 difB = static_cast<int>(src[i * 4 + 0]) - cB;
+ int32 difG = static_cast<int>(src[i * 4 + 1]) - cG;
+ int32 difR = static_cast<int>(src[i * 4 + 2]) - cR;
+
+ int32 dif = difR * 38 + difG * 76 + difB * 14;
+
+ error += dif * dif;
+ }
+
+ /**/
+ uint32 rgbv = cvB | (cvG << 6) | (cvR << 13);
+ uint32 rgbh = chB | (chG << 6) | (chR << 13);
+ uint32 hi = rgbv | ((rgbh & 0x1FFF) << 19);
+ uint32 lo = (chR & 0x1) | 0x2 | ((chR << 1) & 0x7C);
+ lo |= ((coB & 0x07) << 7) | ((coB & 0x18) << 8) | ((coB & 0x20) << 11);
+ lo |= ((coG & 0x3F) << 17) | ((coG & 0x40) << 18);
+ lo |= coR << 25;
+
+ const int32 idx = (coR & 0x20) | ((coG & 0x20) >> 1) | ((coB & 0x1E) >> 1);
+
+ lo |= g_flags[idx];
+
+ uint64 result = static_cast<uint32>(bx::endianSwap(lo));
+ result |= static_cast<uint64>(static_cast<uint32>(bx::endianSwap(hi))) << 32;
+
+ return std::make_pair(result, error);
+}
+
+template<class T, class S>
+uint64 EncodeSelectors( uint64 d, const T terr[2][8], const S tsel[16][8], const uint32* id, const uint64 value, const uint64 error)
+{
+ size_t tidx[2];
+ tidx[0] = GetLeastError( terr[0], 8 );
+ tidx[1] = GetLeastError( terr[1], 8 );
+
+ if ((terr[0][tidx[0]] + terr[1][tidx[1]]) >= error)
+ {
+ return value;
+ }
+
+ d |= tidx[0] << 26;
+ d |= tidx[1] << 29;
+ for( int i=0; i<16; i++ )
+ {
+ uint64 t = tsel[i][tidx[id[i]%2]];
+ d |= ( t & 0x1 ) << ( i + 32 );
+ d |= ( t & 0x2 ) << ( i + 47 );
+ }
+
+ return FixByteOrder(d);
+}
+}
+
+uint64 ProcessRGB( const uint8* src )
+{
+ uint64 d = CheckSolid( src );
+ if( d != 0 ) return d;
+
+ v4i a[8];
+ uint err[4] = {};
+ PrepareAverages( a, src, err );
+ size_t idx = GetLeastError( err, 4 );
+ EncodeAverages( d, a, idx );
+
+#if defined __SSE4_1__ && !defined REFERENCE_IMPLEMENTATION
+ uint32 terr[2][8] = {};
+#else
+ uint64 terr[2][8] = {};
+#endif
+ uint16 tsel[16][8];
+ const uint32* id = g_id[idx];
+ FindBestFit( terr, tsel, a, id, src );
+
+ return FixByteOrder( EncodeSelectors( d, terr, tsel, id ) );
+}
+
+uint64 ProcessRGB_ETC2( const uint8* src )
+{
+ std::pair<uint64, uint64> result = Planar( src );
+
+ uint64 d = 0;
+
+ v4i a[8];
+ uint err[4] = {};
+ PrepareAverages( a, src, err );
+ size_t idx = GetLeastError( err, 4 );
+ EncodeAverages( d, a, idx );
+
+ uint64 terr[2][8] = {};
+ uint16 tsel[16][8];
+ const uint32* id = g_id[idx];
+ FindBestFit( terr, tsel, a, id, src );
+
+ return EncodeSelectors( d, terr, tsel, id, result.first, result.second );
+}
diff --git a/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.hpp b/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.hpp
new file mode 100644
index 00000000000..21434a3b267
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/ProcessRGB.hpp
@@ -0,0 +1,9 @@
+#ifndef __PROCESSRGB_HPP__
+#define __PROCESSRGB_HPP__
+
+#include "Types.hpp"
+
+uint64 ProcessRGB( const uint8* src );
+uint64 ProcessRGB_ETC2( const uint8* src );
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/etc2/Tables.cpp b/3rdparty/bgfx/3rdparty/etc2/Tables.cpp
new file mode 100644
index 00000000000..968fbf5838c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/Tables.cpp
@@ -0,0 +1,109 @@
+#include "Tables.hpp"
+
+const int32 g_table[8][4] = {
+ { 2, 8, -2, -8 },
+ { 5, 17, -5, -17 },
+ { 9, 29, -9, -29 },
+ { 13, 42, -13, -42 },
+ { 18, 60, -18, -60 },
+ { 24, 80, -24, -80 },
+ { 33, 106, -33, -106 },
+ { 47, 183, -47, -183 }
+};
+
+const int64 g_table256[8][4] = {
+ { 2*256, 8*256, -2*256, -8*256 },
+ { 5*256, 17*256, -5*256, -17*256 },
+ { 9*256, 29*256, -9*256, -29*256 },
+ { 13*256, 42*256, -13*256, -42*256 },
+ { 18*256, 60*256, -18*256, -60*256 },
+ { 24*256, 80*256, -24*256, -80*256 },
+ { 33*256, 106*256, -33*256, -106*256 },
+ { 47*256, 183*256, -47*256, -183*256 }
+};
+
+const uint32 g_id[4][16] = {
+ { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4 },
+ { 7, 7, 6, 6, 7, 7, 6, 6, 7, 7, 6, 6, 7, 7, 6, 6 }
+};
+
+const uint32 g_avg2[16] = {
+ 0x00,
+ 0x11,
+ 0x22,
+ 0x33,
+ 0x44,
+ 0x55,
+ 0x66,
+ 0x77,
+ 0x88,
+ 0x99,
+ 0xAA,
+ 0xBB,
+ 0xCC,
+ 0xDD,
+ 0xEE,
+ 0xFF
+};
+
+const uint32 g_flags[64] = {
+ 0x80800402, 0x80800402, 0x80800402, 0x80800402,
+ 0x80800402, 0x80800402, 0x80800402, 0x8080E002,
+ 0x80800402, 0x80800402, 0x8080E002, 0x8080E002,
+ 0x80800402, 0x8080E002, 0x8080E002, 0x8080E002,
+ 0x80000402, 0x80000402, 0x80000402, 0x80000402,
+ 0x80000402, 0x80000402, 0x80000402, 0x8000E002,
+ 0x80000402, 0x80000402, 0x8000E002, 0x8000E002,
+ 0x80000402, 0x8000E002, 0x8000E002, 0x8000E002,
+ 0x00800402, 0x00800402, 0x00800402, 0x00800402,
+ 0x00800402, 0x00800402, 0x00800402, 0x0080E002,
+ 0x00800402, 0x00800402, 0x0080E002, 0x0080E002,
+ 0x00800402, 0x0080E002, 0x0080E002, 0x0080E002,
+ 0x00000402, 0x00000402, 0x00000402, 0x00000402,
+ 0x00000402, 0x00000402, 0x00000402, 0x0000E002,
+ 0x00000402, 0x00000402, 0x0000E002, 0x0000E002,
+ 0x00000402, 0x0000E002, 0x0000E002, 0x0000E002
+};
+
+#ifdef __SSE4_1__
+const uint8 g_flags_AVX2[64] =
+{
+ 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x7D,
+ 0x63, 0x63, 0x7D, 0x7D,
+ 0x63, 0x7D, 0x7D, 0x7D,
+ 0x43, 0x43, 0x43, 0x43,
+ 0x43, 0x43, 0x43, 0x5D,
+ 0x43, 0x43, 0x5D, 0x5D,
+ 0x43, 0x5D, 0x5D, 0x5D,
+ 0x23, 0x23, 0x23, 0x23,
+ 0x23, 0x23, 0x23, 0x3D,
+ 0x23, 0x23, 0x3D, 0x3D,
+ 0x23, 0x3D, 0x3D, 0x3D,
+ 0x03, 0x03, 0x03, 0x03,
+ 0x03, 0x03, 0x03, 0x1D,
+ 0x03, 0x03, 0x1D, 0x1D,
+ 0x03, 0x1D, 0x1D, 0x1D,
+};
+
+const __m128i g_table_SIMD[2] =
+{
+ _mm_setr_epi16( 2, 5, 9, 13, 18, 24, 33, 47),
+ _mm_setr_epi16( 8, 17, 29, 42, 60, 80, 106, 183)
+};
+const __m128i g_table128_SIMD[2] =
+{
+ _mm_setr_epi16( 2*128, 5*128, 9*128, 13*128, 18*128, 24*128, 33*128, 47*128),
+ _mm_setr_epi16( 8*128, 17*128, 29*128, 42*128, 60*128, 80*128, 106*128, 183*128)
+};
+const __m128i g_table256_SIMD[4] =
+{
+ _mm_setr_epi32( 2*256, 5*256, 9*256, 13*256),
+ _mm_setr_epi32( 8*256, 17*256, 29*256, 42*256),
+ _mm_setr_epi32( 18*256, 24*256, 33*256, 47*256),
+ _mm_setr_epi32( 60*256, 80*256, 106*256, 183*256)
+};
+#endif
+
diff --git a/3rdparty/bgfx/3rdparty/etc2/Tables.hpp b/3rdparty/bgfx/3rdparty/etc2/Tables.hpp
new file mode 100644
index 00000000000..b570526dc57
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/Tables.hpp
@@ -0,0 +1,25 @@
+#ifndef __TABLES_HPP__
+#define __TABLES_HPP__
+
+#include "Types.hpp"
+#ifdef __SSE4_1__
+#include <smmintrin.h>
+#endif
+
+extern const int32 g_table[8][4];
+extern const int64 g_table256[8][4];
+
+extern const uint32 g_id[4][16];
+
+extern const uint32 g_avg2[16];
+
+extern const uint32 g_flags[64];
+
+#ifdef __SSE4_1__
+extern const uint8 g_flags_AVX2[64];
+extern const __m128i g_table_SIMD[2];
+extern const __m128i g_table128_SIMD[2];
+extern const __m128i g_table256_SIMD[4];
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/etc2/Types.hpp b/3rdparty/bgfx/3rdparty/etc2/Types.hpp
new file mode 100644
index 00000000000..b31da22e4d8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/Types.hpp
@@ -0,0 +1,17 @@
+#ifndef __DARKRL__TYPES_HPP__
+#define __DARKRL__TYPES_HPP__
+
+#include <stdint.h>
+
+typedef int8_t int8;
+typedef uint8_t uint8;
+typedef int16_t int16;
+typedef uint16_t uint16;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
+
+typedef unsigned int uint;
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/etc2/Vector.hpp b/3rdparty/bgfx/3rdparty/etc2/Vector.hpp
new file mode 100644
index 00000000000..3005fdc5395
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/etc2/Vector.hpp
@@ -0,0 +1,222 @@
+#ifndef __DARKRL__VECTOR_HPP__
+#define __DARKRL__VECTOR_HPP__
+
+#include <assert.h>
+#include <algorithm>
+#include <math.h>
+
+#include "Math.hpp"
+#include "Types.hpp"
+
+template<class T>
+struct Vector2
+{
+ Vector2() : x( 0 ), y( 0 ) {}
+ Vector2( T v ) : x( v ), y( v ) {}
+ Vector2( T _x, T _y ) : x( _x ), y( _y ) {}
+
+ bool operator==( const Vector2<T>& rhs ) const { return x == rhs.x && y == rhs.y; }
+ bool operator!=( const Vector2<T>& rhs ) const { return !( *this == rhs ); }
+
+ Vector2<T>& operator+=( const Vector2<T>& rhs )
+ {
+ x += rhs.x;
+ y += rhs.y;
+ return *this;
+ }
+ Vector2<T>& operator-=( const Vector2<T>& rhs )
+ {
+ x -= rhs.x;
+ y -= rhs.y;
+ return *this;
+ }
+ Vector2<T>& operator*=( const Vector2<T>& rhs )
+ {
+ x *= rhs.x;
+ y *= rhs.y;
+ return *this;
+ }
+
+ T x, y;
+};
+
+template<class T>
+Vector2<T> operator+( const Vector2<T>& lhs, const Vector2<T>& rhs )
+{
+ return Vector2<T>( lhs.x + rhs.x, lhs.y + rhs.y );
+}
+
+template<class T>
+Vector2<T> operator-( const Vector2<T>& lhs, const Vector2<T>& rhs )
+{
+ return Vector2<T>( lhs.x - rhs.x, lhs.y - rhs.y );
+}
+
+template<class T>
+Vector2<T> operator*( const Vector2<T>& lhs, const float& rhs )
+{
+ return Vector2<T>( lhs.x * rhs, lhs.y * rhs );
+}
+
+template<class T>
+Vector2<T> operator/( const Vector2<T>& lhs, const T& rhs )
+{
+ return Vector2<T>( lhs.x / rhs, lhs.y / rhs );
+}
+
+
+typedef Vector2<int32> v2i;
+typedef Vector2<float> v2f;
+
+
+template<class T>
+struct Vector3
+{
+ Vector3() : x( 0 ), y( 0 ), z( 0 ) {}
+ Vector3( T v ) : x( v ), y( v ), z( v ) {}
+ Vector3( T _x, T _y, T _z ) : x( _x ), y( _y ), z( _z ) {}
+ template<class Y>
+ Vector3( const Vector3<Y>& v ) : x( T( v.x ) ), y( T( v.y ) ), z( T( v.z ) ) {}
+
+ T Luminance() const { return T( x * 0.3f + y * 0.59f + z * 0.11f ); }
+ void Clamp()
+ {
+ x = std::min( T(1), std::max( T(0), x ) );
+ y = std::min( T(1), std::max( T(0), y ) );
+ z = std::min( T(1), std::max( T(0), z ) );
+ }
+
+ bool operator==( const Vector3<T>& rhs ) const { return x == rhs.x && y == rhs.y && z == rhs.z; }
+ bool operator!=( const Vector2<T>& rhs ) const { return !( *this == rhs ); }
+
+ T& operator[]( uint idx ) { assert( idx < 3 ); return ((T*)this)[idx]; }
+ const T& operator[]( uint idx ) const { assert( idx < 3 ); return ((T*)this)[idx]; }
+
+ Vector3<T> operator+=( const Vector3<T>& rhs )
+ {
+ x += rhs.x;
+ y += rhs.y;
+ z += rhs.z;
+ return *this;
+ }
+
+ Vector3<T> operator*=( const Vector3<T>& rhs )
+ {
+ x *= rhs.x;
+ y *= rhs.y;
+ z *= rhs.z;
+ return *this;
+ }
+
+ Vector3<T> operator*=( const float& rhs )
+ {
+ x *= rhs;
+ y *= rhs;
+ z *= rhs;
+ return *this;
+ }
+
+ T x, y, z;
+ T padding;
+};
+
+template<class T>
+Vector3<T> operator+( const Vector3<T>& lhs, const Vector3<T>& rhs )
+{
+ return Vector3<T>( lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z );
+}
+
+template<class T>
+Vector3<T> operator-( const Vector3<T>& lhs, const Vector3<T>& rhs )
+{
+ return Vector3<T>( lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z );
+}
+
+template<class T>
+Vector3<T> operator*( const Vector3<T>& lhs, const Vector3<T>& rhs )
+{
+ return Vector3<T>( lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z );
+}
+
+template<class T>
+Vector3<T> operator*( const Vector3<T>& lhs, const float& rhs )
+{
+ return Vector3<T>( T( lhs.x * rhs ), T( lhs.y * rhs ), T( lhs.z * rhs ) );
+}
+
+template<class T>
+Vector3<T> operator/( const Vector3<T>& lhs, const T& rhs )
+{
+ return Vector3<T>( lhs.x / rhs, lhs.y / rhs, lhs.z / rhs );
+}
+
+template<class T>
+bool operator<( const Vector3<T>& lhs, const Vector3<T>& rhs )
+{
+ return lhs.Luminance() < rhs.Luminance();
+}
+
+typedef Vector3<int32> v3i;
+typedef Vector3<float> v3f;
+typedef Vector3<uint8> v3b;
+
+
+static inline v3b v3f_to_v3b( const v3f& v )
+{
+ return v3b( uint8( std::min( 1.f, v.x ) * 255 ), uint8( std::min( 1.f, v.y ) * 255 ), uint8( std::min( 1.f, v.z ) * 255 ) );
+}
+
+template<class T>
+Vector3<T> Mix( const Vector3<T>& v1, const Vector3<T>& v2, float amount )
+{
+ return v1 + ( v2 - v1 ) * amount;
+}
+
+template<>
+inline v3b Mix( const v3b& v1, const v3b& v2, float amount )
+{
+ return v3b( v3f( v1 ) + ( v3f( v2 ) - v3f( v1 ) ) * amount );
+}
+
+template<class T>
+Vector3<T> Desaturate( const Vector3<T>& v )
+{
+ T l = v.Luminance();
+ return Vector3<T>( l, l, l );
+}
+
+template<class T>
+Vector3<T> Desaturate( const Vector3<T>& v, float mul )
+{
+ T l = T( v.Luminance() * mul );
+ return Vector3<T>( l, l, l );
+}
+
+template<class T>
+Vector3<T> pow( const Vector3<T>& base, float exponent )
+{
+ return Vector3<T>(
+ pow( base.x, exponent ),
+ pow( base.y, exponent ),
+ pow( base.z, exponent ) );
+}
+
+template<class T>
+Vector3<T> sRGB2linear( const Vector3<T>& v )
+{
+ return Vector3<T>(
+ sRGB2linear( v.x ),
+ sRGB2linear( v.y ),
+ sRGB2linear( v.z ) );
+}
+
+template<class T>
+Vector3<T> linear2sRGB( const Vector3<T>& v )
+{
+ return Vector3<T>(
+ linear2sRGB( v.x ),
+ linear2sRGB( v.y ),
+ linear2sRGB( v.z ) );
+}
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp b/3rdparty/bgfx/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp
index 0dd59c63cbe..3d23d2ba0ab 100644
--- a/3rdparty/bgfx/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp
@@ -293,7 +293,7 @@ namespace Forsyth
assert(vertexData.activeFaceListSize > 0);
uint* begin = &activeFaceList[vertexData.activeFaceListStart];
- uint* end = &activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize];
+ uint* end = &(activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize - 1]) + 1;
uint* it = std::find(begin, end, bestFace);
assert(it != end);
std::swap(*it, *(end-1));
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore
index 1c9b0ddd6db..722300c5026 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore
@@ -1,7 +1,5 @@
glcpp
glcpp-parse.output
-glcpp-parse.c
-glcpp-parse.h
*.o
*.lo
diff --git a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucdarwin.h b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucdarwin.h
index 04900cfb0a0..968f4bc0069 100644
--- a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucdarwin.h
+++ b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucdarwin.h
@@ -29,7 +29,7 @@
#endif
#define NV_FASTCALL __attribute__((fastcall))
-#define NV_FORCEINLINE __attribute__((always_inline)) inline
+#define NV_FORCEINLINE inline
#define NV_DEPRECATED __attribute__((deprecated))
#define NV_THREAD_LOCAL //ACS: there's no "__thread" or equivalent on iOS/OSX
diff --git a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnuclinux.h b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnuclinux.h
index 5d2e4b8dcd0..117d342ea7d 100644
--- a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnuclinux.h
+++ b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnuclinux.h
@@ -31,7 +31,7 @@
#define NV_FASTCALL __attribute__((fastcall))
//#if __GNUC__ > 3
// It seems that GCC does not assume always_inline implies inline. I think this depends on the GCC version :(
-#define NV_FORCEINLINE inline __attribute__((always_inline))
+#define NV_FORCEINLINE inline
//#else
// Some compilers complain that inline and always_inline are redundant.
//#define NV_FORCEINLINE __attribute__((always_inline))
diff --git a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucwin32.h b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucwin32.h
index e416d3d4153..68465c8247f 100644
--- a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucwin32.h
+++ b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsgnucwin32.h
@@ -19,7 +19,7 @@
#endif
#define NV_FASTCALL __attribute__((fastcall))
-#define NV_FORCEINLINE __attribute__((always_inline))
+#define NV_FORCEINLINE inline
#define NV_DEPRECATED __attribute__((deprecated))
#if __GNUC__ > 2
diff --git a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsvcwin32.h b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsvcwin32.h
index 7b3876ab4b3..a6c6bf93bda 100644
--- a/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsvcwin32.h
+++ b/3rdparty/bgfx/3rdparty/nvtt/nvcore/defsvcwin32.h
@@ -48,7 +48,7 @@
#endif
#define NV_NOINLINE __declspec(noinline)
-#define NV_FORCEINLINE __forceinline
+#define NV_FORCEINLINE inline
#define NV_THREAD_LOCAL __declspec(thread)
diff --git a/3rdparty/bgfx/3rdparty/nvtt/nvmath/nvmath.h b/3rdparty/bgfx/3rdparty/nvtt/nvmath/nvmath.h
index 7a64f600153..94f7ec7947a 100644
--- a/3rdparty/bgfx/3rdparty/nvtt/nvmath/nvmath.h
+++ b/3rdparty/bgfx/3rdparty/nvtt/nvmath/nvmath.h
@@ -35,7 +35,12 @@ namespace nv
inline bool isFinite(const float f)
{
+#if defined(_MSC_VER) && _MSC_VER <= 1800
+ (void)f;
+ return true;
+#else
return std::isfinite(f);
+#endif // defined(_MSC_VER) && _MSC_VER <= 1800
}
// Eliminates negative zeros from a float array.
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index c7adf2efba6..0949fe7de96 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -17,6 +17,7 @@
- PROGRAMMER GUIDE (read me!)
- API BREAKING CHANGES (read me when you update!)
- FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
+ - How can I help?
- How do I update to a newer version of ImGui?
- Can I have multiple widgets with the same label? Can I have widget without a label? (Yes)
- I integrated ImGui in my engine and the text or lines are blurry..
@@ -148,6 +149,7 @@
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
+ - 2016/01/23 (1.48) - fixed not honoring exact width passed to PushItemWidth(), previously it would add extra FramePadding.x*2 over that width. if you had manual pixel-perfect alignment in place it might affect you.
- 2015/12/27 (1.48) - fixed ImDrawList::AddRect() which used to render a rectangle 1 px too large on each axis.
- 2015/12/04 (1.47) - renamed Color() helpers to ValueColor() - dangerously named, rarely used and probably to be made obsolete.
- 2015/08/29 (1.45) - with the addition of horizontal scrollbar we made various fixes to inconsistencies with dealing with cursor position.
@@ -236,6 +238,10 @@
FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
======================================
+ Q: How can I help?
+ A: - If you are experienced enough with ImGui and with C/C++, look at the todo list and see how you want/can help!
+ - Become a Patron/donate. Convince your company to become a Patron or provide serious funding for development time.
+
Q: How do I update to a newer version of ImGui?
A: Overwrite the following files:
imgui.cpp
@@ -359,6 +365,7 @@
Q: How can I load multiple fonts?
A: Use the font atlas to pack them into a single texture:
+ (Read extra_fonts/README.txt and the code in ImFontAtlas for more details.)
ImGuiIO& io = ImGui::GetIO();
ImFont* font0 = io.Fonts->AddFontDefault();
@@ -371,7 +378,7 @@
// Options
ImFontConfig config;
config.OversampleH = 3;
- config.OversampleV = 3;
+ config.OversampleV = 1;
config.GlyphExtraSpacing.x = 1.0f;
io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, &config);
@@ -383,8 +390,6 @@
io.Fonts->LoadFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese());
- Read extra_fonts/README.txt or ImFontAtlas class for more details.
-
Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
A: When loading a font, pass custom Unicode ranges to specify the glyphs to load. ImGui will support UTF-8 encoding across the board.
Character input depends on you passing the right character code to io.AddInputCharacter(). The example applications do that.
@@ -402,9 +407,10 @@
ISSUES & TODO-LIST
==================
- Issue numbers (#) refer to github issues.
+ Issue numbers (#) refer to github issues listed at https://github.com/ocornut/imgui/issues
The list below consist mostly of notes of things to do before they are requested/discussed by users (at that point it usually happens on the github)
+ - doc: add a proper documentation+regression testing system (#435)
- window: maximum window size settings (per-axis). for large popups in particular user may not want the popup to fill all space.
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis).
@@ -421,7 +427,7 @@
- window/tooltip: allow to set the width of a tooltip to allow TextWrapped() etc. while keeping the height automatic.
- draw-list: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
!- scrolling: allow immediately effective change of scroll if we haven't appended items yet
- - splitter: formalize the splitter idiom into an official api (we want to handle n-way split)
+ - splitter/separator: formalize the splitter idiom into an official api (we want to handle n-way split) (#319)
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
- widgets: clean up widgets internal toward exposing everything.
- widgets: add disabled and read-only modes (#211)
@@ -444,13 +450,14 @@
- layout: horizontal flow until no space left (#404)
- layout: more generic alignment state (left/right/centered) for single items?
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
+ - columns: declare column set (each column: fixed size, %, fill, distribute default size among fills) (#513, #125)
+ - columns: add a conditional parameter to SetColumnOffset() (#513, #125)
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (#125)
- - columns: declare column set (each column: fixed size, %, fill, distribute default size among fills) (#125)
- - columns: columns header to act as button (~sort op) and allow resize/reorder (#125)
- - columns: user specify columns size (#125)
+ - columns: columns header to act as button (~sort op) and allow resize/reorder (#513, #125)
+ - columns: user specify columns size (#513, #125)
- columns: flag to add horizontal separator above/below?
- columns/layout: setup minimum line height (equivalent of automatically calling AlignFirstTextHeightToWidgets)
- - combo: sparse combo boxes (via function call?)
+ - combo: sparse combo boxes (via function call?) / iterators
- combo: contents should extends to fit label if combo widget is small
- combo/listbox: keyboard control. need InputText-like non-active focus + key handling. considering keyboard for custom listbox (pr #203)
- listbox: multiple selection
@@ -460,15 +467,16 @@
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
- popups: add variant using global identifier similar to Begin/End (#402)
- popups: border options. richer api like BeginChild() perhaps? (#197)
- - menus: local shortcuts, global shortcuts (#126)
+ - menus: local shortcuts, global shortcuts (#456, #126)
- menus: icons
- menus: menubars: some sort of priority / effect of main menu-bar on desktop size?
- statusbar: add a per-window status bar helper similar to what menubar does.
- - tabs
+ - tabs (#261, #351)
- separator: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y)
- - gauge: various forms of gauge/loading bars widgets
- color: the color helpers/typing is a mess and needs sorting out.
- - color: add a better color picker
+ - color: add a better color picker (#346)
+ - node/graph editor (#306)
+ - pie menus patterns (#434)
- plot: PlotLines() should use the polygon-stroke facilities (currently issues with averaging normals)
- plot: make it easier for user to draw extra stuff into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
- plot: "smooth" automatic scale over time, user give an input 0.0(full user scale) 1.0(full derived from value)
@@ -491,12 +499,14 @@
- textwrapped: figure out better way to use TextWrapped() in an always auto-resize context (tooltip, etc.) (git issue #249)
- settings: write more decent code to allow saving/loading new fields
- settings: api for per-tool simple persistent data (bool,int,float,columns sizes,etc.) in .ini file
+ - style: add window shadows.
- style/optimization: store rounded corners in texture to use 1 quad per corner (filled and wireframe) to lower the cost of rounding.
- style: color-box not always square?
- style: a concept of "compact style" that the end-user can easily rely on (e.g. PushStyleCompact()?) that maps to other settings? avoid implementing duplicate helpers such as SmallCheckbox(), etc.
- style: try to make PushStyleVar() more robust to incorrect parameters (to be more friendly to edit & continues situation).
- style: global scale setting.
- text: simple markup language for color change?
+ - font: dynamic font atlas to avoid baking huge ranges into bitmap and make scaling easier.
- font: helper to add glyph redirect/replacements (e.g. redirect alternate apostrophe unicode code points to ascii one, etc.)
- log: LogButtons() options for specifying depth and/or hiding depth slider
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
@@ -506,14 +516,16 @@
- filters: handle wildcards (with implicit leading/trailing *), regexps
- shortcuts: add a shortcut api, e.g. parse "&Save" and/or "Save (CTRL+S)", pass in to widgets or provide simple ways to use (button=activate, input=focus)
!- keyboard: tooltip & combo boxes are messing up / not honoring keyboard tabbing
- - keyboard: full keyboard navigation and focus.
+ - keyboard: full keyboard navigation and focus. (#323)
- focus: SetKeyboardFocusHere() on with >= 0 offset could be done on same frame (else latch and modulate on beginning of next frame)
- input: rework IO system to be able to pass actual ordered/timestamped events.
+ - input: allow to decide and pass explicit double-clicks (e.g. for windows by the CS_DBLCLKS style).
- input: support track pad style scrolling & slider edit.
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
- misc: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
- style editor: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space? (#438)
- style editor: color child window height expressed in multiple of line height.
+ - remote: make a system like RemoteImGui first-class citizen/project (#75)
- drawlist: user probably can't call Clear() because we expect a texture to be pushed in the stack.
- examples: directx9/directx11: save/restore device state more thoroughly.
- optimization: use another hash function than crc32, e.g. FNV1a
@@ -528,13 +540,13 @@
#include "imgui.h"
#define IMGUI_DEFINE_MATH_OPERATORS
+#define IMGUI_DEFINE_PLACEMENT_NEW
#include "imgui_internal.h"
#include <ctype.h> // toupper, isprint
#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
#include <stdio.h> // vsnprintf, sscanf, printf
-#include <new> // new (ptr)
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
@@ -611,7 +623,7 @@ static void ClosePopupToLevel(int remaining);
static void ClosePopup(ImGuiID id);
static bool IsPopupOpen(ImGuiID id);
static ImGuiWindow* GetFrontMostModalRootWindow();
-static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, ImGuiWindowFlags flags, int* last_dir, const ImRect& r_inner);
+static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, int* last_dir, const ImRect& rect_to_avoid);
static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data);
static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end);
@@ -1535,6 +1547,7 @@ ImGuiWindow::ImGuiWindow(const char* name)
ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f);
ScrollbarX = ScrollbarY = false;
ScrollbarSizes = ImVec2(0.0f, 0.0f);
+ BorderSize = 0.0f;
Active = WasActive = false;
Accessed = false;
Collapsed = false;
@@ -1553,7 +1566,7 @@ ImGuiWindow::ImGuiWindow(const char* name)
FontWindowScale = 1.0f;
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
- new(DrawList) ImDrawList();
+ IM_PLACEMENT_NEW(DrawList) ImDrawList();
DrawList->_OwnerName = Name;
RootWindow = NULL;
RootNonPopupWindow = NULL;
@@ -1827,7 +1840,7 @@ size_t ImGui::GetInternalStateSize()
void ImGui::SetInternalState(void* state, bool construct)
{
if (construct)
- new (state) ImGuiState();
+ IM_PLACEMENT_NEW(state) ImGuiState();
GImGui = (ImGuiState*)state;
}
@@ -1872,7 +1885,7 @@ void ImGui::NewFrame()
{
// Initialize on first frame
g.LogClipboard = (ImGuiTextBuffer*)ImGui::MemAlloc(sizeof(ImGuiTextBuffer));
- new(g.LogClipboard) ImGuiTextBuffer();
+ IM_PLACEMENT_NEW(g.LogClipboard) ImGuiTextBuffer();
IM_ASSERT(g.Settings.empty());
LoadSettings();
@@ -2276,15 +2289,19 @@ static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDr
{
if (!draw_list->CmdBuffer.empty() && !draw_list->VtxBuffer.empty())
{
- if (draw_list->CmdBuffer.back().ElemCount == 0)
+ // Remove trailing command if unused
+ ImDrawCmd& last_cmd = draw_list->CmdBuffer.back();
+ if (last_cmd.ElemCount == 0 && last_cmd.UserCallback == NULL)
draw_list->CmdBuffer.pop_back();
+
out_render_list.push_back(draw_list);
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices)
// If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8);
(void)max_vtx_idx;
- IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx); // Too many vertices in same ImDrawList
+ IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); // Sanity check. Bug or mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
+ IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx); // Too many vertices in same ImDrawList. See comment above.
GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size;
GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size;
@@ -2488,17 +2505,8 @@ static const char* FindTextDisplayEnd(const char* text, const char* text_end)
if (!text_end)
text_end = (const char*)-1;
- ImGuiState& g = *GImGui;
- if (g.DisableHideTextAfterDoubleHash > 0)
- {
- while (text_display_end < text_end && *text_display_end != '\0')
- text_display_end++;
- }
- else
- {
- while (text_display_end < text_end && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#'))
- text_display_end++;
- }
+ while (text_display_end < text_end && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#'))
+ text_display_end++;
return text_display_end;
}
@@ -2736,6 +2744,8 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
ImFont* font = g.Font;
const float font_size = g.FontSize;
+ if (text == text_display_end)
+ return ImVec2(0.0f, font_size);
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
// Cancel out character spacing for the last character of a line (it is baked into glyph->XAdvance field)
@@ -3421,7 +3431,7 @@ static void CheckStacksSize(ImGuiWindow* window, bool write)
IM_ASSERT(p_backup == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup));
}
-static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, ImGuiWindowFlags flags, int* last_dir, const ImRect& r_inner)
+static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, int* last_dir, const ImRect& r_inner)
{
const ImGuiStyle& style = GImGui->Style;
@@ -3431,7 +3441,7 @@ static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size,
r_outer.Reduce(ImVec2((size.x - r_outer.GetWidth() > safe_padding.x*2) ? safe_padding.x : 0.0f, (size.y - r_outer.GetHeight() > safe_padding.y*2) ? safe_padding.y : 0.0f));
ImVec2 base_pos_clamped = ImClamp(base_pos, r_outer.Min, r_outer.Max - size);
- for (int n = (*last_dir != -1) ? -1 : 0; n < 4; n++) // Right, down, up, left. Favor last used direction.
+ for (int n = (*last_dir != -1) ? -1 : 0; n < 4; n++) // Last, Right, down, up, left. (Favor last used direction).
{
const int dir = (n == -1) ? *last_dir : n;
ImRect rect(dir == 0 ? r_inner.Max.x : r_outer.Min.x, dir == 1 ? r_inner.Max.y : r_outer.Min.y, dir == 3 ? r_inner.Min.x : r_outer.Max.x, dir == 2 ? r_inner.Min.y : r_outer.Max.y);
@@ -3441,12 +3451,8 @@ static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size,
return ImVec2(dir == 0 ? r_inner.Max.x : dir == 3 ? r_inner.Min.x - size.x : base_pos_clamped.x, dir == 1 ? r_inner.Max.y : dir == 2 ? r_inner.Min.y - size.y : base_pos_clamped.y);
}
- // Fallback
+ // Fallback, try to keep within display
*last_dir = -1;
- if (flags & ImGuiWindowFlags_Tooltip) // For tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible.
- return base_pos + ImVec2(2,2);
-
- // Otherwise try to keep within display
ImVec2 pos = base_pos;
pos.x = ImMax(ImMin(pos.x + size.x, r_outer.Max.x) - size.x, r_outer.Min.x);
pos.y = ImMax(ImMin(pos.y + size.y, r_outer.Max.y) - size.y, r_outer.Min.y);
@@ -3470,7 +3476,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
// Create window the first time
ImGuiWindow* window = (ImGuiWindow*)ImGui::MemAlloc(sizeof(ImGuiWindow));
- new(window) ImGuiWindow(name);
+ IM_PLACEMENT_NEW(window) ImGuiWindow(name);
window->Flags = flags;
if (flags & ImGuiWindowFlags_NoSavedSettings)
@@ -3810,19 +3816,21 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
rect_to_avoid = ImRect(-FLT_MAX, parent_window->Pos.y + parent_window->TitleBarHeight(), FLT_MAX, parent_window->Pos.y + parent_window->TitleBarHeight() + parent_window->MenuBarHeight());
else
rect_to_avoid = ImRect(parent_window->Pos.x + style.ItemSpacing.x, -FLT_MAX, parent_window->Pos.x + parent_window->Size.x - style.ItemSpacing.x - parent_window->ScrollbarSizes.x, FLT_MAX); // We want some overlap to convey the relative depth of each popup (here hard-coded to 4)
- window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
+ window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, &window->AutoPosLastDirection, rect_to_avoid);
}
else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_appearing_after_being_hidden)
{
ImRect rect_to_avoid(window->PosFloat.x - 1, window->PosFloat.y - 1, window->PosFloat.x + 1, window->PosFloat.y + 1);
- window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
+ window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, &window->AutoPosLastDirection, rect_to_avoid);
}
// Position tooltip (always follows mouse)
if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api)
{
ImRect rect_to_avoid(g.IO.MousePos.x - 16, g.IO.MousePos.y - 8, g.IO.MousePos.x + 24, g.IO.MousePos.y + 24); // FIXME: Completely hard-coded. Perhaps center on cursor hit-point instead?
- window->PosFloat = FindBestPopupWindowPos(g.IO.MousePos, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
+ window->PosFloat = FindBestPopupWindowPos(g.IO.MousePos, window->Size, &window->AutoPosLastDirection, rect_to_avoid);
+ if (window->AutoPosLastDirection == -1)
+ window->PosFloat = g.IO.MousePos + ImVec2(2,2); // If there's not enough room, for tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible.
}
// User moving window (at the beginning of the frame to avoid input lag or sheering). Only valid for root windows.
@@ -3936,9 +3944,10 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
// Scrollbars
- window->ScrollbarY = (window->SizeContents.y > window->Size.y + style.ItemSpacing.y) && !(flags & ImGuiWindowFlags_NoScrollbar);
- window->ScrollbarX = (window->SizeContents.x > window->Size.x - (window->ScrollbarY ? style.ScrollbarSize : 0.0f) - window->WindowPadding.x) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar);
+ window->ScrollbarY = (flags & ImGuiWindowFlags_ForceVerticalScrollbar) || ((window->SizeContents.y > window->Size.y + style.ItemSpacing.y) && !(flags & ImGuiWindowFlags_NoScrollbar));
+ window->ScrollbarX = (flags & ImGuiWindowFlags_ForceHorizontalScrollbar) || ((window->SizeContents.x > window->Size.x - (window->ScrollbarY ? style.ScrollbarSize : 0.0f) - window->WindowPadding.x) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar));
window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f);
+ window->BorderSize = (flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
// Window background
if (bg_alpha > 0.0f)
@@ -3978,11 +3987,10 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// (after the input handling so we don't have a frame of latency)
if (!(flags & ImGuiWindowFlags_NoResize))
{
- const float border_size = (window->Flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
const ImVec2 br = window->Rect().GetBR();
- window->DrawList->PathLineTo(br + ImVec2(-resize_corner_size, -border_size));
- window->DrawList->PathLineTo(br + ImVec2(-border_size, -resize_corner_size));
- window->DrawList->PathArcToFast(ImVec2(br.x - window_rounding - border_size, br.y - window_rounding - border_size), window_rounding, 0, 3);
+ window->DrawList->PathLineTo(br + ImVec2(-resize_corner_size, -window->BorderSize));
+ window->DrawList->PathLineTo(br + ImVec2(-window->BorderSize, -resize_corner_size));
+ window->DrawList->PathArcToFast(ImVec2(br.x - window_rounding - window->BorderSize, br.y - window_rounding - window->BorderSize), window_rounding, 0, 3);
window->DrawList->PathFill(resize_col);
}
@@ -4072,13 +4080,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
const ImRect title_bar_rect = window->TitleBarRect();
- const float border_size = (flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
+ const float border_size = window->BorderSize;
ImRect clip_rect;
clip_rect.Min.x = title_bar_rect.Min.x + 0.5f + ImMax(border_size, window->WindowPadding.x*0.5f);
clip_rect.Min.y = title_bar_rect.Max.y + window->MenuBarHeight() + 0.5f + border_size;
clip_rect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x - ImMax(border_size, window->WindowPadding.x*0.5f);
clip_rect.Max.y = window->Pos.y + window->Size.y - border_size - window->ScrollbarSizes.y;
-
PushClipRect(clip_rect.Min, clip_rect.Max, true);
// Clear 'accessed' flag last thing
@@ -4094,7 +4101,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->Collapsed = parent_window && parent_window->Collapsed;
if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
- window->Collapsed |= (window->ClipRect.Min.x >= window->ClipRect.Max.x || window->ClipRect.Min.y >= window->ClipRect.Max.y);
+ window->Collapsed |= (window->ClippedWindowRect.Min.x >= window->ClippedWindowRect.Max.x || window->ClippedWindowRect.Min.y >= window->ClippedWindowRect.Max.y);
// We also hide the window from rendering because we've already added its border to the command list.
// (we could perform the check earlier in the function but it is simpler at this point)
@@ -4145,7 +4152,7 @@ static void Scrollbar(ImGuiWindow* window, bool horizontal)
bool other_scrollbar = (horizontal ? window->ScrollbarY : window->ScrollbarX);
float other_scrollbar_size_w = other_scrollbar ? style.ScrollbarSize : 0.0f;
const ImRect window_rect = window->Rect();
- const float border_size = (window->Flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
+ const float border_size = window->BorderSize;
ImRect bb = horizontal
? ImRect(window->Pos.x + border_size, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - other_scrollbar_size_w - border_size, window_rect.Max.y - border_size)
: ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + border_size, window_rect.Max.x - border_size, window_rect.Max.y - other_scrollbar_size_w - border_size);
@@ -4278,8 +4285,8 @@ static void PushMultiItemsWidths(int components, float w_full)
const ImGuiStyle& style = GImGui->Style;
if (w_full <= 0.0f)
w_full = ImGui::CalcItemWidth();
- const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)) / (float)components));
- const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)));
+ const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
+ const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
window->DC.ItemWidthStack.push_back(w_item_last);
for (int i = 0; i < components-1; i++)
window->DC.ItemWidthStack.push_back(w_item_one);
@@ -4300,9 +4307,8 @@ float ImGui::CalcItemWidth()
if (w < 0.0f)
{
// Align to a right-side limit. We include 1 frame padding in the calculation because this is how the width is always used (we add 2 frame padding to it), but we could move that responsibility to the widget as well.
- ImGuiState& g = *GImGui;
float width_to_right_edge = ImGui::GetContentRegionAvail().x;
- w = ImMax(1.0f, width_to_right_edge + w - g.Style.FramePadding.x * 2.0f);
+ w = ImMax(1.0f, width_to_right_edge + w);
}
w = (float)(int)w;
return w;
@@ -5163,8 +5169,8 @@ void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + style.FramePadding.x*2, label_size.y + style.FramePadding.y*2));
- const ImRect total_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + style.FramePadding.x*2 + (label_size.x > 0.0f ? style.ItemInnerSpacing.x : 0.0f), style.FramePadding.y*2) + label_size);
+ const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2));
+ const ImRect total_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + (label_size.x > 0.0f ? style.ItemInnerSpacing.x : 0.0f), style.FramePadding.y*2) + label_size);
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, NULL))
return;
@@ -5173,7 +5179,8 @@ void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
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);
RenderTextClipped(value_bb.Min, value_bb.Max, value_text_begin, value_text_end, NULL, ImGuiAlign_VCenter);
- RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y + style.FramePadding.y), label);
+ if (label_size.x > 0.0f)
+ RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y + style.FramePadding.y), label);
}
void ImGui::LabelText(const char* label, const char* fmt, ...)
@@ -5271,7 +5278,7 @@ bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
ImVec2 pos = window->DC.CursorPos;
if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset)
@@ -5361,7 +5368,7 @@ static bool CloseWindowButton(bool* p_opened)
}
if (p_opened != NULL && pressed)
- *p_opened = !*p_opened;
+ *p_opened = false;
return pressed;
}
@@ -5599,8 +5606,9 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
str_id = label;
if (label == NULL)
label = str_id;
+ const bool label_hide_text_after_double_hash = (label == str_id); // Only search and hide text after ## if we have passed label and ID separately, otherwise allow "##" within format string.
const ImGuiID id = window->GetID(str_id);
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
+ const ImVec2 label_size = CalcTextSize(label, NULL, label_hide_text_after_double_hash);
// We vertically grow up to current line height up the typical widget height.
const float text_base_offset_y = ImMax(0.0f, window->DC.CurrentLineTextBaseOffset - padding.y); // Latch before ItemSize changes it
@@ -5663,7 +5671,7 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
RenderCollapseTriangle(bb.Min + ImVec2(padding.x, g.FontSize*0.15f + text_base_offset_y), opened, 0.70f, false);
if (g.LogEnabled)
LogRenderedText(text_pos, ">");
- RenderText(text_pos, label);
+ RenderText(text_pos, label, NULL, label_hide_text_after_double_hash);
}
return opened;
@@ -5963,7 +5971,7 @@ bool ImGui::InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label
char buf[32];
DataTypeFormatString(data_type, data_ptr, decimal_precision, buf, IM_ARRAYSIZE(buf));
- bool value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize() - g.Style.FramePadding*2.0f, ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll);
+ bool value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize(), ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll);
if (g.ScalarAsInputTextId == 0)
{
// First frame
@@ -6164,7 +6172,7 @@ bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, c
const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
// NB- we don't call ItemSize() yet because we may turn into a text edit box below
@@ -6255,7 +6263,6 @@ bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float
char value_buf[64];
char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v);
RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImGuiAlign_Center);
-
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
@@ -6462,7 +6469,7 @@ bool ImGui::DragFloat(const char* label, float* v, float v_speed, float v_min, f
const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
@@ -6667,9 +6674,9 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
if (graph_size.x == 0.0f)
- graph_size.x = CalcItemWidth() + (style.FramePadding.x * 2);
+ graph_size.x = CalcItemWidth();
if (graph_size.y == 0.0f)
graph_size.y = label_size.y + (style.FramePadding.y * 2);
@@ -6758,7 +6765,8 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
if (overlay_text)
RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImGuiAlign_Center);
- RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);
+ if (label_size.x > 0.0f)
+ RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);
}
struct ImGuiPlotArrayGetterData
@@ -6809,15 +6817,16 @@ void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* over
const ImGuiStyle& style = g.Style;
ImVec2 pos = window->DC.CursorPos;
- const ImRect bb(pos, pos + CalcItemSize(size_arg, CalcItemWidth() + style.FramePadding.x*2.0f, g.FontSize + style.FramePadding.y*2.0f));
+ ImRect bb(pos, pos + CalcItemSize(size_arg, CalcItemWidth(), g.FontSize + style.FramePadding.y*2.0f));
ItemSize(bb, style.FramePadding.y);
if (!ItemAdd(bb, NULL))
return;
// Render
fraction = ImSaturate(fraction);
- const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y);
RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
+ bb.Reduce(ImVec2(window->BorderSize, window->BorderSize));
+ const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y);
RenderFrame(bb.Min, fill_br, GetColorU32(ImGuiCol_PlotHistogram), false, style.FrameRounding);
// Default displaying the fraction as percentage string, but user can override it
@@ -6875,7 +6884,8 @@ bool ImGui::Checkbox(const char* label, bool* v)
if (g.LogEnabled)
LogRenderedText(text_bb.GetTL(), *v ? "[x]" : "[ ]");
- RenderText(text_bb.GetTL(), label);
+ if (label_size.x > 0.0f)
+ RenderText(text_bb.GetTL(), label);
return pressed;
}
@@ -6942,7 +6952,8 @@ bool ImGui::RadioButton(const char* label, bool active)
if (g.LogEnabled)
LogRenderedText(text_bb.GetTL(), active ? "(x)" : "( )");
- RenderText(text_bb.GetTL(), label);
+ if (label_size.x > 0.0f)
+ RenderText(text_bb.GetTL(), label);
return pressed;
}
@@ -7218,9 +7229,9 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
const bool is_editable = (flags & ImGuiInputTextFlags_ReadOnly) == 0;
const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
- ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), is_multiline ? ImGui::GetTextLineHeight() * 8.0f : label_size.y); // Arbitrary default of 8 lines high for multi-line
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size + style.FramePadding*2.0f);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
+ ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), (is_multiline ? ImGui::GetTextLineHeight() * 8.0f : label_size.y) + style.FramePadding.y*2.0f); // Arbitrary default of 8 lines high for multi-line
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? (style.ItemInnerSpacing.x + label_size.x) : 0.0f, 0.0f));
ImGuiWindow* draw_window = window;
@@ -7580,7 +7591,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
// Render
- const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + size.x + style.FramePadding.x*2.0f, frame_bb.Min.y + size.y + style.FramePadding.y*2.0f);
+ const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + size.x, frame_bb.Min.y + size.y); // Not using frame_bb.Max because we have adjusted size
ImVec2 render_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding;
ImVec2 text_size(0.f, 0.f);
if (g.ActiveId == id || (edit_state.Id == id && is_multiline && g.ActiveId == draw_window->GetID("#SCROLLY")))
@@ -7771,15 +7782,13 @@ bool ImGui::InputScalarEx(const char* label, ImGuiDataType data_type, void* data
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const float w = CalcItemWidth();
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
ImGui::BeginGroup();
ImGui::PushID(label);
- const ImVec2 button_sz = ImVec2(g.FontSize, g.FontSize) + style.FramePadding * 2;
+ const ImVec2 button_sz = ImVec2(g.FontSize, g.FontSize) + style.FramePadding*2.0f;
if (step_ptr)
- ImGui::PushItemWidth(ImMax(1.0f, w - (button_sz.x + style.ItemInnerSpacing.x)*2));
+ ImGui::PushItemWidth(ImMax(1.0f, CalcItemWidth() - (button_sz.x + style.ItemInnerSpacing.x)*2));
char buf[64];
DataTypeFormatString(data_type, data_ptr, scalar_format, buf, IM_ARRAYSIZE(buf));
@@ -7989,7 +7998,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, &id))
@@ -8091,7 +8100,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
PopClipRect();
ImGuiID id = window->GetID(label);
- ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ ImVec2 label_size = CalcTextSize(label, NULL, true);
ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y);
ImVec2 pos = window->DC.CursorPos;
pos.y += window->DC.CurrentLineTextBaseOffset;
@@ -8175,10 +8184,10 @@ bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg)
const ImGuiStyle& style = ImGui::GetStyle();
const ImGuiID id = ImGui::GetID(label);
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
// Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
- ImVec2 size = CalcItemSize(size_arg, CalcItemWidth() + style.FramePadding.x * 2.0f, ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y);
+ ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y);
ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
@@ -8333,8 +8342,7 @@ bool ImGui::BeginMenuBar()
ImGui::BeginGroup(); // Save position
ImGui::PushID("##menubar");
ImRect rect = window->MenuBarRect();
- float border_size = (window->Flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
- PushClipRect(ImVec2(rect.Min.x+0.5f, rect.Min.y-0.5f+border_size), ImVec2(rect.Max.x+0.5f, rect.Max.y-0.5f), false);
+ PushClipRect(ImVec2(rect.Min.x+0.5f, rect.Min.y-0.5f+window->BorderSize), ImVec2(rect.Max.x+0.5f, rect.Max.y-0.5f), false);
window->DC.CursorPos = ImVec2(rect.Min.x + window->DC.MenuBarOffsetX, rect.Min.y);// + g.Style.FramePadding.y);
window->DC.LayoutType = ImGuiLayoutType_Horizontal;
window->DC.MenuBarAppending = true;
@@ -8527,7 +8535,6 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
edit_mode = g.ColorEditModeStorage.GetInt(id, 0) % 3;
float f[4] = { col[0], col[1], col[2], col[3] };
-
if (edit_mode == ImGuiColorEditMode_HSV)
ImGui::ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]);
@@ -8547,8 +8554,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
{
// RGB/HSV 0..255 Sliders
const float w_items_all = w_full - (square_sz + style.ItemInnerSpacing.x);
- const float w_item_one = ImMax(1.0f, (float)(int)((w_items_all - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)) / (float)components));
- const float w_item_last = ImMax(1.0f, (float)(int)(w_items_all - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)));
+ const float w_item_one = ImMax(1.0f, (float)(int)((w_items_all - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
+ const float w_item_last = ImMax(1.0f, (float)(int)(w_items_all - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
const bool hide_prefix = (w_item_one <= CalcTextSize("M:999").x);
const char* ids[4] = { "##X", "##Y", "##Z", "##W" };
@@ -8583,18 +8590,19 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
else
ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", i[0], i[1], i[2]);
ImGui::PushItemWidth(w_slider_all - style.ItemInnerSpacing.x);
- value_changed |= ImGui::InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
+ if (ImGui::InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
+ {
+ value_changed |= true;
+ char* p = buf;
+ while (*p == '#' || ImCharIsSpace(*p))
+ p++;
+ i[0] = i[1] = i[2] = i[3] = 0;
+ if (alpha)
+ sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]); // Treat at unsigned (%X is unsigned)
+ else
+ sscanf(p, "%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2]);
+ }
ImGui::PopItemWidth();
- char* p = buf;
- while (*p == '#' || ImCharIsSpace(*p))
- p++;
-
- // Treat at unsigned (%X is unsigned)
- i[0] = i[1] = i[2] = i[3] = 0;
- if (alpha)
- sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]);
- else
- sscanf(p, "%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2]);
}
break;
}
@@ -8615,15 +8623,15 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
const char* button_titles[3] = { "RGB", "HSV", "HEX" };
if (ButtonEx(button_titles[edit_mode], ImVec2(0,0), ImGuiButtonFlags_DontClosePopups))
g.ColorEditModeStorage.SetInt(id, (edit_mode + 1) % 3); // Don't set local copy of 'edit_mode' right away!
- ImGui::SameLine();
}
- else
+
+ const char* label_display_end = FindTextDisplayEnd(label);
+ if (label != label_display_end)
{
- ImGui::SameLine(0, style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, (window->DC.ColorEditMode == ImGuiColorEditMode_UserSelectShowButton) ? -1.0f : style.ItemInnerSpacing.x);
+ ImGui::TextUnformatted(label, label_display_end);
}
- ImGui::TextUnformatted(label, FindTextDisplayEnd(label));
-
// Convert back
for (int n = 0; n < 4; n++)
f[n] = i[n] / 255.0f;
@@ -9283,7 +9291,6 @@ void ImGui::ShowMetricsWindow(bool* opened)
};
ImGuiState& g = *GImGui; // Access private state
- g.DisableHideTextAfterDoubleHash++; // Not exposed (yet). Disable processing that hides text after '##' markers.
Funcs::NodeWindows(g.Windows, "Windows");
if (ImGui::TreeNode("DrawList", "Active DrawLists (%d)", g.RenderDrawLists[0].Size))
{
@@ -9309,7 +9316,6 @@ void ImGui::ShowMetricsWindow(bool* opened)
ImGui::Text("ActiveID: 0x%08X/0x%08X", g.ActiveId, g.ActiveIdPreviousFrame);
ImGui::TreePop();
}
- g.DisableHideTextAfterDoubleHash--;
}
ImGui::End();
}
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
index b7b0a0113a6..9e4a6c892ad 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
@@ -18,17 +18,18 @@
#define IMGUI_VERSION "1.48 WIP"
+// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
+#ifndef IMGUI_API
+#define IMGUI_API
+#endif
+
// Define assertion handler.
#ifndef IM_ASSERT
#include <assert.h>
#define IM_ASSERT(_EXPR, ...) assert(_EXPR)
#endif
-// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
-#ifndef IMGUI_API
-#define IMGUI_API
-#endif
-
+// Some compilers support applying printf-style warnings to user functions.
#if defined(__clang__) || defined(__GNUC__)
#define IM_PRINTFARGS(FMT) __attribute__((format(printf, FMT, (FMT+1))))
#else
@@ -36,39 +37,50 @@
#endif
// Forward declarations
-struct ImDrawCmd;
-struct ImDrawList;
-struct ImDrawData;
-struct ImFont;
-struct ImFontAtlas;
-struct ImColor;
-struct ImGuiIO;
-struct ImGuiStorage;
-struct ImGuiStyle;
-
+struct ImDrawChannel; // Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit()
+struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call)
+struct ImDrawData; // All draw command lists required to render the frame
+struct ImDrawList; // A single draw command list (generally one per window)
+struct ImDrawVert; // A single vertex (20 bytes by default, override layout with IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT)
+struct ImFont; // Runtime data for a single font within a parent ImFontAtlas
+struct ImFontAtlas; // Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF font loader
+struct ImFontConfig; // Configuration data when adding a font or merging fonts
+struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4
+struct ImGuiIO; // Main configuration and I/O between your application and ImGui
+struct ImGuiOnceUponAFrame; // Simple helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro
+struct ImGuiStorage; // Simple custom key value storage
+struct ImGuiStyle; // Runtime data for styling/colors
+struct ImGuiTextFilter; // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
+struct ImGuiTextBuffer; // Text buffer for logging/accumulating text
+struct ImGuiTextEditCallbackData; // Shared state of ImGui::InputText() when using custom callbacks (advanced)
+struct ImGuiListClipper; // Helper to manually clip large list of items
+
+// Enumerations (declared as int for compatibility and to not pollute the top of this file)
typedef unsigned int ImU32;
typedef unsigned short ImWchar; // character for keyboard input/display
typedef void* ImTextureID; // user data to refer to a texture (e.g. store your texture handle/id)
typedef ImU32 ImGuiID; // unique ID used by widgets (typically hashed from a stack of string)
-typedef int ImGuiCol; // enum ImGuiCol_
-typedef int ImGuiStyleVar; // enum ImGuiStyleVar_
-typedef int ImGuiKey; // enum ImGuiKey_
-typedef int ImGuiAlign; // enum ImGuiAlign_
-typedef int ImGuiColorEditMode; // enum ImGuiColorEditMode_
-typedef int ImGuiMouseCursor; // enum ImGuiMouseCursor_
-typedef int ImGuiWindowFlags; // enum ImGuiWindowFlags_
-typedef int ImGuiSetCond; // enum ImGuiSetCond_
-typedef int ImGuiInputTextFlags; // enum ImGuiInputTextFlags_
-typedef int ImGuiSelectableFlags; // enum ImGuiSelectableFlags_
-struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
+typedef int ImGuiCol; // a color identifier for styling // enum ImGuiCol_
+typedef int ImGuiStyleVar; // a variable identifier for styling // enum ImGuiStyleVar_
+typedef int ImGuiKey; // a key identifier (ImGui-side enum) // enum ImGuiKey_
+typedef int ImGuiAlign; // alignment // enum ImGuiAlign_
+typedef int ImGuiColorEditMode; // color edit mode for ColorEdit*() // enum ImGuiColorEditMode_
+typedef int ImGuiMouseCursor; // a mouse cursor identifier // enum ImGuiMouseCursor_
+typedef int ImGuiWindowFlags; // window flags for Begin*() // enum ImGuiWindowFlags_
+typedef int ImGuiSetCond; // condition flags for Set*() // enum ImGuiSetCond_
+typedef int ImGuiInputTextFlags; // flags for InputText*() // enum ImGuiInputTextFlags_
+typedef int ImGuiSelectableFlags; // flags for Selectable() // enum ImGuiSelectableFlags_
typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
+// Others helpers at bottom of the file:
+// class ImVector<> // Lightweight std::vector like class.
+// IMGUI_ONCE_UPON_A_FRAME // Execute a block of code once per frame only (convenient for creating UI within deep-nested code that runs multiple times)
+
struct ImVec2
{
float x, y;
ImVec2() { x = y = 0.0f; }
ImVec2(float _x, float _y) { x = _x; y = _y; }
-
#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
IM_VEC2_CLASS_EXTRA
#endif
@@ -79,25 +91,11 @@ 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; }
-
#ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4.
IM_VEC4_CLASS_EXTRA
#endif
};
-// Helpers at bottom of the file:
-// - class ImVector<> // Lightweight std::vector like class.
-// - IMGUI_ONCE_UPON_A_FRAME // Execute a block of code once per frame only (convenient for creating UI within deep-nested code that runs multiple times)
-// - struct ImGuiTextFilter // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
-// - struct ImGuiTextBuffer // Text buffer for logging/accumulating text
-// - struct ImGuiStorage // Custom key value storage (if you need to alter open/close states manually)
-// - struct ImGuiTextEditCallbackData // Shared state of ImGui::InputText() when using custom callbacks
-// - struct ImGuiListClipper // Helper to manually clip large list of items.
-// - struct ImColor // Helper functions to created packed 32-bit RGBA color values
-// - struct ImDrawList // Draw command list
-// - struct ImFontAtlas // Bake multiple fonts into a single texture, TTF font loader, bake glyphs into bitmap
-// - struct ImFont // Single font
-
// ImGui end-user API
// In a namespace so that user can add extra functions in a separate file (e.g. Value() helpers for your vector or common types)
namespace ImGui
@@ -376,6 +374,7 @@ namespace ImGui
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item in screen space
IMGUI_API ImVec2 GetItemRectMax(); // "
IMGUI_API ImVec2 GetItemRectSize(); // "
+ IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
IMGUI_API bool IsWindowHovered(); // is current window hovered and hoverable (not blocked by a popup) (differentiate child windows from each others)
IMGUI_API bool IsWindowFocused(); // is current window focused
IMGUI_API bool IsRootWindowFocused(); // is current root window focused (top parent window in case of child windows)
@@ -453,17 +452,19 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar
ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip
ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window
- ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbar (window can still scroll with mouse or programatically)
- ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user scrolling with mouse wheel
+ ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbars (window can still scroll with mouse or programatically)
+ ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user vertically scrolling with mouse wheel
ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it
ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame
ImGuiWindowFlags_ShowBorders = 1 << 7, // Show borders around windows and items
ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file
ImGuiWindowFlags_NoInputs = 1 << 9, // Disable catching mouse or keyboard inputs
ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar
- ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Enable horizontal scrollbar (off by default). You need to use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
+ ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Allow horizontal scrollbar to appear (off by default). You need to use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state
ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus)
+ ImGuiWindowFlags_ForceVerticalScrollbar = 1 << 14, // Always show vertical scrollbar (even if ContentSize.y < Size.y)
+ ImGuiWindowFlags_ForceHorizontalScrollbar=1 << 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
// [Internal]
ImGuiWindowFlags_ChildWindow = 1 << 20, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21, // Don't use! For internal use by BeginChild()
@@ -837,7 +838,7 @@ public:
inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
};
-// Helper: execute a block of code once a frame only
+// 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.
// Usage:
// IMGUI_ONCE_UPON_A_FRAME
@@ -919,30 +920,30 @@ struct ImGuiStorage
Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
};
- ImVector<Pair> Data;
+ ImVector<Pair> Data;
// - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N)
// - Set***() functions find pair, insertion on demand if missing.
// - Sorted insertion is costly but should amortize. A typical frame shouldn't need to insert any new pair.
- IMGUI_API void Clear();
- IMGUI_API int GetInt(ImGuiID key, int default_val = 0) const;
- IMGUI_API void SetInt(ImGuiID key, int val);
- IMGUI_API float GetFloat(ImGuiID key, float default_val = 0.0f) const;
- IMGUI_API void SetFloat(ImGuiID key, float val);
- IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL
- IMGUI_API void SetVoidPtr(ImGuiID key, void* val);
+ IMGUI_API void Clear();
+ IMGUI_API int GetInt(ImGuiID key, int default_val = 0) const;
+ IMGUI_API void SetInt(ImGuiID key, int val);
+ IMGUI_API float GetFloat(ImGuiID key, float default_val = 0.0f) const;
+ IMGUI_API void SetFloat(ImGuiID key, float val);
+ IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL
+ IMGUI_API void SetVoidPtr(ImGuiID key, void* val);
// - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
// - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
// - A typical use case where this is convenient:
// float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar;
// - You can also use this to quickly create temporary editable values during a session of using Edit&Continue, without restarting your application.
- IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0);
- IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0);
- IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL);
+ IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0);
+ IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0);
+ IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL);
// Use on your own storage if you know only integer are being stored (open/close all tree nodes)
- IMGUI_API void SetAllInt(int val);
+ IMGUI_API void SetAllInt(int val);
};
// Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used.
@@ -1028,15 +1029,20 @@ struct ImGuiListClipper
// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.
//-----------------------------------------------------------------------------
+// Helpers macros to generate 32-bits encoded colors
+#define IM_COL32(R,G,B,A) (((ImU32)(A)<<24) | ((ImU32)(B)<<16) | ((ImU32)(G)<<8) | ((ImU32)(R)))
+#define IM_COL32_WHITE (0xFFFFFFFF)
+#define IM_COL32_BLACK (0xFF000000)
+#define IM_COL32_BLACK_TRANS (0x00000000) // Transparent black
+
// Draw callbacks for advanced uses.
// NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
-// Draw callback are useful for example if you want to render a complex 3D scene inside a UI element.
+// Draw callback may be useful for example, if you want to render a complex 3D scene inside a UI element, change your GPU render state, etc.
// The expected behavior from your rendering loop is:
// if (cmd.UserCallback != NULL)
// cmd.UserCallback(parent_list, cmd);
// else
// RenderTriangles()
-// It is up to you to decide if your rendering loop or the callback should be responsible for backup/restoring rendering state.
typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd);
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
@@ -1066,9 +1072,9 @@ struct ImDrawVert
ImU32 col;
};
#else
-// You can change the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h
+// 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 by the #define (you can either declare the struct or use a typedef)
+// The type has to be described within the macro (you can either declare the struct or use a typedef)
IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
#endif
@@ -1086,7 +1092,6 @@ struct ImDrawChannel
// If you want to add custom rendering within a window, you can use ImGui::GetWindowDrawList() to access the current draw list and add your own primitives.
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
// All positions are in screen coordinates (0,0=top-left, 1 pixel per unit). Primitives are always added to the list and not culled (culling is done at render time and at a higher-level by ImGui:: functions).
-// Note that this only gives you access to rendering polygons. If your intent is to create custom widgets and the publicly exposed functions/data aren't sufficient, you can add code in imgui_user.inl
struct ImDrawList
{
// This is what you have to render
@@ -1108,7 +1113,7 @@ struct ImDrawList
ImDrawList() { _OwnerName = NULL; Clear(); }
~ImDrawList() { ClearFreeMemory(); }
- IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2. Only apply to rendering. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
+ IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. Note that the values are (x1,y1,x2,y2) and NOT (x1,y1,w,h). This is passed down to your render function but not used for CPU-side 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(const ImTextureID& texture_id);
@@ -1156,8 +1161,9 @@ struct ImDrawList
IMGUI_API void Clear();
IMGUI_API void ClearFreeMemory();
IMGUI_API void PrimReserve(int idx_count, int vtx_count);
- IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col);
+ IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles)
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
+ IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); }
inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
index 5f734abb1e7..8fd48b0b01b 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
@@ -223,8 +223,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
if (ImGui::TreeNode("Fonts", "Fonts (%d)", ImGui::GetIO().Fonts->Fonts.Size))
{
- ImGui::SameLine();
- ShowHelpMarker("Tip: Load fonts with io.Fonts->AddFontFromFileTTF()\nbefore calling io.Fonts->GetTex* functions.");
+ ImGui::SameLine(); ShowHelpMarker("Tip: Load fonts with io.Fonts->AddFontFromFileTTF()\nbefore calling io.Fonts->GetTex* functions.");
ImFontAtlas* atlas = ImGui::GetIO().Fonts;
if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
{
@@ -442,9 +441,9 @@ void ImGui::ShowTestWindow(bool* p_opened)
ImGui::Text("Password input");
static char bufpass[64] = "password123";
- ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password);
+ ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank);
ImGui::SameLine(); ShowHelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
- ImGui::InputText("password (clear)", bufpass, 64);
+ ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank);
ImGui::TreePop();
}
@@ -812,26 +811,36 @@ void ImGui::ShowTestWindow(bool* p_opened)
if (ImGui::TreeNode("Widgets Width"))
{
static float f = 0.0f;
- ImGui::Text("PushItemWidth(100)");
+ ImGui::Text("PushItemWidth(100)");
+ ImGui::SameLine(); ShowHelpMarker("Fixed width.");
ImGui::PushItemWidth(100);
ImGui::DragFloat("float##1", &f);
ImGui::PopItemWidth();
- ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f);");
+ ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f)");
+ ImGui::SameLine(); ShowHelpMarker("Half of window width.");
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
ImGui::DragFloat("float##2", &f);
ImGui::PopItemWidth();
- ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f);");
+ ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f)");
+ ImGui::SameLine(); ShowHelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)");
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f);
ImGui::DragFloat("float##3", &f);
ImGui::PopItemWidth();
- ImGui::Text("PushItemWidth(-100);");
+ ImGui::Text("PushItemWidth(-100)");
+ ImGui::SameLine(); ShowHelpMarker("Align to right edge minus 100");
ImGui::PushItemWidth(-100);
ImGui::DragFloat("float##4", &f);
ImGui::PopItemWidth();
+ ImGui::Text("PushItemWidth(-1)");
+ ImGui::SameLine(); ShowHelpMarker("Align to right edge");
+ ImGui::PushItemWidth(-1);
+ ImGui::DragFloat("float##5", &f);
+ ImGui::PopItemWidth();
+
ImGui::TreePop();
}
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp
index b5d25eaa0be..256bbfdd751 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp
@@ -14,10 +14,10 @@
#include "imgui.h"
#define IMGUI_DEFINE_MATH_OPERATORS
+#define IMGUI_DEFINE_PLACEMENT_NEW
#include "imgui_internal.h"
#include <stdio.h> // vsnprintf, sscanf, printf
-#include <new> // new (ptr)
#if !defined(alloca) && !defined(__FreeBSD__)
#ifdef _WIN32
#include <malloc.h> // alloca
@@ -37,7 +37,7 @@
#pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
#pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it.
#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness //
-#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
+//#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
@@ -267,7 +267,7 @@ void ImDrawList::ChannelsSplit(int channels_count)
{
if (i >= old_channels_count)
{
- new(&_Channels[i]) ImDrawChannel();
+ IM_PLACEMENT_NEW(&_Channels[i]) ImDrawChannel();
}
else
{
@@ -346,13 +346,13 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count)
_IdxWritePtr = IdxBuffer.Data + idx_buffer_size;
}
+// Fully unrolled with inline call to keep our debug builds decently fast.
void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col)
{
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- const ImVec2 b(c.x, a.y);
- const ImVec2 d(a.x, c.y);
- _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2);
- _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3);
+ ImVec2 b(c.x, a.y), d(a.x, c.y), uv(GImGui->FontTexUvWhitePixel);
+ ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx;
+ _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2);
+ _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3);
_VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
_VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col;
_VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col;
@@ -364,12 +364,24 @@ void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col)
void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col)
{
- const ImVec2 b(c.x, a.y);
- const ImVec2 d(a.x, c.y);
- const ImVec2 uv_b(uv_c.x, uv_a.y);
- const ImVec2 uv_d(uv_a.x, uv_c.y);
- _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2);
- _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3);
+ ImVec2 b(c.x, a.y), d(a.x, c.y), uv_b(uv_c.x, uv_a.y), uv_d(uv_a.x, uv_c.y);
+ ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx;
+ _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2);
+ _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3);
+ _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col;
+ _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col;
+ _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col;
+ _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col;
+ _VtxWritePtr += 4;
+ _VtxCurrentIdx += 4;
+ _IdxWritePtr += 6;
+}
+
+void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col)
+{
+ ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx;
+ _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2);
+ _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3);
_VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col;
_VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col;
_VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col;
@@ -893,7 +905,7 @@ void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos,
CmdBuffer.back().ElemCount -= idx_unused;
_VtxWritePtr -= vtx_unused;
_IdxWritePtr -= idx_unused;
- _VtxCurrentIdx = (ImDrawIdx)VtxBuffer.Size;
+ _VtxCurrentIdx = (unsigned int)VtxBuffer.Size;
}
// This is one of the few function breaking the encapsulation of ImDrawLst, but it is just so useful.
@@ -1087,7 +1099,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
if (!font_cfg->MergeMode)
{
ImFont* font = (ImFont*)ImGui::MemAlloc(sizeof(ImFont));
- new (font) ImFont();
+ IM_PLACEMENT_NEW(font) ImFont();
Fonts.push_back(font);
}
@@ -1235,8 +1247,9 @@ bool ImFontAtlas::Build()
}
}
- // Start packing
- TexWidth = (TexDesiredWidth > 0) ? TexDesiredWidth : (total_glyph_count > 2000) ? 2048 : (total_glyph_count > 1000) ? 1024 : 512; // Width doesn't actually matters much but some API/GPU have texture size limitations, and increasing width can decrease height.
+ // Start packing. We need a known width for the skyline algorithm. Using a cheap heuristic here to decide of width. User can override TexDesiredWidth if they wish.
+ // After packing is done, width shouldn't matter much, but some API/GPU have texture size limitations and increasing width can decrease height.
+ TexWidth = (TexDesiredWidth > 0) ? TexDesiredWidth : (total_glyph_count > 4000) ? 4096 : (total_glyph_count > 2000) ? 2048 : (total_glyph_count > 1000) ? 1024 : 512;
TexHeight = 0;
const int max_tex_height = 1024*32;
stbtt_pack_context spc;
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
index 3c028c38cb8..54c777e0dfa 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
@@ -137,6 +137,15 @@ static inline float ImLengthSqr(const ImVec4& lhs)
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 1.0f / sqrtf(d); return fail_value; }
static inline ImVec2 ImRound(ImVec2 v) { return ImVec2((float)(int)v.x, (float)(int)v.y); }
+// We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax.
+// Defining a custom placement new() with a dummy parameter allows us to bypass including <new> which on some platforms complains when user has disabled exceptions.
+#ifdef IMGUI_DEFINE_PLACEMENT_NEW
+struct ImPlacementNewDummy {};
+inline void* operator new(size_t, ImPlacementNewDummy, void* ptr) { return ptr; }
+inline void operator delete(void*, ImPlacementNewDummy, void*) {}
+#define IM_PLACEMENT_NEW(_PTR) new(ImPlacementNewDummy() ,_PTR)
+#endif
+
//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------
@@ -371,7 +380,6 @@ struct ImGuiState
ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window. Pointer is only valid if ActiveID is the "#MOVE" identifier of a window.
ImVector<ImGuiIniData> Settings; // .ini Settings
float SettingsDirtyTimer; // Save .ini settinngs on disk when time reaches zero
- int DisableHideTextAfterDoubleHash;
ImVector<ImGuiColMod> ColorModifiers; // Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiStyleMod> StyleModifiers; // Stack for PushStyleVar()/PopStyleVar()
ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont()
@@ -455,7 +463,6 @@ struct ImGuiState
ActiveIdWindow = NULL;
MovedWindow = NULL;
SettingsDirtyTimer = 0.0f;
- DisableHideTextAfterDoubleHash = 0;
SetNextWindowPosVal = ImVec2(0.0f, 0.0f);
SetNextWindowSizeVal = ImVec2(0.0f, 0.0f);
@@ -600,7 +607,8 @@ struct IMGUI_API ImGuiWindow
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
bool ScrollbarX, ScrollbarY;
- ImVec2 ScrollbarSizes; //
+ ImVec2 ScrollbarSizes;
+ float BorderSize;
bool Active; // Set to true on Begin()
bool WasActive;
bool Accessed; // Set to true when any widget access the current window
@@ -684,7 +692,6 @@ namespace ImGui
IMGUI_API void FocusableItemUnregister(ImGuiWindow* window);
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y);
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
- IMGUI_API void SetItemAllowOverlap(); // Allow last item to be overlapped by a subsequent item
IMGUI_API void OpenPopupEx(const char* str_id, bool reopen_existing);
diff --git a/3rdparty/bgfx/3rdparty/pvrtc/BitScale.h b/3rdparty/bgfx/3rdparty/pvrtc/BitScale.h
index a9e5cec32e6..b600fe9350e 100644
--- a/3rdparty/bgfx/3rdparty/pvrtc/BitScale.h
+++ b/3rdparty/bgfx/3rdparty/pvrtc/BitScale.h
@@ -2,7 +2,7 @@
#pragma once
-#include <cstdint>
+#include <stdint.h>
//============================================================================
diff --git a/3rdparty/bgfx/3rdparty/remotery/lib/Remotery.c b/3rdparty/bgfx/3rdparty/remotery/lib/Remotery.c
index d8af75bb010..6b3a35695f2 100644
--- a/3rdparty/bgfx/3rdparty/remotery/lib/Remotery.c
+++ b/3rdparty/bgfx/3rdparty/remotery/lib/Remotery.c
@@ -5506,7 +5506,8 @@ static void* rmtglGetProcAddress(OpenGL* opengl, const char* symbol)
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
- return NSGLGetProcAddress((const GLubyte*)symbol);
+ extern void* nsglGetProcAddress(const GLubyte* _name);
+ return nsglGetProcAddress((const GLubyte*)symbol);
#elif defined(RMT_PLATFORM_LINUX)
diff --git a/3rdparty/bgfx/3rdparty/stb/stb_image.c b/3rdparty/bgfx/3rdparty/stb/stb_image.c
index bc305501477..130d6c01d61 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_image.c
+++ b/3rdparty/bgfx/3rdparty/stb/stb_image.c
@@ -1,5 +1,6 @@
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wshadow"
+# pragma GCC diagnostic ignored "-Warray-bounds"
#elif defined(_MSC_VER)
# pragma warning(disable:4312) // warning C4312: 'type cast': conversion from '' to '' of greater size
# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration
diff --git a/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h b/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
index d6ed38b7254..90cd29584cc 100644
--- a/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
+++ b/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
@@ -1306,8 +1306,17 @@ typedef struct {
m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2];
} tinfl_huff_table;
-#if MINIZ_HAS_64BIT_REGISTERS
-#define TINFL_USE_64BIT_BITBUF 1
+
+#ifndef MINIZ_HAS_64BIT_REGISTERS
+# define MINIZ_HAS_64BIT_REGISTERS 0
+#endif
+
+#ifndef TINFL_USE_64BIT_BITBUF
+# if MINIZ_HAS_64BIT_REGISTERS
+# define TINFL_USE_64BIT_BITBUF 1
+# else
+# define TINFL_USE_64BIT_BITBUF 0
+# endif
#endif
#if TINFL_USE_64BIT_BITBUF
@@ -4318,7 +4327,7 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
#include <stdio.h>
#include <sys/stat.h>
-#if defined(_MSC_VER) || defined(__MINGW64__)
+#if defined(_MSC_VER) //|| defined(__MINGW64__)
static FILE *mz_fopen(const char *pFilename, const char *pMode) {
FILE *pFile = NULL;
fopen_s(&pFile, pFilename, pMode);
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 0548f2d68ca..19c0a07167a 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -1,6 +1,9 @@
[bgfx](https://github.com/bkaradzic/bgfx) - Cross-platform rendering library
============================================================================
+[![Build Status](https://travis-ci.org/bkaradzic/bgfx.svg?branch=master)](https://travis-ci.org/bkaradzic/bgfx)
+[![Build status](https://ci.appveyor.com/api/projects/status/ipa3ojgeaet1oko5?svg=true)](https://ci.appveyor.com/project/bkaradzic/bgfx)
+
[What is it?](https://bkaradzic.github.io/bgfx/overview.html)
-------------------------------------------------------------
@@ -29,12 +32,12 @@ Supported platforms:
* asm.js/Emscripten (1.25.0)
* FreeBSD
* iOS (iPhone, iPad, AppleTV)
- * Linux ![](https://tc27.draster.com/app/rest/builds/buildType:(id:Bgfx_Linux)/statusIcon)
+ * Linux
* MIPS Creator CI20
* Native Client (PPAPI 37+, ARM, x86, x64, PNaCl)
* OSX (10.9+)
* RaspberryPi
- * Windows (XP, Vista, 7, 8, 10) ![](https://tc27.draster.com/app/rest/builds/buildType:(id:Bgfx_Windows)/statusIcon)
+ * Windows (XP, Vista, 7, 8, 10)
* WinRT (WinPhone 8.0+)
Supported compilers:
@@ -51,11 +54,13 @@ Languages:
* [Go language API bindings](https://github.com/james4k/go-bgfx)
* [Java language API bindings](https://github.com/enleeten/twilight-bgfx)
* [Haskell language API bindings](https://github.com/haskell-game/bgfx)
+ * [Rust language API bindings](https://github.com/rhoot/bgfx-rs)
-Build status
-------------
+Build
+-----
-https://tc27.draster.com/guestAuth/overview.html
+ - AppVeyor https://ci.appveyor.com/project/bkaradzic/bgfx
+ - TravisCI https://travis-ci.org/bkaradzic/bgfx
Who is using it?
----------------
@@ -107,6 +112,9 @@ https://github.com/jpcy/ioq3-renderer-bgfx - A renderer for ioquake3 written in
C++ and using bgfx to support multiple rendering APIs.
![ioq3-renderer-bgfx screenshot](https://camo.githubusercontent.com/052aa40c05120e56306294d3a1bb5f99f97de8c8/687474703a2f2f692e696d6775722e636f6d2f64364f6856594b2e6a7067)
+http://makingartstudios.itch.io/dls - DLS the digital logic simulator game.
+![dls-screenshot](https://img.itch.io/aW1hZ2UvMzk3MTgvMTc5MjQ4LnBuZw==/original/kA%2FQPb.png)
+
[Building](https://bkaradzic.github.io/bgfx/build.html)
-------------------------------------------------------
diff --git a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
index f26ec2830b7..694e76a6b0d 100644
--- a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
+++ b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
@@ -26,35 +26,36 @@ static const uint8_t fs_metaballs_glsl[398] =
0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // gl_FragColor =
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_2;.}...
};
-static const uint8_t fs_metaballs_dx9[429] =
+static const uint8_t fs_metaballs_dx9[433] =
{
- 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..,.?........
- 0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
+ 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..,.?........
+ 0xfe, 0xff, 0x17, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0xf0, 0x41, 0xcd, 0xcc, 0x0c, 0x40, 0x2f, 0xba, 0xe8, 0x3e, // .......A...@/..>
- 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0x90, // ...?............
- 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x01, 0x00, 0x07, 0x90, 0x08, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0xe4, 0x90, 0x07, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xaa, 0x90, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, // ........ .......
- 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x90, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x90, // ..............U.
- 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x90, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x0e, 0x00, 0x00, 0x02, // ..........U.....
- 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, // ......U.........
- 0x00, 0x00, 0xaa, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x00, 0x00, 0xff, 0x80, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x00, 0x00, 0x81, // ................
- 0x01, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, // ..........U.....
- 0x01, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, // ................
- 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U.
- 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
+ 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, // ader Compiler 10
+ 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, // .0.10011.16384..
+ 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0xf0, 0x41, 0xcd, 0xcc, 0x0c, 0x40, // Q..........A...@
+ 0x2f, 0xba, 0xe8, 0x3e, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // /..>...?........
+ 0x00, 0x00, 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x01, 0x00, 0x07, 0x90, // ................
+ 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0xe4, 0x90, // ................
+ 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, // ................
+ 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xaa, 0x90, 0x20, 0x00, 0x00, 0x03, // ............ ...
+ 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0xa0, 0x0f, 0x00, 0x00, 0x02, // ................
+ 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x90, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, // ................
+ 0x00, 0x00, 0x55, 0x90, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x90, // ..U.............
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x80, 0x00, 0x00, 0x55, 0xa0, // ..............U.
+ 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, // ..........U.....
+ 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, // ................
+ 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, // ................
+ 0x00, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, // ................
+ 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U.
+ 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, // ................
+ 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x08, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x02, 0x80, // ................
+ 0x00, 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, // ..U.............
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0x00, 0x00, // ................
+ 0x00, // .
};
static const uint8_t fs_metaballs_dx11[660] =
{
diff --git a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
index 70f3e56b654..1e35cc2394e 100644
--- a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
+++ b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
@@ -35,12 +35,12 @@ static const uint8_t vs_metaballs_glsl[537] =
0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // v_color0 = a_col
0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0;.}...
};
-static const uint8_t vs_metaballs_dx9[457] =
+static const uint8_t vs_metaballs_dx9[461] =
{
0x56, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x03, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
- 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x98, 0x01, // ViewProj........
- 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2e, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, // ........CTAB....
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x9c, 0x01, // ViewProj........
+ 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2f, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, // ....../.CTAB....
0x83, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, // ................
0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, // ....|...D.......
0x03, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, // ....L...........
@@ -51,21 +51,21 @@ static const uint8_t vs_metaballs_dx9[457] =
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M
0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS
0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile
- 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, // r 9.29.952.3111.
- 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
- 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, // ................
- 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, // ................
- 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................
- 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................
- 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U.........
- 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, // ................
- 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, // ................
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U.
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0xe0, 0x06, 0x00, 0xe4, 0xa0, // ................
- 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, // ................
- 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .........
+ 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, // r 10.0.10011.163
+ 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, // 84..............
+ 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, // ................
+ 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, // ................
+ 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, // ................
+ 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, // ..........U.....
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, // ................
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0xaa, 0x90, // ................
+ 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................
+ 0x03, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x05, 0x00, 0xe4, 0xa0, // ................
+ 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0xa0, // ..U.............
+ 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0xe0, // ................
+ 0x06, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
+ 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
};
static const uint8_t vs_metaballs_dx11[726] =
{
diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp
index 65045d383fd..8a5d851ba7c 100644
--- a/3rdparty/bgfx/examples/08-update/update.cpp
+++ b/3rdparty/bgfx/examples/08-update/update.cpp
@@ -240,7 +240,7 @@ public:
, BGFX_TEXTURE_MIN_POINT|BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIP_POINT
);
- m_m_texture2dData = (uint8_t*)malloc(m_texture2dSize*m_texture2dSize*4);
+ m_texture2dData = (uint8_t*)malloc(m_texture2dSize*m_texture2dSize*4);
m_rr = rand()%255;
m_gg = rand()%255;
@@ -255,13 +255,13 @@ public:
virtual int shutdown() BX_OVERRIDE
{
- // m_m_texture2dData is managed from main thread, and it's passed to renderer
+ // m_texture2dData is managed from main thread, and it's passed to renderer
// just as MemoryRef. At this point render might be using it. We must wait
// previous frame to finish before we can free it.
bgfx::frame();
// Cleanup.
- free(m_m_texture2dData);
+ free(m_texture2dData);
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
{
@@ -380,7 +380,7 @@ public:
const uint16_t tx = rand()%(m_texture2dSize-tw);
const uint16_t ty = rand()%(m_texture2dSize-th);
- uint8_t* dst = &m_m_texture2dData[(ty*m_texture2dSize+tx)*4];
+ uint8_t* dst = &m_texture2dData[(ty*m_texture2dSize+tx)*4];
uint8_t* next = dst + pitch;
// Using makeRef to pass texture memory without copying.
@@ -537,7 +537,7 @@ public:
return false;
}
- uint8_t* m_m_texture2dData;
+ uint8_t* m_texture2dData;
uint32_t m_width;
uint32_t m_height;
diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
index 14f6edca81b..047fb0aa565 100644
--- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp
+++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
@@ -205,7 +205,7 @@ class HDR : public entry::AppI
m_mesh = meshLoad("meshes/bunny.bin");
m_fbtextures[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
- m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY);
+ m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY);
m_fbh = bgfx::createFrameBuffer(BX_COUNTOF(m_fbtextures), m_fbtextures, true);
m_lum[0] = bgfx::createFrameBuffer(128, 128, bgfx::TextureFormat::BGRA8);
@@ -308,7 +308,7 @@ class HDR : public entry::AppI
bgfx::destroyFrameBuffer(m_fbh);
m_fbtextures[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, ( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT)|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
- m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY|( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT) );
+ m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY|( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT) );
m_fbh = bgfx::createFrameBuffer(BX_COUNTOF(m_fbtextures), m_fbtextures, true);
}
diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
index 94302bb2163..773bdda0b08 100644
--- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp
+++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
@@ -682,7 +682,7 @@ struct Mesh
#define BGFX_CHUNK_MAGIC_PRI BX_MAKEFOURCC('P', 'R', 'I', 0x0)
bx::CrtFileReader reader;
- reader.open(_filePath);
+ bx::open(&reader, _filePath);
Group group;
@@ -763,7 +763,7 @@ struct Mesh
}
}
- reader.close();
+ bx::close(&reader);
}
void unload()
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
index d39773c214f..4084359ba35 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
@@ -1030,7 +1030,7 @@ struct Mesh
#define BGFX_CHUNK_MAGIC_PRI BX_MAKEFOURCC('P', 'R', 'I', 0x0)
bx::CrtFileReader reader;
- reader.open(_filePath);
+ bx::open(&reader, _filePath);
Group group;
@@ -1114,7 +1114,7 @@ struct Mesh
}
}
- reader.close();
+ bx::close(&reader);
for (GroupArray::iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
{
@@ -1898,7 +1898,7 @@ int _main_(int _argc, char** _argv)
bgfx::TextureHandle fbtextures[] =
{
bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_RT),
- bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY),
+ bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY),
};
s_stencilFb = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
@@ -2092,7 +2092,7 @@ int _main_(int _argc, char** _argv)
bgfx::destroyFrameBuffer(s_stencilFb);
fbtextures[0] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_RT);
- fbtextures[1] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY);
+ fbtextures[1] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY);
s_stencilFb = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
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 04d5896c81d..2a046f7317c 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
@@ -7,8 +7,12 @@ $input v_position
#include "../common/common.sh"
+uniform vec4 u_depthScaleOffset; // for GL, map depth values into [0, 1] range
+#define u_depthScale u_depthScaleOffset.x
+#define u_depthOffset u_depthScaleOffset.y
+
void main()
{
- float depth = v_position.z/v_position.w * 0.5 + 0.5;
+ float depth = v_position.z/v_position.w * u_depthScale + u_depthOffset;
gl_FragColor = packFloatToRgba(depth);
}
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
index 07f692cff47..3ef2e057d0e 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
@@ -91,6 +91,13 @@ int _main_(int _argc, char** _argv)
bgfx::UniformHandle u_shadowMap = bgfx::createUniform("u_shadowMap", bgfx::UniformType::Int1);
bgfx::UniformHandle u_lightPos = bgfx::createUniform("u_lightPos", bgfx::UniformType::Vec4);
bgfx::UniformHandle u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Mat4);
+ // When using GL clip space depth range [-1, 1] and packing depth into color buffer, we need to
+ // adjust the depth range to be [0, 1] for writing to the color buffer
+ bgfx::UniformHandle u_depthScaleOffset = bgfx::createUniform("u_depthScaleOffset", bgfx::UniformType::Vec4);
+ const float depthScale = flipV ? 0.5f : 1.0f;
+ const float depthOffset = flipV ? 0.5f : 0.0f;
+ float depthScaleOffset[4] = {depthScale, depthOffset, 0.0f, 0.0f};
+ bgfx::setUniform(u_depthScaleOffset, depthScaleOffset);
// Vertex declarations.
bgfx::VertexDecl PosNormalDecl;
@@ -148,7 +155,7 @@ int _main_(int _argc, char** _argv)
bgfx::TextureHandle fbtextures[] =
{
shadowMapTexture,
- bgfx::createTexture2D(shadowMapSize, shadowMapSize, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY),
+ bgfx::createTexture2D(shadowMapSize, shadowMapSize, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY),
};
shadowMapFB = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
@@ -274,7 +281,7 @@ int _main_(int _argc, char** _argv)
bx::mtxLookAt(lightView, eye, at);
const float area = 30.0f;
- bx::mtxOrtho(lightProj, -area, area, -area, area, -100.0f, 100.0f);
+ bx::mtxOrtho(lightProj, -area, area, -area, area, -100.0f, 100.0f, 0.0f, flipV);
bgfx::setViewRect(RENDER_SHADOW_PASS_ID, 0, 0, shadowMapSize, shadowMapSize);
bgfx::setViewFrameBuffer(RENDER_SHADOW_PASS_ID, shadowMapFB);
@@ -303,8 +310,8 @@ int _main_(int _argc, char** _argv)
{
0.5f, 0.0f, 0.0f, 0.0f,
0.0f, sy, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.5f, 0.0f,
- 0.5f, 0.5f, 0.5f, 1.0f,
+ 0.0f, 0.0f, depthScale, 0.0f,
+ 0.5f, 0.5f, depthOffset, 1.0f,
};
float mtxTmp[16];
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
index 7a840b45672..1e8ddaee339 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
+++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
@@ -891,7 +891,7 @@ struct Mesh
#define BGFX_CHUNK_MAGIC_PRI BX_MAKEFOURCC('P', 'R', 'I', 0x0)
bx::CrtFileReader reader;
- reader.open(_filePath);
+ bx::open(&reader, _filePath);
Group group;
@@ -971,7 +971,7 @@ struct Mesh
}
}
- reader.close();
+ bx::close(&reader);
}
void unload()
@@ -989,13 +989,13 @@ struct Mesh
m_groups.clear();
}
- void submit(uint8_t _viewId, float* _mtx, bgfx::ProgramHandle _program, const RenderState& _renderState)
+ void submit(uint8_t _viewId, float* _mtx, bgfx::ProgramHandle _program, const RenderState& _renderState, bool _submitShadowMaps = false)
{
bgfx::TextureHandle texture = BGFX_INVALID_HANDLE;
- submit(_viewId, _mtx, _program, _renderState, texture);
+ submit(_viewId, _mtx, _program, _renderState, texture, _submitShadowMaps);
}
- void submit(uint8_t _viewId, float* _mtx, bgfx::ProgramHandle _program, const RenderState& _renderState, bgfx::TextureHandle _texture)
+ void submit(uint8_t _viewId, float* _mtx, bgfx::ProgramHandle _program, const RenderState& _renderState, bgfx::TextureHandle _texture, bool _submitShadowMaps = false)
{
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
{
@@ -1015,9 +1015,12 @@ struct Mesh
bgfx::setTexture(0, s_texColor, _texture);
}
- for (uint8_t ii = 0; ii < ShadowMapRenderTargets::Count; ++ii)
+ if (_submitShadowMaps)
{
- bgfx::setTexture(4 + ii, s_shadowMap[ii], s_rtShadowMap[ii]);
+ for (uint8_t ii = 0; ii < ShadowMapRenderTargets::Count; ++ii)
+ {
+ bgfx::setTexture(4 + ii, s_shadowMap[ii], s_rtShadowMap[ii]);
+ }
}
// Apply render state.
@@ -2977,6 +2980,7 @@ int _main_(int _argc, char** _argv)
, mtxFloor
, *currentSmSettings->m_progDraw
, s_renderStates[RenderState::Default]
+ , true
);
// Bunny.
@@ -2988,6 +2992,7 @@ int _main_(int _argc, char** _argv)
, mtxBunny
, *currentSmSettings->m_progDraw
, s_renderStates[RenderState::Default]
+ , true
);
// Hollow cube.
@@ -2999,6 +3004,7 @@ int _main_(int _argc, char** _argv)
, mtxHollowcube
, *currentSmSettings->m_progDraw
, s_renderStates[RenderState::Default]
+ , true
);
// Cube.
@@ -3010,6 +3016,7 @@ int _main_(int _argc, char** _argv)
, mtxCube
, *currentSmSettings->m_progDraw
, s_renderStates[RenderState::Default]
+ , true
);
// Trees.
@@ -3023,6 +3030,7 @@ int _main_(int _argc, char** _argv)
, mtxTrees[ii]
, *currentSmSettings->m_progDraw
, s_renderStates[RenderState::Default]
+ , true
);
}
diff --git a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
index cf32868ff42..684132a061e 100644
--- a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
+++ b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
@@ -7,17 +7,17 @@ static const uint8_t fs_drawstress_glsl[89] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ragColor = v_col
0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0;.}...
};
-static const uint8_t fs_drawstress_dx9[137] =
+static const uint8_t fs_drawstress_dx9[141] =
{
- 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
- 0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I........
+ 0xfe, 0xff, 0x17, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, // 29.952.3111.....
- 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .........
+ 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, // ader Compiler 10
+ 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, // .0.10011.16384..
+ 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
};
static const uint8_t fs_drawstress_dx11[260] =
{
diff --git a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
index 27cb89d15c3..2a2fcef2ada 100644
--- a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
+++ b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
@@ -22,11 +22,11 @@ static const uint8_t vs_drawstress_glsl[325] =
0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // lor0 = a_color0;
0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}...
};
-static const uint8_t vs_drawstress_dx9[319] =
+static const uint8_t vs_drawstress_dx9[323] =
{
0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
+ 0x20, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // .......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -34,16 +34,17 @@ static const uint8_t vs_drawstress_dx9[319] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................
- 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ................
- 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U...........
- 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
- 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
- 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.......
+ 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................
+ 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
+ 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_drawstress_dx11[510] =
{
diff --git a/3rdparty/bgfx/examples/27-terrain/terrain.cpp b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
index 32686a7746e..71ab88aa128 100644
--- a/3rdparty/bgfx/examples/27-terrain/terrain.cpp
+++ b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
@@ -69,7 +69,7 @@ class Terrain : public entry::AppI
m_debug = BGFX_DEBUG_TEXT;
m_reset = BGFX_RESET_VSYNC;
- bgfx::init(bgfx::RendererType::Direct3D11, args.m_pciId);
+ bgfx::init(args.m_type, args.m_pciId);
bgfx::reset(m_width, m_height, m_reset);
// Enable m_debug text.
@@ -313,11 +313,11 @@ class Terrain : public entry::AppI
// Raise/Lower and scale by brush power.
height += (bx::fclamp(brushAttn * m_brush.m_power, 0.0, m_brush.m_power) * m_brush.m_raise)
- ? 1.0
- : -1.0
+ ? 1.0f
+ : -1.0f
;
- m_terrain.m_heightMap[heightMapPos] = (uint8_t)bx::fclamp(height, 0.0, 255.0);
+ m_terrain.m_heightMap[heightMapPos] = (uint8_t)bx::fclamp(height, 0.0f, 255.0f);
m_terrain.m_dirty = true;
}
}
@@ -328,8 +328,8 @@ class Terrain : public entry::AppI
float ray_clip[4];
ray_clip[0] = ( (2.0f * m_mouseState.m_mx) / m_width - 1.0f) * -1.0f;
ray_clip[1] = ( (1.0f - (2.0f * m_mouseState.m_my) / m_height) ) * -1.0f;
- ray_clip[2] = -1.0;
- ray_clip[3] = 1.0;
+ ray_clip[2] = -1.0f;
+ ray_clip[3] = 1.0f;
float invProjMtx[16];
bx::mtxInverse(invProjMtx, m_projMtx);
@@ -436,13 +436,15 @@ class Terrain : public entry::AppI
imguiEndScrollArea();
imguiEndFrame();
- // Update camera.
- cameraUpdate(deltaTime, m_mouseState);
-
- bool leftMouseButtonDown = !!m_mouseState.m_buttons[entry::MouseButton::Left];
- if (leftMouseButtonDown)
+ if (!imguiMouseOverArea() )
{
- mousePickTerrain();
+ // Update camera.
+ cameraUpdate(deltaTime, m_mouseState);
+
+ if (!!m_mouseState.m_buttons[entry::MouseButton::Left])
+ {
+ mousePickTerrain();
+ }
}
// Update terrain.
diff --git a/3rdparty/bgfx/examples/common/aviwriter.h b/3rdparty/bgfx/examples/common/aviwriter.h
index 79acd7e4df9..dad992ab595 100644
--- a/3rdparty/bgfx/examples/common/aviwriter.h
+++ b/3rdparty/bgfx/examples/common/aviwriter.h
@@ -26,7 +26,7 @@ struct AviWriter
bool open(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _fps, bool _yflip)
{
- if (0 != m_writer->open(_filePath) )
+ if (!bx::open(m_writer, _filePath) )
{
return false;
}
@@ -36,7 +36,7 @@ struct AviWriter
m_numFrames = 0;
m_width = _width;
m_height = _height;
-
+
// Bgfx returns _yflip true for OpenGL since bottom left corner is 0, 0. In D3D top left corner
// is 0, 0. DIB expect OpenGL style coordinates, so this is inverted logic for AVI writer.
m_yflip = !_yflip;
@@ -163,7 +163,7 @@ struct AviWriter
m_writer->seek(m_lengthOffset, bx::Whence::Begin);
bx::write(m_writer, m_numFrames);
- m_writer->close();
+ bx::close(m_writer);
delete [] m_frame;
m_frame = NULL;
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
index cdec2abbdfc..9b03d3d70b9 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
@@ -24,7 +24,7 @@ namespace stl = tinystl;
void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size)
{
- if (0 == bx::open(_reader, _filePath) )
+ if (bx::open(_reader, _filePath) )
{
uint32_t size = (uint32_t)bx::getSize(_reader);
void* data = BX_ALLOC(_allocator, size);
@@ -45,6 +45,7 @@ void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _fi
{
*_size = 0;
}
+
return NULL;
}
@@ -60,7 +61,7 @@ void unload(void* _ptr)
static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePath)
{
- if (0 == bx::open(_reader, _filePath) )
+ if (bx::open(_reader, _filePath) )
{
uint32_t size = (uint32_t)bx::getSize(_reader);
const bgfx::Memory* mem = bgfx::alloc(size+1);
@@ -76,7 +77,7 @@ static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePa
static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size)
{
- if (0 == bx::open(_reader, _filePath) )
+ if (bx::open(_reader, _filePath) )
{
uint32_t size = (uint32_t)bx::getSize(_reader);
void* data = BX_ALLOC(_allocator, size);
@@ -408,7 +409,9 @@ struct Mesh
bx::AllocatorI* allocator = entry::getAllocator();
uint32_t chunk;
- while (4 == bx::read(_reader, chunk) )
+ bx::Error err;
+ while (4 == bx::read(_reader, chunk, &err)
+ && err.isOk() )
{
switch (chunk)
{
@@ -596,10 +599,14 @@ Mesh* meshLoad(bx::ReaderSeekerI* _reader)
Mesh* meshLoad(const char* _filePath)
{
bx::FileReaderI* reader = entry::getFileReader();
- bx::open(reader, _filePath);
- Mesh* mesh = meshLoad(reader);
- bx::close(reader);
- return mesh;
+ if (bx::open(reader, _filePath) )
+ {
+ Mesh* mesh = meshLoad(reader);
+ bx::close(reader);
+ return mesh;
+ }
+
+ return NULL;
}
void meshUnload(Mesh* _mesh)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_ios.mm b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
index e12c224e623..052c161abd4 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_ios.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
@@ -185,7 +185,7 @@ static void* m_device = NULL;
}
}
#endif
-
+
return [CAEAGLLayer class];
}
@@ -197,15 +197,15 @@ static void* m_device = NULL;
{
return nil;
}
-
+
bgfx::PlatformData pd;
pd.ndt = NULL;
pd.nwh = self.layer;
- pd.context = m_device;
+ pd.context = m_device;
pd.backBuffer = NULL;
pd.backBufferDS = NULL;
bgfx::setPlatformData(pd);
-
+
return self;
}
@@ -309,7 +309,7 @@ static void* m_device = NULL;
[m_window setRootViewController:viewController];
[m_window makeKeyAndVisible];
-
+
[m_window makeKeyAndVisible];
//float scaleFactor = [[UIScreen mainScreen] scale]; // should use this, but ui is too small on ipad retina
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 880f44123e4..502eed673ad 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -14,7 +14,7 @@
#include <string.h> // memcpy
#ifndef ENTRY_CONFIG_USE_SDL
-# define ENTRY_CONFIG_USE_SDL 0
+# define ENTRY_CONFIG_USE_SDL BX_PLATFORM_STEAMLINK
#endif // ENTRY_CONFIG_USE_SDL
#ifndef ENTRY_CONFIG_USE_GLFW
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index c5ab2c7d57a..2bff902302c 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -11,13 +11,24 @@
# define SDL_MAIN_HANDLED
#endif // BX_PLATFORM_WINDOWS
+#include <bx/bx.h>
+
#include <SDL2/SDL.h>
+
+BX_PRAGMA_DIAGNOSTIC_PUSH_CLANG()
+BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wextern-c-compat")
#include <SDL2/SDL_syswm.h>
+BX_PRAGMA_DIAGNOSTIC_POP_CLANG()
+
#include <bgfx/bgfxplatform.h>
+#if defined(None) // X11 defines this...
+# undef None
+#endif // defined(None)
#include <stdio.h>
#include <bx/thread.h>
#include <bx/handlealloc.h>
+#include <bx/readerwriter.h>
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -74,6 +85,22 @@ namespace entry
return GamepadAxis::Enum(s_translateGamepadAxis[_sdl]);
}
+ struct AxisDpadRemap
+ {
+ Key::Enum first;
+ Key::Enum second;
+ };
+
+ static AxisDpadRemap s_axisDpad[] =
+ {
+ { Key::GamepadLeft, Key::GamepadRight },
+ { Key::GamepadUp, Key::GamepadDown },
+ { Key::None, Key::None },
+ { Key::GamepadLeft, Key::GamepadRight },
+ { Key::GamepadUp, Key::GamepadDown },
+ { Key::None, Key::None },
+ };
+
struct GamepadSDL
{
GamepadSDL()
@@ -91,17 +118,59 @@ namespace entry
m_deadzone[GamepadAxis::RightZ] = 30;
}
- void create(int32_t _jid)
+ void create(const SDL_JoyDeviceEvent& _jev)
{
- m_controller = SDL_GameControllerOpen(_jid);
+ m_joystick = SDL_JoystickOpen(_jev.which);
+ SDL_Joystick* joystick = m_joystick;
+ m_jid = SDL_JoystickInstanceID(joystick);
+ }
+
+ void create(const SDL_ControllerDeviceEvent& _cev)
+ {
+ m_controller = SDL_GameControllerOpen(_cev.which);
SDL_Joystick* joystick = SDL_GameControllerGetJoystick(m_controller);
m_jid = SDL_JoystickInstanceID(joystick);
}
+ void update(EventQueue& _eventQueue, WindowHandle _handle, GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value)
+ {
+ if (filter(_axis, &_value) )
+ {
+ _eventQueue.postAxisEvent(_handle, _gamepad, _axis, _value);
+
+ if (Key::None != s_axisDpad[_axis].first)
+ {
+ if (_value == 0)
+ {
+ _eventQueue.postKeyEvent(_handle, s_axisDpad[_axis].first, 0, false);
+ _eventQueue.postKeyEvent(_handle, s_axisDpad[_axis].second, 0, false);
+ }
+ else
+ {
+ _eventQueue.postKeyEvent(_handle
+ , 0 > _value ? s_axisDpad[_axis].first : s_axisDpad[_axis].second
+ , 0
+ , true
+ );
+ }
+ }
+ }
+ }
+
void destroy()
{
- SDL_GameControllerClose(m_controller);
- m_controller = NULL;
+ if (NULL != m_controller)
+ {
+ SDL_GameControllerClose(m_controller);
+ m_controller = NULL;
+ }
+
+ if (NULL != m_joystick)
+ {
+ SDL_JoystickClose(m_joystick);
+ m_joystick = NULL;
+ }
+
m_jid = INT32_MAX;
}
@@ -119,6 +188,7 @@ namespace entry
int32_t m_value[GamepadAxis::Count];
int32_t m_deadzone[GamepadAxis::Count];
+ SDL_Joystick* m_joystick;
SDL_GameController* m_controller;
// SDL_Haptic* m_haptic;
SDL_JoystickID m_jid;
@@ -326,7 +396,6 @@ namespace entry
m_mte.m_argv = _argv;
SDL_Init(0
- | SDL_INIT_VIDEO
| SDL_INIT_GAMECONTROLLER
);
@@ -356,10 +425,18 @@ namespace entry
WindowHandle defaultWindow = { 0 };
setWindowSize(defaultWindow, m_width, m_height, true);
- SDL_RWops* rw = SDL_RWFromFile("gamecontrollerdb.txt", "rb");
- if (NULL != rw)
+ bx::CrtFileReader reader;
+ if (bx::open(&reader, "gamecontrollerdb.txt") )
{
- SDL_GameControllerAddMappingsFromRW(rw, 1);
+ bx::AllocatorI* allocator = getAllocator();
+ uint32_t size = (uint32_t)bx::getSize(&reader);
+ void* data = BX_ALLOC(allocator, size);
+ bx::read(&reader, data, size);
+ bx::close(&reader);
+
+ SDL_GameControllerAddMapping( (char*)data);
+
+ BX_FREE(allocator, data);
}
bool exit = false;
@@ -477,6 +554,7 @@ namespace entry
}
}
break;
+
case SDL_KEYUP:
{
const SDL_KeyboardEvent& kev = event.key;
@@ -530,6 +608,18 @@ namespace entry
}
break;
+ case SDL_JOYAXISMOTION:
+ {
+ const SDL_JoyAxisEvent& jev = event.jaxis;
+ GamepadHandle handle = findGamepad(jev.which);
+ if (isValid(handle) )
+ {
+ GamepadAxis::Enum axis = translateGamepadAxis(jev.axis);
+ m_gamepad[handle.idx].update(m_eventQueue, defaultWindow, handle, axis, jev.value);
+ }
+ }
+ break;
+
case SDL_CONTROLLERAXISMOTION:
{
const SDL_ControllerAxisEvent& aev = event.caxis;
@@ -537,10 +627,23 @@ namespace entry
if (isValid(handle) )
{
GamepadAxis::Enum axis = translateGamepadAxis(aev.axis);
- int32_t value = aev.value;
- if (m_gamepad[handle.idx].filter(axis, &value) )
+ m_gamepad[handle.idx].update(m_eventQueue, defaultWindow, handle, axis, aev.value);
+ }
+ }
+ break;
+
+ case SDL_JOYBUTTONDOWN:
+ case SDL_JOYBUTTONUP:
+ {
+ const SDL_JoyButtonEvent& bev = event.jbutton;
+ GamepadHandle handle = findGamepad(bev.which);
+
+ if (isValid(handle) )
+ {
+ Key::Enum key = translateGamepad(bev.button);
+ if (Key::Count != key)
{
- m_eventQueue.postAxisEvent(defaultWindow, handle, axis, value);
+ m_eventQueue.postKeyEvent(defaultWindow, key, 0, event.type == SDL_JOYBUTTONDOWN);
}
}
}
@@ -562,14 +665,38 @@ namespace entry
}
break;
- case SDL_CONTROLLERDEVICEADDED:
+ case SDL_JOYDEVICEADDED:
{
- const SDL_ControllerDeviceEvent& cev = event.cdevice;
+ GamepadHandle handle = { m_gamepadAlloc.alloc() };
+ if (isValid(handle) )
+ {
+ const SDL_JoyDeviceEvent& jev = event.jdevice;
+ m_gamepad[handle.idx].create(jev);
+ m_eventQueue.postGamepadEvent(defaultWindow, handle, true);
+ }
+ }
+ break;
+
+ case SDL_JOYDEVICEREMOVED:
+ {
+ const SDL_JoyDeviceEvent& jev = event.jdevice;
+ GamepadHandle handle = findGamepad(jev.which);
+ if (isValid(handle) )
+ {
+ m_gamepad[handle.idx].destroy();
+ m_gamepadAlloc.free(handle.idx);
+ m_eventQueue.postGamepadEvent(defaultWindow, handle, false);
+ }
+ }
+ break;
+ case SDL_CONTROLLERDEVICEADDED:
+ {
GamepadHandle handle = { m_gamepadAlloc.alloc() };
if (isValid(handle) )
{
- m_gamepad[handle.idx].create(cev.which);
+ const SDL_ControllerDeviceEvent& cev = event.cdevice;
+ m_gamepad[handle.idx].create(cev);
m_eventQueue.postGamepadEvent(defaultWindow, handle, true);
}
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 247bed44385..37f403ee480 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -358,7 +358,7 @@ namespace entry
s_translateKey[VK_HOME] = Key::Home;
s_translateKey[VK_END] = Key::End;
s_translateKey[VK_PRIOR] = Key::PageUp;
- s_translateKey[VK_NEXT] = Key::PageUp;
+ s_translateKey[VK_NEXT] = Key::PageDown;
s_translateKey[VK_SNAPSHOT] = Key::Print;
s_translateKey[VK_OEM_PLUS] = Key::Plus;
s_translateKey[VK_OEM_MINUS] = Key::Minus;
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index a058479fabb..8ced748dcbe 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -61,6 +61,23 @@ namespace entry
GamepadAxis::RightZ,
};
+ struct AxisDpadRemap
+ {
+ Key::Enum first;
+ Key::Enum second;
+ };
+
+ static AxisDpadRemap s_axisDpad[] =
+ {
+ { Key::GamepadLeft, Key::GamepadRight },
+ { Key::GamepadUp, Key::GamepadDown },
+ { Key::None, Key::None },
+ { Key::GamepadLeft, Key::GamepadRight },
+ { Key::GamepadUp, Key::GamepadDown },
+ { Key::None, Key::None },
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
+
struct Joystick
{
Joystick()
@@ -135,6 +152,24 @@ namespace entry
if (filter(axis, &value) )
{
_eventQueue.postAxisEvent(defaultWindow, handle, axis, value);
+
+ if (Key::None != s_axisDpad[axis].first)
+ {
+ if (m_value[axis] == 0)
+ {
+ _eventQueue.postKeyEvent(defaultWindow, s_axisDpad[axis].first, 0, false);
+ _eventQueue.postKeyEvent(defaultWindow, s_axisDpad[axis].second, 0, false);
+ }
+ else
+ {
+ _eventQueue.postKeyEvent(defaultWindow
+ , 0 > m_value[axis] ? s_axisDpad[axis].first : s_axisDpad[axis].second
+ , 0
+ , true
+ );
+ }
+ }
+
}
}
}
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
index 69a3484dc65..4bf319a2ecf 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
@@ -36,37 +36,38 @@ static const uint8_t fs_font_basic_glsl[553] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_4;.}...
};
-static const uint8_t fs_font_basic_dx9[462] =
+static const uint8_t fs_font_basic_dx9[466] =
{
0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xb0, 0x01, 0x00, 0x03, 0xff, // Color0..........
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xb4, 0x01, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
- 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
- 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x1f, 0x00, 0x00, // ...........@....
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, // ................
- 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, // ................
- 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ...U............
- 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, // .X.........U....
- 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ................
- 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ...U.X..........
- 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // .......U........
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // .........X......
- 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, // .............B..
- 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, // ................
- 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ..............
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, // .Q..........@...
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, // ?.......?Q......
+ 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, // ...............@
+ 0xc0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, // ................
+ 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // .......U........
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, // .....X.........U
+ 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, // .......U.X......
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, // ...........U....
+ 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, // .............X..
+ 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, // ................
+ 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, // .B..............
+ 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, // ................
+ 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
+ 0x00, 0x00, // ..
};
static const uint8_t fs_font_basic_dx11[617] =
{
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
index 030ec333753..9bd34a78a05 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
@@ -65,56 +65,56 @@ static const uint8_t fs_font_distance_field_glsl[1019] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_9;.}...
};
-static const uint8_t fs_font_distance_field_dx9[754] =
+static const uint8_t fs_font_distance_field_dx9[758] =
{
0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x02, 0x00, 0x03, 0xff, // Color0..........
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd8, 0x02, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
- 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
- 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, // ...........@.Q..
- 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........A...?...
- 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ...@@...........
- 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, // ................
- 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, // ...........U....
- 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, // .........X......
- 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, // ...U............
- 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, // ...........U.X..
- 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, // ................
- 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, // ...............U
- 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, // ................
- 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, // .X..............
- 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, // .....B..........
- 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, // ................
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x90, // ................
- 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // .......U........
- 0x80, 0x00, 0x00, 0x55, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, // ...U.[..........
- 0x90, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
- 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, // ................
- 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, // ...U............
- 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, // ...U.......U....
- 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, // .......U.......U
- 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, // ...........U....
- 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, // .......U........
- 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, // ................
- 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // ................
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, // ...............U
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, // ................
- 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
- 0x00, 0x00, // ..
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, // .Q..........@...
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, // ?.......?Q......
+ 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, // ...............@
+ 0xc0, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, // .Q..........A...
+ 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, // ?......@@.......
+ 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, // ................
+ 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, // ................
+ 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, // ...............U
+ 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, // .............X..
+ 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, // .......U........
+ 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, // .X..............
+ 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, // ...U............
+ 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, // .....X..........
+ 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, // .........B......
+ 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, // ................
+ 0x80, 0x01, 0x00, 0x90, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, // ................
+ 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, // ...........U....
+ 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, // .......U.[......
+ 0x80, 0x01, 0x00, 0xe4, 0x90, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, // ................
+ 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, // .......U........
+ 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x55, // .......U.......U
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, // ...........U....
+ 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, // ...U............
+ 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, // ...........U....
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xaa, // ................
+ 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, // ...U............
+ 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
static const uint8_t fs_font_distance_field_dx11[1053] =
{
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
index 46bdf5ab710..154481dc393 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
@@ -81,65 +81,65 @@ static const uint8_t fs_font_distance_field_subpixel_glsl[1268] =
0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, // * v_color0.w);.
0x7d, 0x0a, 0x0a, 0x00, // }...
};
-static const uint8_t fs_font_distance_field_subpixel_dx9[902] =
+static const uint8_t fs_font_distance_field_subpixel_dx9[906] =
{
0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x68, 0x03, 0x00, 0x03, 0xff, // Color0.....h....
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x6c, 0x03, 0x00, 0x03, 0xff, // Color0.....l....
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
- 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
- 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, // ...........@.Q..
- 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, // ...........@@...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xc1, 0xaa, 0x2a, // .....Q.........*
- 0x3e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // >...A...?.......
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, // ................
- 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, // ................
- 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ...U............
- 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, // .X.........U....
- 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ................
- 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ...U.X..........
- 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // .......U........
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // .........X......
- 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x5b, 0x00, 0x00, // .............[..
- 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, // ................
- 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xe4, 0x90, 0x42, 0x00, 0x00, // .............B..
- 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
- 0x03, 0x02, 0x00, 0x01, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, // ................
- 0x04, 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xe4, // ................
- 0x90, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
- 0x80, 0x07, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, // ................
- 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, // .........B......
- 0x80, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, // ................
- 0x80, 0x03, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
- 0x80, 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, // ................
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, // .......U........
- 0x80, 0x01, 0x00, 0xe4, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, // ................
- 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa1, 0x03, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, // .......U........
- 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, // ...........U....
- 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0x00, // ...........U....
- 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x90, // ...........U....
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x02, 0x00, 0x55, 0x80, 0x00, 0x00, 0xff, // ...........U....
- 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x04, 0x00, 0x00, // ................
- 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, // ...............U
- 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xff, // ................
- 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, // .Q..........@...
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, // ?.......?Q......
+ 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, // ...............@
+ 0xc0, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, // .Q.............@
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, // @........Q......
+ 0xa0, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ...*>...A...?...
+ 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, // ................
+ 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // .......U........
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, // .....X.........U
+ 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, // .......U.X......
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, // ...........U....
+ 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, // .............X..
+ 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, // ................
+ 0xa0, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, // .[..............
+ 0x04, 0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xe4, // ................
+ 0x90, 0x42, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, // .B..............
+ 0xa0, 0x09, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, // ................
+ 0xa0, 0x01, 0x00, 0xe4, 0x90, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, // ................
+ 0x80, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x42, 0x00, 0x00, // .............B..
+ 0x03, 0x03, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
+ 0x03, 0x02, 0x00, 0x04, 0x80, 0x03, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, // ................
+ 0x03, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, // ...........U....
+ 0x02, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, // ................
+ 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa1, 0x03, 0x00, 0xaa, // ...........U....
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, // ...............U
+ 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x81, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x81, 0x02, 0x00, 0x90, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x02, 0x00, 0x55, // ...............U
+ 0x80, 0x00, 0x00, 0xff, 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, // ................
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, // ................
+ 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, // ...U............
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x00, 0x00, 0xff, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ..........
};
static const uint8_t fs_font_distance_field_subpixel_dx11[1305] =
{
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
index 5df95fa7cce..884743b9973 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
@@ -28,11 +28,11 @@ static const uint8_t vs_font_basic_glsl[431] =
0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 =
0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}...
};
-static const uint8_t vs_font_basic_dx9[335] =
+static const uint8_t vs_font_basic_dx9[339] =
{
0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
+ 0x30, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // 0.......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -40,17 +40,18 @@ static const uint8_t vs_font_basic_dx9[335] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
- 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x05, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U...
- 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, // ................
- 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
- 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, // ................
- 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................
+ 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, // ................
+ 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
+ 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, // U...............
+ 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_font_basic_dx11[580] =
{
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
index 6fea18b931a..ebc7589c408 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
@@ -28,11 +28,11 @@ static const uint8_t vs_font_distance_field_glsl[431] =
0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 =
0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}...
};
-static const uint8_t vs_font_distance_field_dx9[335] =
+static const uint8_t vs_font_distance_field_dx9[339] =
{
0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
+ 0x30, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // 0.......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -40,17 +40,18 @@ static const uint8_t vs_font_distance_field_dx9[335] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
- 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x05, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U...
- 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, // ................
- 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
- 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, // ................
- 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................
+ 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, // ................
+ 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
+ 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, // U...............
+ 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_font_distance_field_dx11[580] =
{
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
index bd885e453e3..6b0d75236d6 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
@@ -28,11 +28,11 @@ static const uint8_t vs_font_distance_field_subpixel_glsl[431] =
0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 =
0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}...
};
-static const uint8_t vs_font_distance_field_subpixel_dx9[335] =
+static const uint8_t vs_font_distance_field_subpixel_dx9[339] =
{
0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
+ 0x30, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // 0.......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -40,17 +40,18 @@ static const uint8_t vs_font_distance_field_subpixel_dx9[335] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
- 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x05, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U...
- 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, // ................
- 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
- 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, // ................
- 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................
+ 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, // ................
+ 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
+ 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, // U...............
+ 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_font_distance_field_subpixel_dx11[580] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
index 611a46bc560..d64b2bdf7ca 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
@@ -7,17 +7,17 @@ static const uint8_t fs_imgui_color_glsl[89] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ragColor = v_col
0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0;.}...
};
-static const uint8_t fs_imgui_color_dx9[137] =
+static const uint8_t fs_imgui_color_dx9[141] =
{
- 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
- 0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I........
+ 0xfe, 0xff, 0x17, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, // 29.952.3111.....
- 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .........
+ 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, // ader Compiler 10
+ 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, // .0.10011.16384..
+ 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
};
static const uint8_t fs_imgui_color_dx11[260] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
index 265aef506c1..f274ada3d9c 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
@@ -24,12 +24,12 @@ static const uint8_t fs_imgui_cubemap_glsl[363] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_1;.}...
};
-static const uint8_t fs_imgui_cubemap_dx9[390] =
+static const uint8_t fs_imgui_cubemap_dx9[394] =
{
0x46, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH....e...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
- 0x00, 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...P.......0.CTA
+ 0x00, 0x01, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x31, 0x00, 0x43, 0x54, 0x41, // ...T.......1.CTA
0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
@@ -40,17 +40,17 @@ static const uint8_t fs_imgui_cubemap_dx9[390] =
0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x01, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, // .......L?..L>...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, // ................
- 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, // ................
- 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, // ....._..........
- 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, // ...........U....
- 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, // .......U.......U
- 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, // .Q.........L?..L
+ 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, // >...............
+ 0x80, 0x00, 0x00, 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, // ...........U....
+ 0xa0, 0x01, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ...U......
};
static const uint8_t fs_imgui_cubemap_dx11[441] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
index 8496e53c794..618848fa5a1 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
@@ -24,12 +24,12 @@ static const uint8_t fs_imgui_image_glsl[360] =
0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar
0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _1;.}...
};
-static const uint8_t fs_imgui_image_dx9[394] =
+static const uint8_t fs_imgui_image_dx9[398] =
{
0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
- 0x00, 0x01, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...T.......0.CTA
+ 0x00, 0x01, 0x00, 0x58, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x31, 0x00, 0x43, 0x54, 0x41, // ...X.......1.CTA
0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
@@ -40,17 +40,17 @@ static const uint8_t fs_imgui_image_dx9[394] =
0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ........?......L
- 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, // ?..L>...........
- 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, // ................
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0xe4, // ................
- 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, // ...........U....
- 0x80, 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ..........
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, // .Q..........?...
+ 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ...L?..L>.......
+ 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, // ................
+ 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, // ............._..
+ 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ..............
};
static const uint8_t fs_imgui_image_dx11[445] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
index 237bdb1e10c..593de84d168 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
@@ -28,13 +28,13 @@ static const uint8_t fs_imgui_image_swizz_glsl[425] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_1;.}...
};
-static const uint8_t fs_imgui_image_swizz_dx9[458] =
+static const uint8_t fs_imgui_image_swizz_dx9[462] =
{
0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
0x00, 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x01, 0x01, // ....u_swizzle...
- 0x00, 0x01, 0x00, 0x84, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x38, 0x00, 0x43, 0x54, 0x41, // ...........8.CTA
+ 0x00, 0x01, 0x00, 0x88, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x39, 0x00, 0x43, 0x54, 0x41, // ...........9.CTA
0x42, 0x1c, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, // B...............
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, // .............X..
0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........d......
@@ -47,18 +47,18 @@ static const uint8_t fs_imgui_image_swizz_dx9[458] =
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // .........u_swizz
0x6c, 0x65, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // le.ps_3_0.Micros
0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha
- 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, // der Compiler 9.2
- 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, // 9.952.3111...Q..
- 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ........?......L
- 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, // ?..L>...........
- 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, // ................
- 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
- 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, // ................
- 0x80, 0x00, 0x00, 0x40, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ...@......
+ 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10.
+ 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0xab, // 0.10011.16384...
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, // .Q..........?...
+ 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ...L?..L>.......
+ 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, // ................
+ 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, // ............._..
+ 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x0c, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, // ...U............
+ 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0x40, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .......@......
};
static const uint8_t fs_imgui_image_swizz_dx11[493] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
index 5a54b079fe2..14d7aef3e0b 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
@@ -42,12 +42,12 @@ static const uint8_t fs_imgui_latlong_glsl[651] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_4;.}...
};
-static const uint8_t fs_imgui_latlong_dx9[554] =
+static const uint8_t fs_imgui_latlong_dx9[558] =
{
0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
- 0x00, 0x01, 0x00, 0xf4, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...........0.CTA
+ 0x00, 0x01, 0x00, 0xf8, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x31, 0x00, 0x43, 0x54, 0x41, // ...........1.CTA
0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
@@ -58,27 +58,27 @@ static const uint8_t fs_imgui_latlong_dx9[554] =
0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
- 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, // ........?...@..I
- 0xc0, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, // .....Q.........L
- 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // ?..L>...........
- 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
- 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, // ................
- 0xa0, 0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
- 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, // ...............U
- 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, // .....%..........
- 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0x00, // ...........U....
- 0xa0, 0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
- 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, // ...............U
- 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, // .....%..........
- 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, 0x80, 0x02, 0x00, 0x55, // ...............U
- 0x81, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, // ................
- 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, // ................
- 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
- 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, // ...........U....
- 0xa0, 0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ...U......
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, // .Q..........?...
+ 0x40, 0xdb, 0x0f, 0x49, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, // @..I.....Q......
+ 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...L?..L>.......
+ 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x01, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x01, 0x00, 0x55, 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, // ...U.....%......
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x90, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x01, 0x00, 0x55, 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, // ...U.....%......
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, // ................
+ 0x80, 0x02, 0x00, 0x55, 0x81, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, // ...U............
+ 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, // ............._..
+ 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, // ...U...........U
+ 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .......U......
};
static const uint8_t fs_imgui_latlong_dx11[617] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
index 08d722db698..5fc0768dd13 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
@@ -20,25 +20,25 @@ static const uint8_t fs_imgui_texture_glsl[290] =
0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_1;.}.
0x0a, 0x00, // ..
};
-static const uint8_t fs_imgui_texture_dx9[258] =
+static const uint8_t fs_imgui_texture_dx9[262] =
{
0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe4, 0x00, 0x00, 0x03, 0xff, // Color0..........
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe8, 0x00, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, // .29.952.3111....
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, // ................
- 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, // .B..............
- 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, // ................
- 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
- 0x00, 0x00, // ..
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, // .....B..........
+ 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
static const uint8_t fs_imgui_texture_dx11[421] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
index ed79a9399c5..bbfafdf88d5 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
@@ -16,10 +16,10 @@ static const uint8_t fs_ocornut_imgui_glsl[238] =
0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x76, // = (tmpvar_1 * v
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0);.}...
};
-static const uint8_t fs_ocornut_imgui_dx9[237] =
+static const uint8_t fs_ocornut_imgui_dx9[241] =
{
0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
- 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x21, 0x00, // 0.............!.
+ 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd8, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x22, 0x00, // 0.............".
0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, // CTAB....O.......
0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, // ............H...
0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, // 0...........8...
@@ -27,12 +27,13 @@ static const uint8_t fs_ocornut_imgui_dx9[237] =
0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, // ............ps_3
0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, // _0.Microsoft (R)
0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, // HLSL Shader Com
- 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, // piler 9.29.952.3
- 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, // 111.............
- 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........B.......
- 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x0f, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
+ 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, // piler 10.0.10011
+ 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // .16384..........
+ 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, // ................
+ 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, // ............B...
+ 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, // ................
+ 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................
+ 0x00, // .
};
static const uint8_t fs_ocornut_imgui_dx11[396] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
index 4867ea1a86c..1b8aa95fb28 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
@@ -22,27 +22,27 @@ static const uint8_t vs_imgui_color_glsl[324] =
0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // or0 = a_color0;.
0x7d, 0x0a, 0x0a, 0x00, // }...
};
-static const uint8_t vs_imgui_color_dx9[290] =
+static const uint8_t vs_imgui_color_dx9[294] =
{
0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x08, 0x01, 0x00, 0x03, 0xfe, // wProj...........
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, // .<.......u_viewP
0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // roj.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....vs_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, // .29.952.3111....
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................
- 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, // ...........U....
- 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, // ................
- 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
- 0x00, 0x00, // ..
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, // ................
+ 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, // ...............U
+ 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, // ................
+ 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
static const uint8_t vs_imgui_color_dx11[465] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
index 6467376b5a7..154c4e416e3 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
@@ -22,11 +22,11 @@ static const uint8_t vs_imgui_cubemap_glsl[329] =
0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2e, // rmal = a_normal.
0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // xyz;.}...
};
-static const uint8_t vs_imgui_cubemap_dx9[319] =
+static const uint8_t vs_imgui_cubemap_dx9[323] =
{
0x56, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
+ 0x20, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // .......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -34,16 +34,17 @@ static const uint8_t vs_imgui_cubemap_dx9[319] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, // ................
- 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ................
- 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U...........
- 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
- 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
- 0x00, 0x02, 0x01, 0x00, 0x07, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.......
+ 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................
+ 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
+ 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_imgui_cubemap_dx11[510] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
index b34b38c4122..f3711052b08 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
@@ -22,27 +22,27 @@ static const uint8_t vs_imgui_image_glsl[336] =
0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, // v_texcoord0 = a
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _texcoord0;.}...
};
-static const uint8_t vs_imgui_image_dx9[290] =
+static const uint8_t vs_imgui_image_dx9[294] =
{
0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x08, 0x01, 0x00, 0x03, 0xfe, // wProj...........
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, // .<.......u_viewP
0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // roj.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....vs_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, // .29.952.3111....
- 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................
- 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, // ................
- 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, // ...........U....
- 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, // ................
- 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, // ................
- 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
- 0x00, 0x00, // ..
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, // ................
+ 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, // ...............U
+ 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, // ................
+ 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, // ................
+ 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
static const uint8_t vs_imgui_image_dx11[473] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
index 8b84198ba33..4cf8bb28af7 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
@@ -23,11 +23,11 @@ static const uint8_t vs_imgui_latlong_glsl[337] =
0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // a_texcoord0;.}..
0x00, // .
};
-static const uint8_t vs_imgui_latlong_dx9[319] =
+static const uint8_t vs_imgui_latlong_dx9[323] =
{
0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
- 0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
+ 0x20, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // .......$.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
@@ -35,16 +35,17 @@ static const uint8_t vs_imgui_latlong_dx9[319] =
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
- 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
- 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
- 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ................
- 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U...........
- 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
- 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
- 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, // ompiler 10.0.100
+ 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // 11.16384........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.......
+ 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................
+ 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, // ................
+ 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_imgui_latlong_dx11[518] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
index a5c839c5c08..34ab3e2da96 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
@@ -28,29 +28,29 @@ static const uint8_t vs_imgui_texture_glsl[419] =
0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, // r0 = a_color0;.}
0x0a, 0x0a, 0x00, // ...
};
-static const uint8_t vs_imgui_texture_dx9[326] =
+static const uint8_t vs_imgui_texture_dx9[330] =
{
0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x28, 0x01, 0x00, 0x03, 0xfe, // wProj......(....
- 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x2c, 0x01, 0x00, 0x03, 0xfe, // wProj......,....
+ 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...#.CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, // .<.......u_viewP
0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // roj.............
0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....vs_3_0.Micr
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, // .29.952.3111....
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
- 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, // ................
- 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, // ................
- 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
- 0x80, 0x02, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, // ................
- 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, // ...U............
- 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ................
- 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, // ................
- 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, // ................
- 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1
+ 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, // 0.0.10011.16384.
+ 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
+ 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................
+ 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // .......U........
+ 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, // ................
+ 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ..........
};
static const uint8_t vs_imgui_texture_dx11[575] =
{
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
index ba968aaa2a6..81ed318597a 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
@@ -34,11 +34,11 @@ static const uint8_t vs_ocornut_imgui_glsl[523] =
0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, // v_color0 = a_c
0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // olor0;.}...
};
-static const uint8_t vs_ocornut_imgui_dx9[367] =
+static const uint8_t vs_ocornut_imgui_dx9[371] =
{
0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, // wTexel......P...
- 0xfe, 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, // ....".CTAB....S.
+ 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x54, 0x01, 0x00, 0x03, // wTexel......T...
+ 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, // ....#.CTAB....S.
0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, // ................
0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ..L...0.........
0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // ..<.......u_view
@@ -46,19 +46,20 @@ static const uint8_t vs_ocornut_imgui_dx9[367] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......vs_3_0.Mic
0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
- 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, // 9.29.952.3111.Q.
- 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // .........@......
- 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // .?..............
- 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
- 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x05, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, // ................
- 0x00, 0x04, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, // ................
- 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, // U...........U...
- 0x00, 0xa1, 0x01, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0xe0, 0x01, 0x00, // ................
- 0xb4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, // ................
- 0x00, 0x02, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+ 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, // 10.0.10011.16384
+ 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // ..Q..........@..
+ 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // .....?..........
+ 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................
+ 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, // ................
+ 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
+ 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................
+ 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, // ....U...........
+ 0x55, 0x80, 0x01, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, // U...............
+ 0x0c, 0xe0, 0x01, 0x00, 0xb4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
};
static const uint8_t vs_ocornut_imgui_dx11[612] =
{
diff --git a/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h b/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
index f2de36d49ad..c7ed6294e86 100644
--- a/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
+++ b/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
@@ -195,7 +195,7 @@ static const uint8_t fs_nanovg_fill_glsl[3095] =
0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // gColor = result_
0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 1;.}...
};
-static const uint8_t fs_nanovg_fill_dx9[1543] =
+static const uint8_t fs_nanovg_fill_dx9[1547] =
{
0x46, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, // 0......u_extentR
@@ -206,8 +206,8 @@ static const uint8_t fs_nanovg_fill_dx9[1543] =
0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, // _params.......u_
0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, // scissorExtScale.
0x01, 0x08, 0x00, 0x01, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, // ......u_scissorM
- 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x6c, 0x05, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // at......l.......
- 0x63, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x01, 0x00, 0x00, 0x00, 0x03, // c.CTAB....W.....
+ 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x70, 0x05, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // at......p.......
+ 0x64, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x01, 0x00, 0x00, 0x00, 0x03, // d.CTAB....W.....
0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x01, // ..............P.
0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xc4, 0x00, // ................
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, // ................
@@ -231,69 +231,69 @@ static const uint8_t fs_nanovg_fill_dx9[1543] =
0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // orMat.ps_3_0.Mic
0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
- 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, // 9.29.952.3111.Q.
- 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // .........?...@..
- 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0c, 0x00, 0x0f, 0xa0, 0x00, 0x00, // .....?Q.........
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // .....?..@@......
- 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
- 0x01, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, // ................
- 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x90, 0x0b, 0x00, // ................
- 0x55, 0xa0, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U...............
- 0x00, 0x8c, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................
- 0x00, 0x80, 0x0a, 0x00, 0x55, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, // ....U...........
- 0x00, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................
- 0x55, 0x90, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U...............
- 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x04, 0x00, // ................
- 0xd0, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x80, 0x03, 0x00, // ....U...........
- 0xd0, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x06, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xd0, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, // ................
- 0x01, 0x80, 0x09, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x09, 0x00, // ................
- 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe9, 0x80, 0x01, 0x00, // U...............
- 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x44, 0xa0, 0x00, 0x00, // ............D...
- 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x44, 0xa0, 0x00, 0x00, // U...........D...
- 0x00, 0x90, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ................
- 0xe4, 0x80, 0x02, 0x00, 0x44, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ....D...........
- 0xe4, 0x8b, 0x08, 0x00, 0x44, 0xa1, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x0b, 0x00, // ....D...........
- 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x1c, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, // ................
- 0xe4, 0xa1, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x01, 0x00, // ................
- 0xff, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................
- 0xff, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x02, 0x00, // ................
- 0xaa, 0x80, 0x0a, 0x00, 0xff, 0xa0, 0x23, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0c, 0x80, 0x0a, 0x00, // ......#.........
- 0xb4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x08, // ..B.............
- 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x0f, 0x80, 0x03, 0x00, 0x00, 0x80, 0x0c, 0x00, // ................
- 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x03, 0x00, 0x0f, 0x80, 0x02, 0x00, // @.....X.........
- 0xff, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
- 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, // ..........).....
- 0xff, 0xa0, 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0x80, 0x0b, 0x00, // ....U...........
- 0xff, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, 0x04, 0x80, 0x0c, 0x00, // ..*.............
- 0xaa, 0xa0, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x05, 0x00, 0xaa, 0x80, 0x42, 0x00, // ..)...........B.
- 0x00, 0x03, 0x05, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x04, 0x00, // ................
- 0x00, 0x04, 0x06, 0x00, 0x0f, 0x80, 0x05, 0x00, 0x00, 0x80, 0x0c, 0x00, 0x40, 0xa0, 0x0c, 0x00, // ............@...
- 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x05, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xff, 0x81, 0x05, 0x00, // ..X.............
- 0xe4, 0x80, 0x06, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x05, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
- 0xff, 0x80, 0x05, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x04, 0x00, 0x0f, 0x80, 0x05, 0x00, // ................
- 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, // ......*.........
- 0x0f, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x58, 0x00, // ......+...+...X.
- 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xaa, 0x8c, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................
- 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x09, 0x00, 0xaa, 0xa1, 0x09, 0x00, // ................
- 0x60, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x02, 0x00, // `...............
- 0xf4, 0x81, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x00, 0x00, 0xa4, 0x80, 0x0c, 0x00, // ................
- 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x02, 0x00, 0xed, 0x80, 0x02, 0x00, // ..Z.............
- 0xed, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
- 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x0b, 0x00, // ................
- 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x0a, 0x00, // ........U.......
- 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x02, 0x00, // ........U.......
- 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, // ............U...
- 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x09, 0x00, 0xaa, 0xa1, 0x04, 0x00, // ........U.......
- 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, // ................
- 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x05, 0x00, // U...............
- 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, // ............U...
- 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
- 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x81, 0x07, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, // ................
- 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x05, 0x00, // ....U...........
- 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x58, 0x00, // ..............X.
- 0x00, 0x04, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xaa, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, // ................
- 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .......
+ 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, // 10.0.10011.16384
+ 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ..Q..........?..
+ 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0c, 0x00, // .@.......?Q.....
+ 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, // .........?..@@..
+ 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
+ 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................
+ 0x00, 0x90, 0x0b, 0x00, 0x55, 0xa0, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U...........
+ 0x01, 0x80, 0x00, 0x00, 0x00, 0x8c, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0a, 0x00, 0x55, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U.......
+ 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x01, 0x80, 0x01, 0x00, 0x55, 0x90, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U...........
+ 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x06, 0x80, 0x04, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.......
+ 0x06, 0x80, 0x03, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
+ 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xd0, 0xa0, 0x06, 0x00, // ................
+ 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x09, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, // ................
+ 0x02, 0x80, 0x09, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, // ....U...........
+ 0xe9, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ................
+ 0x44, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0c, 0x80, 0x00, 0x00, // D...U...........
+ 0x44, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // D...............
+ 0x0c, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x44, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ........D.......
+ 0x0c, 0x80, 0x01, 0x00, 0xe4, 0x8b, 0x08, 0x00, 0x44, 0xa1, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, // ........D.......
+ 0x07, 0x80, 0x0b, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x1c, 0x80, 0x01, 0x00, // ................
+ 0xe4, 0x80, 0x08, 0x00, 0xe4, 0xa1, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ................
+ 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x0a, 0x00, 0xff, 0xa0, 0x23, 0x00, 0x00, 0x02, 0x02, 0x00, // ..........#.....
+ 0x0c, 0x80, 0x0a, 0x00, 0xb4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x01, 0x00, // ......B.........
+ 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x0f, 0x80, 0x03, 0x00, // ................
+ 0x00, 0x80, 0x0c, 0x00, 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x03, 0x00, // ....@.....X.....
+ 0x0f, 0x80, 0x02, 0x00, 0xff, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, // ................
+ 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x29, 0x00, // ..............).
+ 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, // ........U.......
+ 0x0f, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, // ......*.........
+ 0x04, 0x80, 0x0c, 0x00, 0xaa, 0xa0, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x05, 0x00, // ......).........
+ 0xaa, 0x80, 0x42, 0x00, 0x00, 0x03, 0x05, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, // ..B.............
+ 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x06, 0x00, 0x0f, 0x80, 0x05, 0x00, 0x00, 0x80, 0x0c, 0x00, // ................
+ 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x05, 0x00, 0x0f, 0x80, 0x02, 0x00, // @.....X.........
+ 0xff, 0x81, 0x05, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x05, 0x00, // ................
+ 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x05, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x04, 0x00, // ................
+ 0x0f, 0x80, 0x05, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, // ..........*.....
+ 0x00, 0x02, 0x04, 0x00, 0x0f, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..........+...+.
+ 0x00, 0x00, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xaa, 0x8c, 0x03, 0x00, // ..X.............
+ 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x09, 0x00, // ................
+ 0xaa, 0xa1, 0x09, 0x00, 0x60, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, // ....`...........
+ 0xe4, 0x8b, 0x02, 0x00, 0xf4, 0x81, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x00, 0x00, // ................
+ 0xa4, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x02, 0x00, // ......Z.........
+ 0xed, 0x80, 0x02, 0x00, 0xed, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
+ 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
+ 0xff, 0x80, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U...
+ 0xaa, 0x80, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0c, 0x00, // ............U...
+ 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, // ................
+ 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x09, 0x00, // U...........U...
+ 0xaa, 0xa1, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x02, 0x00, // ................
+ 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x0a, 0x00, // ....U...........
+ 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................
+ 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x02, 0x00, // U...............
+ 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x81, 0x07, 0x00, 0xe4, 0xa0, 0x04, 0x00, // ................
+ 0x00, 0x04, 0x03, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x06, 0x00, // ........U.......
+ 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, // ................
+ 0xff, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xaa, 0x81, 0x03, 0x00, // ..X.............
+ 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ...........
};
static const uint8_t fs_nanovg_fill_dx11[2298] =
{
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
index 3fd944178d0..fc276ff32fd 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
@@ -128,6 +128,7 @@ namespace
uint64_t state;
bgfx::TextureHandle th;
+ bgfx::TextureHandle texMissing;
bgfx::TransientVertexBuffer tvb;
uint8_t viewid;
@@ -263,6 +264,11 @@ namespace
, true
);
+ const bgfx::Memory* mem = bgfx::alloc(4*4*4);
+ uint32_t* bgra8 = (uint32_t*)mem->data;
+ memset(bgra8, 0, 4*4*4);
+ gl->texMissing = bgfx::createTexture2D(4, 4, 0, bgfx::TextureFormat::BGRA8, 0, mem);
+
gl->u_scissorMat = bgfx::createUniform("u_scissorMat", bgfx::UniformType::Mat3);
gl->u_paintMat = bgfx::createUniform("u_paintMat", bgfx::UniformType::Mat3);
gl->u_innerCol = bgfx::createUniform("u_innerCol", bgfx::UniformType::Vec4);
@@ -323,9 +329,20 @@ namespace
, 1
, NVG_TEXTURE_RGBA == _type ? bgfx::TextureFormat::RGBA8 : bgfx::TextureFormat::R8
, BGFX_TEXTURE_NONE
- , mem
);
+ if (NULL != mem)
+ {
+ bgfx::updateTexture2D(tex->id
+ , 0
+ , 0
+ , 0
+ , tex->width
+ , tex->height
+ , mem
+ );
+ }
+
return bgfx::isValid(tex->id) ? tex->id.idx : 0;
}
@@ -347,7 +364,12 @@ namespace
uint32_t bytesPerPixel = NVG_TEXTURE_RGBA == tex->type ? 4 : 1;
uint32_t pitch = tex->width * bytesPerPixel;
- bgfx::updateTexture2D(tex->id, 0, x, y, w, h
+ bgfx::updateTexture2D(tex->id
+ , 0
+ , x
+ , y
+ , w
+ , h
, bgfx::copy(data + y*pitch + x*bytesPerPixel, h*pitch)
, pitch
);
@@ -444,8 +466,7 @@ namespace
memcpy(frag->extent, paint->extent, sizeof(frag->extent) );
frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe;
- bgfx::TextureHandle invalid = BGFX_INVALID_HANDLE;
- gl->th = invalid;
+ gl->th = gl->texMissing;
if (paint->image != 0)
{
tex = glnvg__findTexture(gl, paint->image);
@@ -460,7 +481,7 @@ namespace
else
{
frag->type = NSVG_SHADER_FILLGRAD;
- frag->radius = paint->radius;
+ frag->radius = paint->radius;
frag->feather = paint->feather;
}
@@ -502,7 +523,7 @@ namespace
bgfx::setUniform(gl->u_extentRadius, &frag->extent[0]);
bgfx::setUniform(gl->u_params, &frag->feather);
- bgfx::TextureHandle handle = BGFX_INVALID_HANDLE;
+ bgfx::TextureHandle handle = gl->texMissing;
if (image != 0)
{
@@ -976,6 +997,7 @@ namespace
}
bgfx::destroyProgram(gl->prog);
+ bgfx::destroyTexture(gl->texMissing);
bgfx::destroyUniform(gl->u_scissorMat);
bgfx::destroyUniform(gl->u_paintMat);
diff --git a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
index aeac0d14115..e744417898c 100644
--- a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
+++ b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
@@ -35,12 +35,12 @@ static const uint8_t vs_nanovg_fill_glsl[541] =
0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, // gl_Position = t
0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mpvar_1;.}...
};
-static const uint8_t vs_nanovg_fill_dx9[432] =
+static const uint8_t vs_nanovg_fill_dx9[436] =
{
0x56, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, 0x6c, // VSH........u_hal
0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, // fTexel.......u_v
- 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x80, 0x01, 0x00, // iewSize.........
- 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2a, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x72, // .....*.CTAB....r
+ 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x84, 0x01, 0x00, // iewSize.........
+ 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2b, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x72, // .....+.CTAB....r
0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................
0x91, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, // ...k...D........
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, // ...P.......`....
@@ -50,20 +50,21 @@ static const uint8_t vs_nanovg_fill_dx9[432] =
0x77, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // wSize.vs_3_0.Mic
0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
- 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, // 9.29.952.3111..Q
- 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..............?.
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, // ................
- 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, // ................
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................
- 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, // ................
- 0x00, 0x03, 0xe0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0xa0, 0x01, // ................
- 0x00, 0xe4, 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x02, // ................
- 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xd0, 0x90, 0x00, 0x00, 0xd0, 0x90, 0x04, // ................
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, // .........U......
- 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, // .............U..
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x00, 0x81, 0x02, // ................
- 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0xe0, 0x02, 0x00, 0x64, 0xa0, 0x01, // .U...........d..
- 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ................
+ 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, // 10.0.10011.16384
+ 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0xbf, 0x00, // ...Q............
+ 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, // ..?.............
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, // ................
+ 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, // ................
+ 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................
+ 0x00, 0x01, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x03, 0xe0, 0x01, // ................
+ 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, // ................
+ 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xd0, 0x90, 0x00, // ................
+ 0x00, 0xd0, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x55, 0x80, 0x00, // .............U..
+ 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, // ................
+ 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, 0xaa, 0x80, 0x00, // .U..............
+ 0x00, 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0xe0, 0x02, // .....U..........
+ 0x00, 0x64, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, // .d..............
+ 0xff, 0x00, 0x00, 0x00, // ....
};
static const uint8_t vs_nanovg_fill_dx11[577] =
{
diff --git a/3rdparty/bgfx/examples/common/shaderlib.sh b/3rdparty/bgfx/examples/common/shaderlib.sh
index da7bad784cb..a6a51199a1f 100644
--- a/3rdparty/bgfx/examples/common/shaderlib.sh
+++ b/3rdparty/bgfx/examples/common/shaderlib.sh
@@ -60,11 +60,11 @@ vec3 decodeNormalSphereMap(vec2 _encodedNormal)
return vec3(normalize(_encodedNormal.xy) * sqrt(1.0 - zz*zz), zz);
}
-// Reference:
-// Octahedron normal vector encoding
-// http://kriscg.blogspot.com/2014/04/octahedron-normal-vector-encoding.html
vec2 octahedronWrap(vec2 _val)
{
+ // Reference:
+ // Octahedron normal vector encoding
+ // http://kriscg.blogspot.com/2014/04/octahedron-normal-vector-encoding.html
return (1.0 - abs(_val.yx) )
* mix(vec2_splat(-1.0), vec2_splat(1.0), vec2(greaterThanEqual(_val.xy, vec2_splat(0.0) ) ) );
}
@@ -87,11 +87,11 @@ vec3 decodeNormalOctahedron(vec2 _encodedNormal)
return normalize(normal);
}
-// Reference:
-// RGB/XYZ Matrices
-// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
vec3 convertRGB2XYZ(vec3 _rgb)
{
+ // Reference:
+ // RGB/XYZ Matrices
+ // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
vec3 xyz;
xyz.x = dot(vec3(0.4124564, 0.3575761, 0.1804375), _rgb);
xyz.y = dot(vec3(0.2126729, 0.7151522, 0.0721750), _rgb);
@@ -246,6 +246,24 @@ vec4 toFilmic(vec4 _rgba)
return vec4(toFilmic(_rgba.xyz), _rgba.w);
}
+vec3 toAcesFilmic(vec3 _rgb)
+{
+ // Reference:
+ // ACES Filmic Tone Mapping Curve
+ // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
+ float aa = 2.51f;
+ float bb = 0.03f;
+ float cc = 2.43f;
+ float dd = 0.59f;
+ float ee = 0.14f;
+ return saturate( (_rgb*(aa*_rgb + bb) )/(_rgb*(cc*_rgb + dd) + ee) );
+}
+
+vec4 toAcesFilmic(vec4 _rgba)
+{
+ return vec4(toAcesFilmic(_rgba.xyz), _rgba.w);
+}
+
vec3 luma(vec3 _rgb)
{
float yy = dot(vec3(0.2126729, 0.7151522, 0.0721750), _rgb);
diff --git a/3rdparty/bgfx/examples/runtime/gamecontrollerdb.txt b/3rdparty/bgfx/examples/runtime/gamecontrollerdb.txt
index 9ad8778a00b..7c23f500c73 100644
--- a/3rdparty/bgfx/examples/runtime/gamecontrollerdb.txt
+++ b/3rdparty/bgfx/examples/runtime/gamecontrollerdb.txt
@@ -8,7 +8,6 @@ ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,
4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Windows,
25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows,
4c05c405000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
-xinput,X360 Controller,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows,
6d0418c2000000000000504944564944,Logitech RumblePad 2 USB,platform:Windows,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
36280100000000000000504944564944,OUYA Controller,platform:Windows,a:b0,b:b3,y:b2,x:b1,start:b14,guide:b15,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b8,dpleft:b10,dpdown:b9,dpright:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b12,righttrigger:b13,
4f0400b3000000000000504944564944,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Windows,
@@ -16,6 +15,18 @@ xinput,X360 Controller,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b
00f0f100000000000000504944564944,RetroUSB.com Super RetroPort,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Windows,
28040140000000000000504944564944,GamePad Pro USB,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,lefttrigger:b6,righttrigger:b7,
ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0,start:b5,back:b4,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b8,righttrigger:b9,
+8f0e0300000000000000504944564944,Piranha xtreme,platform:Windows,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
+8f0e0d31000000000000504944564944,Multilaser JS071 USB,platform:Windows,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
+10080300000000000000504944564944,PS2 USB,platform:Windows,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a4,righty:a2,lefttrigger:b4,righttrigger:b5,
+79000600000000000000504944564944,G-Shark GS-GP702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
+4b12014d000000000000504944564944,NYKO AIRFLO,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftstick:a0,rightstick:a2,leftshoulder:a3,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:h0.6,lefty:h0.12,rightx:h0.9,righty:h0.4,lefttrigger:b6,righttrigger:b7,platform:Windows,
+d6206dca000000000000504944564944,PowerA Pro Ex,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
+a3060cff000000000000504944564944,Saitek P2500,a:b2,b:b3,y:b1,x:b0,start:b4,guide:b10,back:b5,leftstick:b8,rightstick:b9,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Windows,
+8f0e0300000000000000504944564944,Trust GTX 28,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
+4f0415b3000000000000504944564944,Thrustmaster Dual Analog 3.2,platform:Windows,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
+6f0e1e01000000000000504944564944,Rock Candy Gamepad for PS3,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
+83056020000000000000504944564944,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,y:b2,x:b3,start:b7,back:b6,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Windows,
+10080100000000000000504944564944,PS1 USB,platform:Windows,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
# OS X
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
@@ -28,6 +39,13 @@ ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0
5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
891600000000000000fd000000000000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b8,guide:b10,back:b9,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b11,dpleft:b13,dpdown:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Mac OS X,
4f0400000000000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,platform:Mac OS X,
+8f0e0000000000000300000000000000,Piranha xtreme,platform:Mac OS X,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
+0d0f0000000000004d00000000000000,HORI Gem Pad 3,platform:Mac OS X,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
+79000000000000000600000000000000,G-Shark GP-702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
+4f0400000000000015b3000000000000,Thrustmaster Dual Analog 3.2,platform:Mac OS X,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
+AD1B00000000000001F9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
+050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,y:b9,x:b10,start:b6,guide:b8,back:b7,dpup:b2,dpleft:b0,dpdown:b3,dpright:b1,leftx:a0,lefty:a1,lefttrigger:b12,righttrigger:,leftshoulder:b11,platform:Mac OS X,
+83050000000000006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Mac OS X,
# Linux
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
@@ -39,6 +57,7 @@ ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0
030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
030000004c050000c405000011010000,Sony DualShock 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7,platform:Linux,
+030000006f0e00003001000001010000,EA Sports PS3 Controller,platform:Linux,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
@@ -73,3 +92,17 @@ ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0
03000000666600000488000000010000,Super Joy Box 5 Pro,platform:Linux,a:b2,b:b1,x:b3,y:b0,back:b9,start:b8,leftshoulder:b6,rightshoulder:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5,dpup:b12,dpleft:b15,dpdown:b14,dpright:b13,
05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,platform:Linux,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,
05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,platform:Linux,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,
+030000008916000001fd000024010000,Razer Onza Classic Edition,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:b11,dpdown:b14,dpright:b12,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
+030000005e040000d102000001010000,Microsoft X-Box One pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
+03000000790000001100000010010000,RetroLink Saturn Classic Controller,platform:Linux,x:b3,a:b0,b:b1,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,
+050000007e0500003003000001000000,Nintendo Wii U Pro Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,start:b9,guide:b10,leftshoulder:b4,rightshoulder:b5,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:b13,dpleft:b15,dpdown:b14,dpright:b16,
+030000005e0400008e02000004010000,Microsoft X-Box 360 pad,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
+030000000d0f00002200000011010000,HORI CO.,LTD. REAL ARCADE Pro.V3,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,
+030000000d0f00001000000011010000,HORI CO.,LTD. FIGHTING STICK 3,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7
+03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
+0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),platform:Linux,a:b0,b:b1,x:b2,y:b3,start:b7,back:b6,guide:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,lefttrigger:a5,righttrigger:a4,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a2,righty:a3,
+03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Linux,
+030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
+030000006f0e00001304000000010000,Generic X-Box pad,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:a0,rightstick:a3,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,
+03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,
+03000000830500006020000010010000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,platform:Linux,
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
index 0b6b5ca926c..e9ac1a71c49 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm.bin
index 91bf18c2ea8..e599c4ec016 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_csm.bin
index c928ae4e8f1..c2ac4161f46 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear.bin
index c97ca5675b0..acb5c01247e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 720d6b8dc55..3430e96d811 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index 9f95aece5c2..6c4859be087 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_omni.bin
index f925d7d809b..95467349adc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard.bin
index d4834651b14..d1612f8ca11 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_csm.bin
index c4eacfeab5f..f6b2ac6587d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear.bin
index 0d561a3cc8c..52ac4285db6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index 28db96648ca..221a4278dd8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index 871b1ffeeeb..03b37762125 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_omni.bin
index 245584b6255..11f1c23b014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf.bin
index 77396aed05d..19d9bba4d4a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_csm.bin
index 1ee9d986f8e..9581dddcd64 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.bin
index b45bb02343e..8746b286f44 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 74dbfb1da69..9957e3b8588 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index a46422934f3..3c72697a9d3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_omni.bin
index 7f9f9ea632d..834b235eebe 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm.bin
index 546505bb112..0ae83c419f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.bin
index 5b77da87cc3..87536cda4d4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.bin
index faad3b63666..5129fdb6b0b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index 4cdde93ea09..08a5970da44 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index 99228d720c5..39d3bff0226 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.bin
index 25fddf2151b..0991b66851f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
index 44fd0cfd999..bd64ce32deb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
index 071e3a6f3a4..5f675f24a27 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
index ba7432d9619..0f69b9b3764 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
index a074cd8a3e2..2cc6dbea34d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
index 57876856254..9dadf5e9261 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
index bdffeb9c076..5bfd5497f0b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
index cc13a509ba8..fc355b76371 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
index 4cac33773e7..33a85bb2955 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
index bdffeb9c076..5bfd5497f0b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
index c8cbf705ea2..f9f1020c1e6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
index 5c16613bad5..78cbbc32f25 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
index f426518b036..4d331a3cab1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
index 38c67736508..1670d6734f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
index f2be253e8b7..e5ca082614c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
index 0fe106a0adb..b73df0e1d7f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
index 7c2c50723bd..7553b3acc94 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
index 0598ce6cc4f..d02ad5de9e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
index f9c5bdf5f56..993845cb75b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
index 873b11cf560..3a3ecaba313 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
index a68ed6cf51d..2e49131b0a3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
index bdffeb9c076..5bfd5497f0b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
index 09e8453a1d6..ac5cc0d0512 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
index 38475da682f..05269c3a821 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
index b041df0bda7..29c0b1608bd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
index 6e7587839de..b209ea65d9d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
index 332cd07bc4a..4c5d7f1b374 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
index 082338cd294..ff4c6e01b17 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
index c52033f7e3b..c20337adffc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
index d3cd94464fb..64a2ea353d2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
index 1759b12105b..b48ca9a9d75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin
index d0c8760806a..99f5564ce4d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin
index 20951048b0c..420080db2fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin
index af417ecab7a..2b80ccad6c3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 4e7732f4fca..3bbfea99ae7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index cf1fc2e04a7..c9d81f6fa64 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin
index 292a4b08b79..308f93ef2e3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin
index 77938acdc89..3de4dcbce87 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin
index 975f1e5efed..c53e8814a34 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin
index 72026a33e4c..d29c6e8c1ed 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index 5617f4386b0..ca069354ca4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index 5cea5e1128a..c316724a908 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin
index d033bd26429..bef6549d95b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin
index 4ed6a979733..55bce42f02a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin
index 0a87a3d68dc..7427157c5fa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin
index c5c2fe28bd4..a8c173e3c39 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 695b9378a8d..984458101ee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index c226b1e4713..e96824aae10 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin
index cdc2cf41abb..bf00e8523f3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin
index d969966ce64..ac96c99da43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin
index 9ef4d3962f9..0e69a3950ac 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin
index 87e13f45af2..a1ce662b545 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index aeaa4e73b9e..80befb85a01 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index 8866fbbb2d6..f0bdfd66f7b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin
index bb19f6244d2..856c659ffe6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
index 3b34c1191f9..769c938165e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
index e9210b80d52..35f6b45a29d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
index 8eeb1b3e105..4a9dd81714e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
index 4a693345ca4..605ede3bb29 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
index 1c98ebebaa9..e73a81647e3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
index f146f09bfc0..227ada1b7b9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
index 89745b960ce..a83254c5e89 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
index 4cac33773e7..33a85bb2955 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
index b4f15210552..6fa413cd90c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
index f2b3c657c04..23cba5789f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
index e9210b80d52..35f6b45a29d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
index 8eeb1b3e105..4a9dd81714e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin
index d2b3c50f5ec..3502c300df9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
index 3b34c1191f9..769c938165e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
index f35fe6e1dfd..7528dcbf854 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
index 57089f27fe2..e240cc56e5f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
index 49110e0ed14..19ca642da9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
index 7752be6658d..e4fa04e2975 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
index b201b42a274..a3163370c84 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
index 57089f27fe2..e240cc56e5f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
index 49110e0ed14..19ca642da9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
index 7752be6658d..e4fa04e2975 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
index 4ba5d987404..29eab256097 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
index 95a432fd6e7..3b5a8f31a62 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
index 6e349468748..40f240d9f77 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
index a299cf2199c..fe9b49ff047 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
index 4cac33773e7..33a85bb2955 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin
index 216041c92be..1c09e0732be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
index 4ea4fa1d0b6..5e7db6345db 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
index 764e661c6e9..e244ed7a481 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
index 1759b12105b..b48ca9a9d75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
index 5c8c5a455f5..25b96b2653f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
index 1759b12105b..b48ca9a9d75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin
index 812a7288250..c11e9833063 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
index 3b34c1191f9..769c938165e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
index 4cac33773e7..33a85bb2955 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin
index 00b56862be3..c2d78611cd0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
index a40cefb711a..f2e470f0574 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
index 9b583ab3ef4..c67c50a41d1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
index abc86d23a09..d489147527a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
index 97e41b8eee1..77ee54087de 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
index 8793fcf84de..2ca54ab6730 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
index 905e8dd5d7a..f6316a80f0e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
index 8b22edabe2b..c3e8cd2f156 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
index ae10af6fa40..4c80f4cad6d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
index 19f743864cb..fc28518a841 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
index 5b24007c6dc..91c7a717fe5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
index 6bed4a49eb9..fcfb16e0d0d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
index 6bed4a49eb9..fcfb16e0d0d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
index ae10af6fa40..4c80f4cad6d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
index aafc58d61d7..db3143a6259 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
index f8a154140aa..7bafd238112 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
index c1734e3e3fc..56f1ecb2e44 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
index a4e8c3d11e9..4218e8ab377 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
index 92fb53dd59b..c0e84000a3a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
index 9cc463534d9..1334941f88a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
index 62f5bd31dae..242f27e7b1f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
index 0bd10c7a53f..9f612d35860 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
index fa1d3b9a442..d727140eef3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
index 63ec02a3531..9db127f1b78 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
index 4550c08d137..63a27d6a014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin
index 93a692801b5..afd241b6c2e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin
index 6b819879e75..5b190835b30 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin
index 3bc8a261ee5..4953a46cb26 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin
index 9e7c86f7bb1..3fe61829886 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin
index 2c6c09c36c8..fb516014651 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin
index 7a0105a308d..37de03aa63e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
index 4550c08d137..63a27d6a014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
index 17606423b6c..056267dd34d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
index 3e5827745c0..46332ef6918 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
index 329980ae388..0d28593e06a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin
index a04a6320173..96799c4e15d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
index 347b4ed021b..c2695fe4a16 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin
index f948ab9105f..305be162e1d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
index ff9efe36483..5875aa635d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
index 4550c08d137..63a27d6a014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
index 7571a1e53fa..2b3dd0ebae0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin
index e632b911c39..c97d58d5a67 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
index f5b0d896104..d33c32f16d0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
index 4550c08d137..63a27d6a014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
index 3bd185477f5..94b26f0a41d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
index 4550c08d137..63a27d6a014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin
index bedf096177e..0c0fe9fffee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
index a299604962c..fe8592c138d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin
index 7257af2e87f..fcdfc2e180c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
index 9e69b0bb4a4..71f4167608c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
index 1c043f0ad5c..155eea03f6c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
index 63ec02a3531..9db127f1b78 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
index e594526cf19..df53debb5b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
index 51ae8f2dbaf..2ae88a47fff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.bin
index 72ed5111aee..700694d399e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.bin
index 7c77f0cbbfe..525a27cdd51 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.bin
index 789141dcccc..04c38666671 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 3c1d07e15f6..27d8231f863 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index 1503d413ab3..4ca43066c34 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.bin
index f79e214b2da..4b3fea74139 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.bin
index c6f6593ea1e..7c5095f0e29 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.bin
index 74c0c1cf2a9..b77c2c824c4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.bin
index c0e05951bdd..3988caee216 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index 19062f01b8c..9a8ae99224e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index 6187725d9f2..1965c493afa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.bin
index 133e398538c..31b8e22ba35 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.bin
index 422bf35ec8e..c867113fd8c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.bin
index 9f78cbeee15..c78a27741db 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.bin
index 5ee79f73a28..85cebb56f07 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 4bb6fa06e51..93c5b80ef33 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index d0be094575a..4769169ac7f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.bin
index 44a131f69ad..18a43e1ea27 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.bin
index ccababe2e1b..f42d12496d6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.bin
index 74ff8b8dd26..50e5c4f14cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.bin
index 754e424ea12..3e96ec50a4c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index 53f2ea31f22..df85bd9510c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index 0b0a1bbbf16..2d63ad15e45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.bin
index ad331bd4ffd..772ec28f6ed 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
index c50ce9cc452..d8509532b15 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
index d6bdeb0b6c9..3997cd62a98 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
index c1c6b516290..a366ac46963 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
index db9d665275d..0fd472eda28 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
index c50ce9cc452..d8509532b15 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
index 227b76c4fa2..5844d74493e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
index d6bdeb0b6c9..384de3f5387 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
index 32f69e5aed2..1bfc2361d5c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
index d77b34792fa..f8ae5bc9b81 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.bin
index 4f66a07bb0f..f5a580f1289 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.bin
index 7249ac3fc01..1e7a4d25acd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.bin
index 57a0637840f..3c41f4ed3f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index daa9d7bc412..b930d047c81 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index 5213127e2b3..5b5e123eaec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.bin
index 0728fd38ac9..9e5441e5839 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.bin
index 40a6fe35f34..62a4fab7411 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.bin
index 27694944113..7ae79a1339c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.bin
index 68de56248ff..52a0b821316 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index e9d07c376e4..08808de87a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index eceb44fdf0f..3218ab5f3cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.bin
index d7893ba4369..0f8e094c7e9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.bin
index 3638832c180..797ec0bcdbe 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.bin
index 957f309bc5e..c649bf07a24 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.bin
index 03143cba754..5f0c1c7c365 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 202b3b76236..5b07162b001 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index 492e6e805b1..34d5c091ce2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.bin
index 81ea89086ae..53f13abd5c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.bin
index 46a9e14444f..3ba96599cd4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.bin
index 5af575e1be6..d1d4d641bdb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.bin
index 17290531064..5b675445db3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index 79058cad0d7..cbcecf1feb4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index 5915c930f4e..a2aeda4ead7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.bin
index 93b5a2a0bb2..fd9d3902609 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
index f8fa7a5d8b6..f1180dceb51 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
index 6148b430945..960eba1e085 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
index d59593b94a3..a592392cdd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
index 6602f5e43e0..acda8d5f64f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
index f8fa7a5d8b6..f1180dceb51 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
index 8e0fb26cd2b..a036a3a6254 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin
index 6148b430945..7286ee6bf99 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.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 ccec78ba002..4d4b4469ace 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/include/bgfx/bgfxdefines.h b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
index d0e4db91bce..3c1b3671a6b 100644
--- a/3rdparty/bgfx/include/bgfx/bgfxdefines.h
+++ b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
@@ -6,7 +6,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_API_VERSION UINT32_C(2)
+#define BGFX_API_VERSION UINT32_C(7)
///
#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write.
@@ -300,7 +300,7 @@
#define BGFX_TEXTURE_RT_MSAA_X16 UINT32_C(0x00005000) //!<
#define BGFX_TEXTURE_RT_MSAA_SHIFT 12 //!<
#define BGFX_TEXTURE_RT_MSAA_MASK UINT32_C(0x00007000) //!<
-#define BGFX_TEXTURE_RT_BUFFER_ONLY UINT32_C(0x00008000) //!<
+#define BGFX_TEXTURE_RT_WRITE_ONLY UINT32_C(0x00008000) //!<
#define BGFX_TEXTURE_RT_MASK UINT32_C(0x0000f000) //!<
#define BGFX_TEXTURE_COMPARE_LESS UINT32_C(0x00010000) //!<
#define BGFX_TEXTURE_COMPARE_LEQUAL UINT32_C(0x00020000) //!<
diff --git a/3rdparty/bgfx/include/bgfx/bgfxplatform.h b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
index b9107a26e39..1b6e336b675 100644
--- a/3rdparty/bgfx/include/bgfx/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
@@ -11,6 +11,7 @@
// necessary to use this header in conjunction with creating windows.
#include <bx/platform.h>
+#include <bgfx/bgfx.h>
namespace bgfx
{
@@ -45,10 +46,10 @@ namespace bgfx
///
struct PlatformData
{
- void* ndt; //!< Native display type
- void* nwh; //!< Native window handle
- void* context; //!< GL context, or D3D device
- void* backBuffer; //!< GL backbuffer, or D3D render target view
+ void* ndt; //!< Native display type.
+ void* nwh; //!< Native window handle.
+ void* context; //!< GL context, or D3D device.
+ void* backBuffer; //!< GL backbuffer, or D3D render target view.
void* backBufferDS; //!< Backbuffer depth/stencil.
};
@@ -58,7 +59,73 @@ namespace bgfx
///
/// @attention C99 equivalent is `bgfx_set_platform_data`.
///
- void setPlatformData(const PlatformData& _hooks);
+ void setPlatformData(const PlatformData& _data);
+
+ /// Internal data.
+ ///
+ /// @attention C99 equivalent is `bgfx_internal_data_t`.
+ ///
+ struct InternalData
+ {
+ const struct Caps* caps; //!< Renderer capabilities.
+ void* context; //!< GL context, or D3D device.
+ };
+
+ /// 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.
+ ///
+ /// @attention C99 equivalent is `bgfx_get_internal_data`.
+ ///
+ const InternalData* getInternalData();
+
+ /// 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.
+ ///
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _ptr Native API pointer to texture.
+ ///
+ /// @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.
+ ///
+ /// @attention C99 equivalent is `bgfx_override_internal_texture_ptr`.
+ ///
+ uintptr_t overrideInternal(TextureHandle _handle, uintptr_t _ptr);
+
+ /// 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.
+ ///
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _width Width.
+ /// @param[in] _height Height.
+ /// @param[in] _numMips Number of mip-maps.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _flags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
+ ///
+ /// @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.
+ ///
+ /// @attention C99 equivalent is `bgfx_override_internal_texture`.
+ ///
+ uintptr_t overrideInternal(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags = BGFX_TEXTURE_NONE);
} // namespace bgfx
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfx.h b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
index a3b31ee9ed3..fa585759ce9 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
@@ -40,7 +40,6 @@
#endif // defined(__cplusplus)
#include <bgfx/bgfxdefines.h>
-#include <bgfx/c99/bgfxplatform.h>
typedef enum bgfx_renderer_type
{
@@ -430,140 +429,6 @@ typedef struct bgfx_allocator_vtbl
} bgfx_allocator_vtbl_t;
/**/
-typedef struct bgfx_interface_vtbl
-{
- bgfx_render_frame_t (*render_frame)();
- void (*set_platform_data)(bgfx_platform_data_t* _pd);
- void (*vertex_decl_begin)(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer);
- void (*vertex_decl_add)(bgfx_vertex_decl_t* _decl, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
- void (*vertex_decl_skip)(bgfx_vertex_decl_t* _decl, uint8_t _num);
- void (*vertex_decl_end)(bgfx_vertex_decl_t* _decl);
- void (*vertex_pack)(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_decl_t* _decl, void* _data, uint32_t _index);
- void (*vertex_unpack)(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_decl_t* _decl, const void* _data, uint32_t _index);
- void (*vertex_convert)(const bgfx_vertex_decl_t* _destDecl, void* _destData, const bgfx_vertex_decl_t* _srcDecl, const void* _srcData, uint32_t _num);
- uint16_t (*weld_vertices)(uint16_t* _output, const bgfx_vertex_decl_t* _decl, const void* _data, uint16_t _num, float _epsilon);
- void (*image_swizzle_bgra8)(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
- void (*image_rgba8_downsample_2x2)(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
- uint8_t (*get_supported_renderers)(bgfx_renderer_type_t _enum[BGFX_RENDERER_TYPE_COUNT]);
- const char* (*get_renderer_name)(bgfx_renderer_type_t _type);
- bool (*init)(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_allocator_interface_t* _allocator);
- void (*shutdown)();
- void (*reset)(uint32_t _width, uint32_t _height, uint32_t _flags);
- uint32_t (*frame)();
- bgfx_renderer_type_t (*get_renderer_type)();
- const bgfx_caps_t* (*get_caps)();
- const bgfx_hmd_t* (*get_hmd)();
- const bgfx_stats_t* (*get_stats)();
- const bgfx_memory_t* (*alloc)(uint32_t _size);
- const bgfx_memory_t* (*copy)(const void* _data, uint32_t _size);
- const bgfx_memory_t* (*make_ref)(const void* _data, uint32_t _size);
- const bgfx_memory_t* (*make_ref_release)(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData);
- void (*set_debug)(uint32_t _debug);
- void (*dbg_text_clear)(uint8_t _attr, bool _small);
- void (*dbg_text_printf)(uint16_t _x, uint16_t _y, uint8_t _attr, const char* _format, ...);
- void (*dbg_text_image)(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const void* _data, uint16_t _pitch);
- bgfx_index_buffer_handle_t (*create_index_buffer)(const bgfx_memory_t* _mem, uint16_t _flags);
- void (*destroy_index_buffer)(bgfx_index_buffer_handle_t _handle);
- bgfx_vertex_buffer_handle_t (*create_vertex_buffer)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
- void (*destroy_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle);
- bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer)(uint32_t _num, uint16_t _flags);
- bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer_mem)(const bgfx_memory_t* _mem, uint16_t _flags);
- void (*update_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem);
- void (*destroy_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle);
- bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
- bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer_mem)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
- void (*update_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem);
- void (*destroy_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle);
- bool (*check_avail_transient_index_buffer)(uint32_t _num);
- bool (*check_avail_transient_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t* _decl);
- bool (*check_avail_instance_data_buffer)(uint32_t _num, uint16_t _stride);
- bool (*check_avail_transient_buffers)(uint32_t _numVertices, const bgfx_vertex_decl_t* _decl, uint32_t _numIndices);
- void (*alloc_transient_index_buffer)(bgfx_transient_index_buffer_t* _tib, uint32_t _num);
- void (*alloc_transient_vertex_buffer)(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_decl_t* _decl);
- bool (*alloc_transient_buffers)(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
- const bgfx_instance_data_buffer_t* (*alloc_instance_data_buffer)(uint32_t _num, uint16_t _stride);
- bgfx_indirect_buffer_handle_t (*create_indirect_buffer)(uint32_t _num);
- void (*destroy_indirect_buffer)(bgfx_indirect_buffer_handle_t _handle);
- bgfx_shader_handle_t (*create_shader)(const bgfx_memory_t* _mem);
- uint16_t (*get_shader_uniforms)(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, uint16_t _max);
- void (*destroy_shader)(bgfx_shader_handle_t _handle);
- bgfx_program_handle_t (*create_program)(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
- bgfx_program_handle_t (*create_compute_program)(bgfx_shader_handle_t _csh, bool _destroyShaders);
- void (*destroy_program)(bgfx_program_handle_t _handle);
- void (*calc_texture_size)(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format);
- bgfx_texture_handle_t (*create_texture)(const bgfx_memory_t* _mem, uint32_t _flags, uint8_t _skip, bgfx_texture_info_t* _info);
- bgfx_texture_handle_t (*create_texture_2d)(uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
- bgfx_texture_handle_t (*create_texture_2d_scaled)(bgfx_backbuffer_ratio_t _ratio, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags);
- bgfx_texture_handle_t (*create_texture_3d)(uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
- bgfx_texture_handle_t (*create_texture_cube)(uint16_t _size, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
- void (*update_texture_2d)(bgfx_texture_handle_t _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const bgfx_memory_t* _mem, uint16_t _pitch);
- void (*update_texture_3d)(bgfx_texture_handle_t _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _width, uint16_t _height, uint16_t _depth, const bgfx_memory_t* _mem);
- void (*update_texture_cube)(bgfx_texture_handle_t _handle, uint8_t _side, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const bgfx_memory_t* _mem, uint16_t _pitch);
- void (*destroy_texture)(bgfx_texture_handle_t _handle);
- bgfx_frame_buffer_handle_t (*create_frame_buffer)(uint16_t _width, uint16_t _height, bgfx_texture_format_t _format, uint32_t _textureFlags);
- bgfx_frame_buffer_handle_t (*create_frame_buffer_scaled)(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, uint32_t _textureFlags);
- bgfx_frame_buffer_handle_t (*create_frame_buffer_from_handles)(uint8_t _num, const bgfx_texture_handle_t* _handles, bool _destroyTextures);
- bgfx_frame_buffer_handle_t (*create_frame_buffer_from_nwh)(void* _nwh, uint16_t _width, uint16_t _height, bgfx_texture_format_t _depthFormat);
- void (*destroy_frame_buffer)(bgfx_frame_buffer_handle_t _handle);
- bgfx_uniform_handle_t (*create_uniform)(const char* _name, bgfx_uniform_type_t _type, uint16_t _num);
- void (*destroy_uniform)(bgfx_uniform_handle_t _handle);
- bgfx_occlusion_query_handle_t (*create_occlusion_query)();
- bgfx_occlusion_query_result_t (*get_result)(bgfx_occlusion_query_handle_t _handle);
- void (*destroy_occlusion_query)(bgfx_occlusion_query_handle_t _handle);
- void (*set_palette_color)(uint8_t _index, const float _rgba[4]);
- void (*set_view_name)(uint8_t _id, const char* _name);
- void (*set_view_rect)(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
- void (*set_view_scissor)(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
- void (*set_view_clear)(uint8_t _id, uint16_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil);
- void (*set_view_clear_mrt)(uint8_t _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);
- void (*set_view_seq)(uint8_t _id, bool _enabled);
- void (*set_view_frame_buffer)(uint8_t _id, bgfx_frame_buffer_handle_t _handle);
- void (*set_view_transform)(uint8_t _id, const void* _view, const void* _proj);
- void (*set_view_transform_stereo)(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR);
- void (*set_view_remap)(uint8_t _id, uint8_t _num, const void* _remap);
- void (*set_marker)(const char* _marker);
- void (*set_state)(uint64_t _state, uint32_t _rgba);
- void (*set_condition)(bgfx_occlusion_query_handle_t _handle, bool _visible);
- void (*set_stencil)(uint32_t _fstencil, uint32_t _bstencil);
- uint16_t (*set_scissor)(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
- void (*set_scissor_cached)(uint16_t _cache);
- uint32_t (*set_transform)(const void* _mtx, uint16_t _num);
- uint32_t (*alloc_transform)(bgfx_transform_t* _transform, uint16_t _num);
- void (*set_transform_cached)(uint32_t _cache, uint16_t _num);
- void (*set_uniform)(bgfx_uniform_handle_t _handle, const void* _value, uint16_t _num);
- void (*set_index_buffer)(bgfx_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
- void (*set_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
- void (*set_transient_index_buffer)(const bgfx_transient_index_buffer_t* _tib, uint32_t _firstIndex, uint32_t _numIndices);
- void (*set_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices);
- void (*set_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _numVertices);
- void (*set_transient_vertex_buffer)(const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices);
- void (*set_instance_data_buffer)(const bgfx_instance_data_buffer_t* _idb, uint32_t _num);
- void (*set_instance_data_from_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
- void (*set_instance_data_from_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
- void (*set_texture)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint32_t _flags);
- void (*set_texture_from_frame_buffer)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, uint32_t _flags);
- uint32_t (*touch)(uint8_t _id);
- uint32_t (*submit)(uint8_t _id, bgfx_program_handle_t _handle, int32_t _depth);
- uint32_t (*submit_occlusion_query)(uint8_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, int32_t _depth);
- uint32_t (*submit_indirect)(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth);
- void (*set_image)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
- void (*set_image_from_frame_buffer)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format);
- 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);
- void (*set_compute_dynamic_vertex_buffer)(uint8_t _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
- void (*set_compute_indirect_buffer)(uint8_t _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
- uint32_t (*dispatch)(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags);
- uint32_t (*dispatch_indirect)(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags);
- void (*discard)();
- void (*blit)(uint8_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_texture_handle_t _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth);
- void (*save_screen_shot)(const char* _filePath);
-
-} bgfx_interface_vtbl_t;
-
-typedef bgfx_interface_vtbl_t* (*PFN_BGFX_GET_INTERFACE)(uint32_t _version);
-
-/**/
BGFX_C_API void bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer);
/**/
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
index ff2125f18c4..1fb82c974f8 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
@@ -13,6 +13,7 @@
// necessary to use this header in conjunction with creating windows.
#include <bx/platform.h>
+#include <bgfx/c99/bgfxplatform.h>
typedef enum bgfx_render_frame
{
@@ -41,6 +42,160 @@ typedef struct bgfx_platform_data
} bgfx_platform_data_t;
-BGFX_C_API void bgfx_set_platform_data(bgfx_platform_data_t* _pd);
+/**/
+BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t* _data);
+
+typedef struct bgfx_internal_data
+{
+ const struct bgfx_caps* caps;
+ void* context;
+
+} bgfx_internal_data_t;
+
+/**/
+BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data();
+
+/**/
+BGFX_C_API uintptr_t bgfx_override_internal_texture_ptr(bgfx_texture_handle_t _handle, uintptr_t _ptr);
+
+/**/
+BGFX_C_API uintptr_t bgfx_override_internal_texture(bgfx_texture_handle_t _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags);
+
+/**/
+typedef struct bgfx_interface_vtbl
+{
+ bgfx_render_frame_t (*render_frame)();
+ void (*set_platform_data)(const bgfx_platform_data_t* _data);
+ const bgfx_internal_data_t* (*get_internal_data)();
+ uintptr_t (*override_internal_texture_ptr)(bgfx_texture_handle_t _handle, uintptr_t _ptr);
+ uintptr_t (*override_internal_texture)(bgfx_texture_handle_t _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags);
+ void (*vertex_decl_begin)(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer);
+ void (*vertex_decl_add)(bgfx_vertex_decl_t* _decl, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+ void (*vertex_decl_skip)(bgfx_vertex_decl_t* _decl, uint8_t _num);
+ void (*vertex_decl_end)(bgfx_vertex_decl_t* _decl);
+ void (*vertex_pack)(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_decl_t* _decl, void* _data, uint32_t _index);
+ void (*vertex_unpack)(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_decl_t* _decl, const void* _data, uint32_t _index);
+ void (*vertex_convert)(const bgfx_vertex_decl_t* _destDecl, void* _destData, const bgfx_vertex_decl_t* _srcDecl, const void* _srcData, uint32_t _num);
+ uint16_t (*weld_vertices)(uint16_t* _output, const bgfx_vertex_decl_t* _decl, const void* _data, uint16_t _num, float _epsilon);
+ void (*image_swizzle_bgra8)(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
+ void (*image_rgba8_downsample_2x2)(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
+ uint8_t (*get_supported_renderers)(bgfx_renderer_type_t _enum[BGFX_RENDERER_TYPE_COUNT]);
+ const char* (*get_renderer_name)(bgfx_renderer_type_t _type);
+ bool (*init)(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_allocator_interface_t* _allocator);
+ void (*shutdown)();
+ void (*reset)(uint32_t _width, uint32_t _height, uint32_t _flags);
+ uint32_t (*frame)();
+ bgfx_renderer_type_t (*get_renderer_type)();
+ const bgfx_caps_t* (*get_caps)();
+ const bgfx_hmd_t* (*get_hmd)();
+ const bgfx_stats_t* (*get_stats)();
+ const bgfx_memory_t* (*alloc)(uint32_t _size);
+ const bgfx_memory_t* (*copy)(const void* _data, uint32_t _size);
+ const bgfx_memory_t* (*make_ref)(const void* _data, uint32_t _size);
+ const bgfx_memory_t* (*make_ref_release)(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData);
+ void (*set_debug)(uint32_t _debug);
+ void (*dbg_text_clear)(uint8_t _attr, bool _small);
+ void (*dbg_text_printf)(uint16_t _x, uint16_t _y, uint8_t _attr, const char* _format, ...);
+ void (*dbg_text_image)(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const void* _data, uint16_t _pitch);
+ bgfx_index_buffer_handle_t (*create_index_buffer)(const bgfx_memory_t* _mem, uint16_t _flags);
+ void (*destroy_index_buffer)(bgfx_index_buffer_handle_t _handle);
+ bgfx_vertex_buffer_handle_t (*create_vertex_buffer)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+ void (*destroy_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle);
+ bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer)(uint32_t _num, uint16_t _flags);
+ bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer_mem)(const bgfx_memory_t* _mem, uint16_t _flags);
+ void (*update_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem);
+ void (*destroy_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle);
+ bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+ bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer_mem)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+ void (*update_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem);
+ void (*destroy_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle);
+ bool (*check_avail_transient_index_buffer)(uint32_t _num);
+ bool (*check_avail_transient_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t* _decl);
+ bool (*check_avail_instance_data_buffer)(uint32_t _num, uint16_t _stride);
+ bool (*check_avail_transient_buffers)(uint32_t _numVertices, const bgfx_vertex_decl_t* _decl, uint32_t _numIndices);
+ void (*alloc_transient_index_buffer)(bgfx_transient_index_buffer_t* _tib, uint32_t _num);
+ void (*alloc_transient_vertex_buffer)(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_decl_t* _decl);
+ bool (*alloc_transient_buffers)(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
+ const bgfx_instance_data_buffer_t* (*alloc_instance_data_buffer)(uint32_t _num, uint16_t _stride);
+ bgfx_indirect_buffer_handle_t (*create_indirect_buffer)(uint32_t _num);
+ void (*destroy_indirect_buffer)(bgfx_indirect_buffer_handle_t _handle);
+ bgfx_shader_handle_t (*create_shader)(const bgfx_memory_t* _mem);
+ uint16_t (*get_shader_uniforms)(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, uint16_t _max);
+ void (*destroy_shader)(bgfx_shader_handle_t _handle);
+ bgfx_program_handle_t (*create_program)(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
+ bgfx_program_handle_t (*create_compute_program)(bgfx_shader_handle_t _csh, bool _destroyShaders);
+ void (*destroy_program)(bgfx_program_handle_t _handle);
+ void (*calc_texture_size)(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format);
+ bgfx_texture_handle_t (*create_texture)(const bgfx_memory_t* _mem, uint32_t _flags, uint8_t _skip, bgfx_texture_info_t* _info);
+ bgfx_texture_handle_t (*create_texture_2d)(uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
+ bgfx_texture_handle_t (*create_texture_2d_scaled)(bgfx_backbuffer_ratio_t _ratio, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags);
+ bgfx_texture_handle_t (*create_texture_3d)(uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
+ bgfx_texture_handle_t (*create_texture_cube)(uint16_t _size, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags, const bgfx_memory_t* _mem);
+ void (*update_texture_2d)(bgfx_texture_handle_t _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const bgfx_memory_t* _mem, uint16_t _pitch);
+ void (*update_texture_3d)(bgfx_texture_handle_t _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _width, uint16_t _height, uint16_t _depth, const bgfx_memory_t* _mem);
+ void (*update_texture_cube)(bgfx_texture_handle_t _handle, uint8_t _side, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const bgfx_memory_t* _mem, uint16_t _pitch);
+ void (*destroy_texture)(bgfx_texture_handle_t _handle);
+ bgfx_frame_buffer_handle_t (*create_frame_buffer)(uint16_t _width, uint16_t _height, bgfx_texture_format_t _format, uint32_t _textureFlags);
+ bgfx_frame_buffer_handle_t (*create_frame_buffer_scaled)(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, uint32_t _textureFlags);
+ bgfx_frame_buffer_handle_t (*create_frame_buffer_from_handles)(uint8_t _num, const bgfx_texture_handle_t* _handles, bool _destroyTextures);
+ bgfx_frame_buffer_handle_t (*create_frame_buffer_from_nwh)(void* _nwh, uint16_t _width, uint16_t _height, bgfx_texture_format_t _depthFormat);
+ void (*destroy_frame_buffer)(bgfx_frame_buffer_handle_t _handle);
+ bgfx_uniform_handle_t (*create_uniform)(const char* _name, bgfx_uniform_type_t _type, uint16_t _num);
+ void (*destroy_uniform)(bgfx_uniform_handle_t _handle);
+ bgfx_occlusion_query_handle_t (*create_occlusion_query)();
+ bgfx_occlusion_query_result_t (*get_result)(bgfx_occlusion_query_handle_t _handle);
+ void (*destroy_occlusion_query)(bgfx_occlusion_query_handle_t _handle);
+ void (*set_palette_color)(uint8_t _index, const float _rgba[4]);
+ void (*set_view_name)(uint8_t _id, const char* _name);
+ void (*set_view_rect)(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
+ void (*set_view_scissor)(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
+ void (*set_view_clear)(uint8_t _id, uint16_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil);
+ void (*set_view_clear_mrt)(uint8_t _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);
+ void (*set_view_seq)(uint8_t _id, bool _enabled);
+ void (*set_view_frame_buffer)(uint8_t _id, bgfx_frame_buffer_handle_t _handle);
+ void (*set_view_transform)(uint8_t _id, const void* _view, const void* _proj);
+ void (*set_view_transform_stereo)(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR);
+ void (*set_view_remap)(uint8_t _id, uint8_t _num, const void* _remap);
+ void (*set_marker)(const char* _marker);
+ void (*set_state)(uint64_t _state, uint32_t _rgba);
+ void (*set_condition)(bgfx_occlusion_query_handle_t _handle, bool _visible);
+ void (*set_stencil)(uint32_t _fstencil, uint32_t _bstencil);
+ uint16_t (*set_scissor)(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
+ void (*set_scissor_cached)(uint16_t _cache);
+ uint32_t (*set_transform)(const void* _mtx, uint16_t _num);
+ uint32_t (*alloc_transform)(bgfx_transform_t* _transform, uint16_t _num);
+ void (*set_transform_cached)(uint32_t _cache, uint16_t _num);
+ void (*set_uniform)(bgfx_uniform_handle_t _handle, const void* _value, uint16_t _num);
+ void (*set_index_buffer)(bgfx_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
+ void (*set_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
+ void (*set_transient_index_buffer)(const bgfx_transient_index_buffer_t* _tib, uint32_t _firstIndex, uint32_t _numIndices);
+ void (*set_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices);
+ void (*set_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _numVertices);
+ void (*set_transient_vertex_buffer)(const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices);
+ void (*set_instance_data_buffer)(const bgfx_instance_data_buffer_t* _idb, uint32_t _num);
+ void (*set_instance_data_from_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
+ void (*set_instance_data_from_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
+ void (*set_texture)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint32_t _flags);
+ void (*set_texture_from_frame_buffer)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, uint32_t _flags);
+ uint32_t (*touch)(uint8_t _id);
+ uint32_t (*submit)(uint8_t _id, bgfx_program_handle_t _handle, int32_t _depth);
+ uint32_t (*submit_occlusion_query)(uint8_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, int32_t _depth);
+ uint32_t (*submit_indirect)(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth);
+ void (*set_image)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ void (*set_image_from_frame_buffer)(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format);
+ 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);
+ void (*set_compute_dynamic_vertex_buffer)(uint8_t _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ void (*set_compute_indirect_buffer)(uint8_t _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ uint32_t (*dispatch)(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags);
+ uint32_t (*dispatch_indirect)(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags);
+ void (*discard)();
+ void (*blit)(uint8_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_texture_handle_t _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth);
+ void (*save_screen_shot)(const char* _filePath);
+
+} bgfx_interface_vtbl_t;
+
+typedef bgfx_interface_vtbl_t* (*PFN_BGFX_GET_INTERFACE)(uint32_t _version);
#endif // BGFX_PLATFORM_C99_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/makefile b/3rdparty/bgfx/makefile
index f583e7891db..afa61759a85 100644
--- a/3rdparty/bgfx/makefile
+++ b/3rdparty/bgfx/makefile
@@ -20,7 +20,8 @@ endif
# $(info $(OS))
-GENIE=../bx/tools/bin/$(OS)/genie $(GENIE_FLAGS)
+BX_DIR?=../bx
+GENIE?=$(BX_DIR)/tools/bin/$(OS)/genie
all:
$(GENIE) --with-tools --with-shared-lib vs2008
@@ -214,6 +215,14 @@ rpi-release: .build/projects/gmake-rpi
$(MAKE) -R -C .build/projects/gmake-rpi config=release
rpi: rpi-debug rpi-release
+build-darwin: osx
+
+build-linux: linux-debug64 linux-release64
+
+build-windows: mingw-gcc
+
+build: build-$(OS)
+
rebuild-shaders:
$(MAKE) -R -C examples rebuild
@@ -268,16 +277,16 @@ BUILD_TOOLS_SUFFIX=Release
EXE=.exe
endif
-tools/bin/$(OS)/shaderc$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
- $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f shaderc.make config=$(BUILD_TOOLS_CONFIG)
- $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/shaderc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
-
-tools/bin/$(OS)/geometryc$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
+geometryc: .build/projects/$(BUILD_PROJECT_DIR)
$(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f geometryc.make config=$(BUILD_TOOLS_CONFIG)
- $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/geometryc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
+ $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/geometryc$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/geometryc$(EXE)
+
+shaderc: .build/projects/$(BUILD_PROJECT_DIR)
+ $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f shaderc.make config=$(BUILD_TOOLS_CONFIG)
+ $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/shaderc$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/shaderc$(EXE)
-tools/bin/$(OS)/texturec$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
+texturec: .build/projects/$(BUILD_PROJECT_DIR)
$(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f texturec.make config=$(BUILD_TOOLS_CONFIG)
- $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/texturec$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
+ $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/texturec$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/texturec$(EXE)
-tools: tools/bin/$(OS)/shaderc$(EXE) tools/bin/$(OS)/geometryc$(EXE) tools/bin/$(OS)/texturec$(EXE)
+tools: geometryc shaderc texturec
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index ce2effb0f88..cc646b6e261 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -36,7 +36,7 @@ function bgfxProject(_name, _kind, _defines)
includedirs {
path.join(BGFX_DIR, "3rdparty"),
path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
- path.join(BGFX_DIR, "../bx/include"),
+ path.join(BX_DIR, "include"),
}
defines {
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 0696469ca1c..77fe35d4cb6 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -66,9 +66,13 @@ solution "bgfx"
startproject "example-00-helloworld"
BGFX_DIR = path.getabsolute("..")
+BX_DIR = os.getenv("BX_DIR")
+
local BGFX_BUILD_DIR = path.join(BGFX_DIR, ".build")
local BGFX_THIRD_PARTY_DIR = path.join(BGFX_DIR, "3rdparty")
-BX_DIR = path.getabsolute(path.join(BGFX_DIR, "../bx"))
+if not BX_DIR then
+ BX_DIR = path.getabsolute(path.join(BGFX_DIR, "../bx"))
+end
if not os.isdir(BX_DIR) then
print("bx not found at " .. BX_DIR)
@@ -140,20 +144,15 @@ function exampleProject(_name)
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
- configuration { "x32", "windows" }
- libdirs { "$(SDL2_DIR)/lib/x86" }
-
- configuration { "x64", "windows" }
- libdirs { "$(SDL2_DIR)/lib/x64" }
+ configuration { "osx" }
+ libdirs { "$(SDL2_DIR)/lib" }
configuration {}
end
if _OPTIONS["with-glfw"] then
defines { "ENTRY_CONFIG_USE_GLFW=1" }
- links {
- "glfw3"
- }
+ links { "glfw3" }
configuration { "linux or freebsd" }
links {
@@ -415,7 +414,6 @@ end
if _OPTIONS["with-tools"] then
group "tools"
- dofile "makedisttex.lua"
dofile "shaderc.lua"
dofile "texturec.lua"
dofile "geometryc.lua"
diff --git a/3rdparty/bgfx/scripts/makedisttex.lua b/3rdparty/bgfx/scripts/makedisttex.lua
deleted file mode 100644
index 01705a08262..00000000000
--- a/3rdparty/bgfx/scripts/makedisttex.lua
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- Copyright 2010-2016 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
---
-
-project "makedisttex"
- uuid "b0561b30-91bb-11e1-b06e-023ad46e7d26"
- kind "ConsoleApp"
-
- includedirs {
- path.join(BX_DIR, "include"),
- path.join(BGFX_DIR, "3rdparty"),
- }
-
- files {
- path.join(BGFX_DIR, "3rdparty/edtaa3/**.cpp"),
- path.join(BGFX_DIR, "3rdparty/edtaa3/**.h"),
- path.join(BGFX_DIR, "tools/makedisttex.cpp"),
- }
diff --git a/3rdparty/bgfx/scripts/shader.mk b/3rdparty/bgfx/scripts/shader.mk
index 002b7564b3e..d7e0e151597 100644
--- a/3rdparty/bgfx/scripts/shader.mk
+++ b/3rdparty/bgfx/scripts/shader.mk
@@ -6,6 +6,11 @@
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(THISDIR)/tools.mk
+# Define SHADERS_DIR if your shader files are in a different dir than the makefile including this.
+# Notice: If defined, SHADERS_DIR should end with dir slash '/'.
+# Example:
+# SHADERS_DIR=shader_files/
+
ifndef TARGET
.PHONY: all
all:
@@ -67,18 +72,18 @@ CS_FLAGS+=-i $(THISDIR)../src/
BUILD_OUTPUT_DIR=$(addprefix ./, $(RUNTIME_DIR)/$(SHADER_PATH))
BUILD_INTERMEDIATE_DIR=$(addprefix $(BUILD_DIR)/, $(SHADER_PATH))
-VS_SOURCES=$(wildcard vs_*.sc)
-VS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(VS_SOURCES))))
+VS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), vs_*.sc)))
+VS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(VS_SOURCES)))))
-FS_SOURCES=$(wildcard fs_*.sc)
-FS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(FS_SOURCES))))
+FS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), fs_*.sc)))
+FS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(FS_SOURCES)))))
-CS_SOURCES=$(wildcard cs_*.sc)
-CS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(CS_SOURCES))))
+CS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), cs_*.sc)))
+CS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(CS_SOURCES)))))
-VS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(VS_SOURCES))))
-FS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(FS_SOURCES))))
-CS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(CS_SOURCES))))
+VS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(VS_SOURCES)))))
+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)
ASM = $(VS_ASM) $(FS_ASM)
@@ -98,17 +103,17 @@ endif
endif
endif
-$(BUILD_INTERMEDIATE_DIR)/vs_%.bin : vs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/vs_%.bin : $(SHADERS_DIR)vs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(VS_FLAGS) --type vertex --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
-$(BUILD_INTERMEDIATE_DIR)/fs_%.bin : fs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/fs_%.bin : $(SHADERS_DIR)fs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(FS_FLAGS) --type fragment --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
-$(BUILD_INTERMEDIATE_DIR)/cs_%.bin : cs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/cs_%.bin : $(SHADERS_DIR)cs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(CS_FLAGS) --type compute --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
diff --git a/3rdparty/bgfx/scripts/shaderc.lua b/3rdparty/bgfx/scripts/shaderc.lua
index b2a5b5c54a0..4c09f847745 100644
--- a/3rdparty/bgfx/scripts/shaderc.lua
+++ b/3rdparty/bgfx/scripts/shaderc.lua
@@ -55,11 +55,6 @@ project "shaderc"
path.join(GLSL_OPTIMIZER, "include/c99"),
}
- configuration { "vs* or mingw*" }
- links {
- "d3dcompiler",
- }
-
configuration {}
defines { -- fcpp
@@ -73,6 +68,7 @@ project "shaderc"
path.join(BX_DIR, "include"),
path.join(BGFX_DIR, "include"),
+ path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
FCPP_DIR,
path.join(GLSL_OPTIMIZER, "include"),
diff --git a/3rdparty/bgfx/scripts/texturec.lua b/3rdparty/bgfx/scripts/texturec.lua
index 8b9beed609e..dac357b6b86 100644
--- a/3rdparty/bgfx/scripts/texturec.lua
+++ b/3rdparty/bgfx/scripts/texturec.lua
@@ -19,8 +19,12 @@ project "texturec"
path.join(BGFX_DIR, "src/image.*"),
path.join(BGFX_DIR, "3rdparty/libsquish/**.cpp"),
path.join(BGFX_DIR, "3rdparty/libsquish/**.h"),
+ path.join(BGFX_DIR, "3rdparty/edtaa3/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/edtaa3/**.h"),
path.join(BGFX_DIR, "3rdparty/etc1/**.cpp"),
path.join(BGFX_DIR, "3rdparty/etc1/**.h"),
+ path.join(BGFX_DIR, "3rdparty/etc2/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/etc2/**.hpp"),
path.join(BGFX_DIR, "3rdparty/nvtt/**.cpp"),
path.join(BGFX_DIR, "3rdparty/nvtt/**.h"),
path.join(BGFX_DIR, "3rdparty/pvrtc/**.cpp"),
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index a6882850ba9..aae0311ebd5 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -112,10 +112,10 @@ namespace bgfx
strcat(filePath, ".tga");
bx::CrtFileWriter writer;
- if (0 == writer.open(filePath) )
+ if (bx::open(&writer, filePath) )
{
imageWriteTga(&writer, _width, _height, _pitch, _data, false, _yflip);
- writer.close();
+ bx::close(&writer);
}
#endif // BX_CONFIG_CRT_FILE_READER_WRITER
}
@@ -277,6 +277,7 @@ namespace bgfx
static Context* s_ctx = NULL;
static bool s_renderFrameCalled = false;
+ InternalData g_internalData;
PlatformData g_platformData;
void AllocatorStub::checkLeaks()
@@ -292,19 +293,75 @@ namespace bgfx
#endif // BGFX_CONFIG_MEMORY_TRACKING
}
- void setPlatformData(const PlatformData& _pd)
+ void setPlatformData(const PlatformData& _data)
{
if (NULL != s_ctx)
{
BGFX_FATAL(true
- && g_platformData.ndt == _pd.ndt
- && g_platformData.nwh == _pd.nwh
- && g_platformData.context == _pd.context
+ && g_platformData.ndt == _data.ndt
+ && g_platformData.nwh == _data.nwh
+ && g_platformData.context == _data.context
, Fatal::UnableToInitialize
, "Only backbuffer pointer can be changed after initialization!"
);
}
- memcpy(&g_platformData, &_pd, sizeof(PlatformData) );
+ memcpy(&g_platformData, &_data, sizeof(PlatformData) );
+ }
+
+ const InternalData* getInternalData()
+ {
+ BGFX_CHECK_RENDER_THREAD();
+ return &g_internalData;
+ }
+
+ uintptr_t overrideInternal(TextureHandle _handle, uintptr_t _ptr)
+ {
+ BGFX_CHECK_RENDER_THREAD();
+ RendererContextI* rci = s_ctx->m_renderCtx;
+ if (0 == rci->getInternal(_handle) )
+ {
+ return 0;
+ }
+
+ rci->overrideInternal(_handle, _ptr);
+
+ return rci->getInternal(_handle);
+ }
+
+ uintptr_t overrideInternal(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags)
+ {
+ BGFX_CHECK_RENDER_THREAD();
+ RendererContextI* rci = s_ctx->m_renderCtx;
+ if (0 == rci->getInternal(_handle) )
+ {
+ return 0;
+ }
+
+ uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate);
+ Memory* mem = const_cast<Memory*>(alloc(size) );
+
+ bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
+ uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
+ bx::write(&writer, magic);
+
+ TextureCreate tc;
+ tc.m_flags = _flags;
+ tc.m_width = _width;
+ tc.m_height = _height;
+ tc.m_sides = 0;
+ tc.m_depth = 0;
+ tc.m_numMips = uint8_t(bx::uint16_max(1, _numMips) );
+ tc.m_format = _format;
+ tc.m_cubeMap = false;
+ tc.m_mem = NULL;
+ bx::write(&writer, tc);
+
+ rci->destroyTexture(_handle);
+ rci->createTexture(_handle, mem, _flags, 0);
+
+ release(mem);
+
+ return rci->getInternal(_handle);
}
void setGraphicsDebuggerPresent(bool _present)
@@ -1026,6 +1083,15 @@ namespace bgfx
static void dumpCaps()
{
+ BX_TRACE("Sort key masks:");
+ BX_TRACE("\t View %016" PRIx64, SORT_KEY_VIEW_MASK);
+ BX_TRACE("\t Draw bit %016" PRIx64, SORT_KEY_DRAW_BIT);
+ BX_TRACE("\t Seq %016" PRIx64, SORT_KEY_SEQ_MASK);
+ BX_TRACE("\tD Trans %016" PRIx64, SORT_KEY_DRAW_TRANS_MASK);
+ BX_TRACE("\tD Program %016" PRIx64, SORT_KEY_DRAW_PROGRAM_MASK);
+ BX_TRACE("\tC Program %016" PRIx64, SORT_KEY_COMPUTE_PROGRAM_MASK);
+ BX_TRACE("\tD Depth %016" PRIx64, SORT_KEY_DRAW_DEPTH_MASK);
+
BX_TRACE("Supported capabilities (renderer %s, vendor 0x%04x, device 0x%04x):"
, s_ctx->m_renderCtx->getRendererName()
, g_caps.vendorId
@@ -1217,6 +1283,8 @@ namespace bgfx
frame();
}
+ g_internalData.caps = getCaps();
+
return true;
}
@@ -1263,6 +1331,7 @@ namespace bgfx
m_render->destroy();
#endif // BGFX_CONFIG_MULTITHREADED
+ memset(&g_internalData, 0, sizeof(InternalData) );
s_ctx = NULL;
m_submit->destroy();
@@ -2825,13 +2894,6 @@ again:
);
}
- uint32_t size = sizeof(uint32_t)+sizeof(TextureCreate);
- const Memory* mem = alloc(size);
-
- bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
- uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
-
if (BackbufferRatio::Count != _ratio)
{
_width = uint16_t(s_ctx->m_resolution.m_width);
@@ -2839,6 +2901,13 @@ again:
getTextureSizeFromRatio(_ratio, _width, _height);
}
+ uint32_t size = sizeof(uint32_t)+sizeof(TextureCreate);
+ const Memory* mem = alloc(size);
+
+ bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
+ uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
+ bx::write(&writer, magic);
+
TextureCreate tc;
tc.m_flags = _flags;
tc.m_width = _width;
@@ -2846,7 +2915,7 @@ again:
tc.m_sides = 0;
tc.m_depth = 0;
tc.m_numMips = _numMips;
- tc.m_format = uint8_t(_format);
+ tc.m_format = _format;
tc.m_cubeMap = false;
tc.m_mem = _mem;
bx::write(&writer, tc);
@@ -2897,15 +2966,15 @@ again:
bx::write(&writer, magic);
TextureCreate tc;
- tc.m_flags = _flags;
- tc.m_width = _width;
- tc.m_height = _height;
- tc.m_sides = 0;
- tc.m_depth = _depth;
+ tc.m_flags = _flags;
+ tc.m_width = _width;
+ tc.m_height = _height;
+ tc.m_sides = 0;
+ tc.m_depth = _depth;
tc.m_numMips = _numMips;
- tc.m_format = uint8_t(_format);
+ tc.m_format = _format;
tc.m_cubeMap = false;
- tc.m_mem = _mem;
+ tc.m_mem = _mem;
bx::write(&writer, tc);
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count);
@@ -2947,7 +3016,7 @@ again:
tc.m_sides = 6;
tc.m_depth = 0;
tc.m_numMips = _numMips;
- tc.m_format = uint8_t(_format);
+ tc.m_format = _format;
tc.m_cubeMap = true;
tc.m_mem = _mem;
bx::write(&writer, tc);
@@ -3488,6 +3557,32 @@ again:
#include <bgfx/c99/bgfx.h>
#include <bgfx/c99/bgfxplatform.h>
+#define FLAGS_MASK_TEST(_flags, _mask) ( (_flags) == ( (_flags) & (_mask) ) )
+
+BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
+ | BGFX_TEXTURE_INTERNAL_DEFAULT_SAMPLER
+ | BGFX_TEXTURE_INTERNAL_SHARED
+ , BGFX_TEXTURE_RESERVED_MASK
+ ) );
+
+BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
+ | BGFX_RESET_INTERNAL_FORCE
+ , BGFX_RESET_RESERVED_MASK
+ ) );
+
+BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
+ | BGFX_STATE_INTERNAL_SCISSOR
+ | BGFX_STATE_INTERNAL_OCCLUSION_QUERY
+ , BGFX_STATE_RESERVED_MASK
+ ) );
+
+BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
+ | BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE
+ , BGFX_SUBMIT_RESERVED_MASK
+ ) );
+
+#undef FLAGS_MASK_TEST
+
BX_STATIC_ASSERT(bgfx::Fatal::Count == bgfx::Fatal::Enum(BGFX_FATAL_COUNT) );
BX_STATIC_ASSERT(bgfx::RendererType::Count == bgfx::RendererType::Enum(BGFX_RENDERER_TYPE_COUNT) );
BX_STATIC_ASSERT(bgfx::Attrib::Count == bgfx::Attrib::Enum(BGFX_ATTRIB_COUNT) );
@@ -3504,6 +3599,7 @@ BX_STATIC_ASSERT(sizeof(bgfx::InstanceDataBuffer) == sizeof(bgfx_instance_dat
BX_STATIC_ASSERT(sizeof(bgfx::TextureInfo) == sizeof(bgfx_texture_info_t) );
BX_STATIC_ASSERT(sizeof(bgfx::Caps) == sizeof(bgfx_caps_t) );
BX_STATIC_ASSERT(sizeof(bgfx::PlatformData) == sizeof(bgfx_platform_data_t) );
+BX_STATIC_ASSERT(sizeof(bgfx::InternalData) == sizeof(bgfx_internal_data_t) );
namespace bgfx
{
@@ -4364,9 +4460,26 @@ BGFX_C_API bgfx_render_frame_t bgfx_render_frame()
return bgfx_render_frame_t(bgfx::renderFrame() );
}
-BGFX_C_API void bgfx_set_platform_data(bgfx_platform_data_t* _pd)
+BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t* _data)
+{
+ bgfx::setPlatformData(*(const bgfx::PlatformData*)_data);
+}
+
+BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data()
{
- bgfx::setPlatformData(*(bgfx::PlatformData*)_pd);
+ return (const bgfx_internal_data_t*)bgfx::getInternalData();
+}
+
+BGFX_C_API uintptr_t bgfx_override_internal_texture_ptr(bgfx_texture_handle_t _handle, uintptr_t _ptr)
+{
+ union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
+ return bgfx::overrideInternal(handle.cpp, _ptr);
+}
+
+BGFX_C_API uintptr_t bgfx_override_internal_texture(bgfx_texture_handle_t _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint32_t _flags)
+{
+ union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
+ return bgfx::overrideInternal(handle.cpp, _width, _height, _numMips, bgfx::TextureFormat::Enum(_format), _flags);
}
BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
@@ -4376,6 +4489,9 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
#define BGFX_IMPORT \
BGFX_IMPORT_FUNC(render_frame) \
BGFX_IMPORT_FUNC(set_platform_data) \
+ BGFX_IMPORT_FUNC(get_internal_data) \
+ BGFX_IMPORT_FUNC(override_internal_texture_ptr) \
+ BGFX_IMPORT_FUNC(override_internal_texture) \
BGFX_IMPORT_FUNC(vertex_decl_begin) \
BGFX_IMPORT_FUNC(vertex_decl_add) \
BGFX_IMPORT_FUNC(vertex_decl_skip) \
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index fc13eeb06b7..9e4e5a17184 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -201,6 +201,7 @@ namespace stl
#define BGFX_MAX_COMPUTE_BINDINGS 8
#define BGFX_TEXTURE_INTERNAL_DEFAULT_SAMPLER UINT32_C(0x10000000)
+#define BGFX_TEXTURE_INTERNAL_SHARED UINT32_C(0x20000000)
#define BGFX_RESET_INTERNAL_FORCE UINT32_C(0x80000000)
@@ -212,9 +213,9 @@ namespace stl
#define BGFX_RENDERER_DIRECT3D9_NAME "Direct3D 9"
#define BGFX_RENDERER_DIRECT3D11_NAME "Direct3D 11"
#define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12"
-#define BGFX_RENDERER_METAL_NAME "Metal"
-#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
-#define BGFX_RENDERER_NULL_NAME "NULL"
+#define BGFX_RENDERER_METAL_NAME "Metal"
+#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
+#define BGFX_RENDERER_NULL_NAME "NULL"
#if BGFX_CONFIG_RENDERER_OPENGL
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33
@@ -256,6 +257,7 @@ namespace stl
namespace bgfx
{
+ extern InternalData g_internalData;
extern PlatformData g_platformData;
#if BGFX_CONFIG_MAX_DRAW_CALLS < (64<<10)
@@ -309,13 +311,13 @@ namespace bgfx
struct TextureCreate
{
+ TextureFormat::Enum m_format;
uint32_t m_flags;
uint16_t m_width;
uint16_t m_height;
uint16_t m_sides;
uint16_t m_depth;
uint8_t m_numMips;
- uint8_t m_format;
bool m_cubeMap;
const Memory* m_mem;
};
@@ -448,13 +450,7 @@ namespace bgfx
const uint32_t width = (bx::uint32_min(m_width, _width +_x)-_x)*2;
const uint32_t height = bx::uint32_min(m_height, _height+_y)-_y;
const uint32_t dstPitch = m_width*2;
-
- for (uint32_t yy = 0; yy < height; ++yy)
- {
- memcpy(dst, src, width);
- dst += dstPitch;
- src += _pitch;
- }
+ bx::memCopy(dst, src, width, height, _pitch, dstPitch);
}
}
@@ -700,26 +696,28 @@ namespace bgfx
void operator=(const CommandBuffer&);
};
-#define SORT_KEY_DRAW_BIT (UINT64_C(1)<<0x36)
+#define SORT_KEY_NUM_BITS_TRANS 2
-#define SORT_KEY_SEQ_SHIFT 0x2b
-#define SORT_KEY_SEQ_MASK (UINT64_C(0x7ff)<<SORT_KEY_SEQ_SHIFT)
+#define SORT_KEY_DRAW_BIT (UINT64_C(1)<<0x36)
#define SORT_KEY_VIEW_SHIFT 0x37
#define SORT_KEY_VIEW_MASK ( (uint64_t(BGFX_CONFIG_MAX_VIEWS-1) )<<SORT_KEY_VIEW_SHIFT)
-#define SORT_KEY_DRAW_TRANS_SHIFT 0x29
-#define SORT_KEY_DRAW_TRANS_MASK (UINT64_C(0x3)<<SORT_KEY_DRAW_TRANS_SHIFT)
+#define SORT_KEY_DRAW_DEPTH_SHIFT 0
+#define SORT_KEY_DRAW_DEPTH_MASK ( ( (UINT64_C(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)-1)<<SORT_KEY_DRAW_DEPTH_SHIFT)
-#define SORT_KEY_DRAW_PROGRAM_SHIFT 0x20
+#define SORT_KEY_DRAW_PROGRAM_SHIFT (SORT_KEY_DRAW_DEPTH_SHIFT+BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)
#define SORT_KEY_DRAW_PROGRAM_MASK ( (uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1) )<<SORT_KEY_DRAW_PROGRAM_SHIFT)
-#define SORT_KEY_DRAW_DEPTH_SHIFT 0
-#define SORT_KEY_DRAW_DEPTH_MASK ( (uint64_t(UINT32_MAX) )<<SORT_KEY_DRAW_DEPTH_SHIFT)
-
-#define SORT_KEY_COMPUTE_PROGRAM_SHIFT 0x22
+#define SORT_KEY_COMPUTE_PROGRAM_SHIFT (SORT_KEY_DRAW_DEPTH_SHIFT+BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH+SORT_KEY_NUM_BITS_TRANS)
#define SORT_KEY_COMPUTE_PROGRAM_MASK ( (uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1) )<<SORT_KEY_COMPUTE_PROGRAM_SHIFT)
+#define SORT_KEY_DRAW_TRANS_SHIFT (SORT_KEY_DRAW_PROGRAM_SHIFT+BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM)
+#define SORT_KEY_DRAW_TRANS_MASK (UINT64_C(0x3)<<SORT_KEY_DRAW_TRANS_SHIFT)
+
+#define SORT_KEY_SEQ_SHIFT (SORT_KEY_DRAW_TRANS_SHIFT+SORT_KEY_NUM_BITS_TRANS)
+#define SORT_KEY_SEQ_MASK ( ( (UINT64_C(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ)-1)<<SORT_KEY_SEQ_SHIFT)
+
BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= 256);
BX_STATIC_ASSERT( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // Must be power of 2.
BX_STATIC_ASSERT( (0 // Render key mask shouldn't overlap.
@@ -800,7 +798,7 @@ namespace bgfx
/// Returns true if item is command.
bool decode(uint64_t _key)
{
- m_seq = uint16_t( (_key & SORT_KEY_SEQ_MASK ) >> SORT_KEY_SEQ_SHIFT);
+ m_seq = uint32_t( (_key & SORT_KEY_SEQ_MASK ) >> SORT_KEY_SEQ_SHIFT);
m_view = uint8_t( (_key & SORT_KEY_VIEW_MASK) >> SORT_KEY_VIEW_SHIFT);
if (_key & SORT_KEY_DRAW_BIT)
{
@@ -832,15 +830,15 @@ namespace bgfx
void reset()
{
m_depth = 0;
- m_program = 0;
m_seq = 0;
+ m_program = 0;
m_view = 0;
m_trans = 0;
}
uint32_t m_depth;
+ uint32_t m_seq;
uint16_t m_program;
- uint16_t m_seq;
uint8_t m_view;
uint8_t m_trans;
};
@@ -2041,6 +2039,8 @@ namespace bgfx
virtual void updateTextureEnd() = 0;
virtual void readTexture(TextureHandle _handle, void* _data) = 0;
virtual void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height) = 0;
+ virtual void overrideInternal(TextureHandle _handle, uintptr_t _ptr) = 0;
+ virtual uintptr_t getInternal(TextureHandle _handle) = 0;
virtual void destroyTexture(TextureHandle _handle) = 0;
virtual void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) = 0;
virtual void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) = 0;
diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh
index a82a03e2fbb..77998652e9d 100644
--- a/3rdparty/bgfx/src/bgfx_shader.sh
+++ b/3rdparty/bgfx/src/bgfx_shader.sh
@@ -12,6 +12,22 @@
#ifndef __cplusplus
+#if BGFX_SHADER_LANGUAGE_HLSL > 3
+# define BRANCH [branch]
+# define LOOP [loop]
+# define UNROLL [unroll]
+#else
+# define BRANCH
+# define LOOP
+# define UNROLL
+#endif // BGFX_SHADER_LANGUAGE_HLSL > 3
+
+#if BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT
+# define EARLY_DEPTH_STENCIL [earlydepthstencil]
+#else
+# define EARLY_DEPTH_STENCIL
+#endif // BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT
+
#if BGFX_SHADER_LANGUAGE_HLSL
# define dFdx(_x) ddx(_x)
# define dFdy(_y) ddy(-_y)
@@ -59,13 +75,13 @@ struct BgfxSampler2DShadow
float bgfxShadow2D(BgfxSampler2DShadow _sampler, vec3 _coord)
{
- return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z * 2.0 - 1.0);
+ return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z);
}
float bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord)
{
vec3 coord = _coord.xyz * rcp(_coord.w);
- return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z * 2.0 - 1.0);
+ return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z);
}
struct BgfxSampler3D
@@ -180,9 +196,9 @@ float bgfxShadow2D(sampler2DShadow _sampler, vec3 _coord)
{
#if 0
float occluder = tex2D(_sampler, _coord.xy).x;
- return step(_coord.z * 2.0 - 1.0, occluder);
+ return step(_coord.z, occluder);
#else
- return tex2Dproj(_sampler, vec4(_coord.xy, _coord.z * 2.0 - 1.0, 1.0) ).x;
+ return tex2Dproj(_sampler, vec4(_coord.xy, _coord.z, 1.0) ).x;
#endif // 0
}
@@ -191,7 +207,7 @@ float bgfxShadow2DProj(sampler2DShadow _sampler, vec4 _coord)
#if 0
vec3 coord = _coord.xyz * rcp(_coord.w);
float occluder = tex2D(_sampler, coord.xy).x;
- return step(coord.z * 2.0 - 1.0, occluder);
+ return step(coord.z, occluder);
#else
return tex2Dproj(_sampler, _coord).x;
#endif // 0
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h
index 5966105ea15..edfa69da75a 100644
--- a/3rdparty/bgfx/src/config.h
+++ b/3rdparty/bgfx/src/config.h
@@ -65,6 +65,7 @@
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_QNX \
|| BX_PLATFORM_RPI \
+ || BX_PLATFORM_STEAMLINK \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_OPENGLES
@@ -77,8 +78,10 @@
|| BGFX_CONFIG_RENDERER_DIRECT3D9 \
|| BGFX_CONFIG_RENDERER_DIRECT3D11 \
|| BGFX_CONFIG_RENDERER_DIRECT3D12 \
+ || BGFX_CONFIG_RENDERER_METAL \
|| BGFX_CONFIG_RENDERER_OPENGL \
|| BGFX_CONFIG_RENDERER_OPENGLES \
+ || BGFX_CONFIG_RENDERER_VULKAN \
? 1 : 0) )
# endif // BGFX_CONFIG_RENDERER_NULL
#else
@@ -175,19 +178,7 @@
#endif // BGFX_CONFIG_DEBUG_OCCLUSION
#ifndef BGFX_CONFIG_MULTITHREADED
-# define BGFX_CONFIG_MULTITHREADED ( (!BGFX_CONFIG_RENDERER_NULL)&&(0 \
- || BX_PLATFORM_ANDROID \
- || BX_PLATFORM_BSD \
- || BX_PLATFORM_LINUX \
- || BX_PLATFORM_IOS \
- || BX_PLATFORM_NACL \
- || BX_PLATFORM_OSX \
- || BX_PLATFORM_QNX \
- || BX_PLATFORM_RPI \
- || BX_PLATFORM_WINDOWS \
- || BX_PLATFORM_WINRT \
- || BX_PLATFORM_XBOX360 \
- ? 1 : 0) )
+# define BGFX_CONFIG_MULTITHREADED ( (0 == BX_PLATFORM_EMSCRIPTEN) ? 1 : 0)
#endif // BGFX_CONFIG_MULTITHREADED
#ifndef BGFX_CONFIG_MAX_DRAW_CALLS
@@ -206,6 +197,21 @@
# define BGFX_CONFIG_MAX_RECT_CACHE (4<<10)
#endif // BGFX_CONFIG_MAX_RECT_CACHE
+#ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH
+# define BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH 32
+#endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH
+
+#ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ
+# define BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ 11
+#endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ
+
+#ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM
+# define BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM 9
+#endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM
+
+// Cannot be configured directly. Must must be power of 2.
+#define BGFX_CONFIG_MAX_PROGRAMS (1<<BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM)
+
#ifndef BGFX_CONFIG_MAX_VIEWS
// Do not change. Must be power of 2.
# define BGFX_CONFIG_MAX_VIEWS 256
@@ -249,11 +255,6 @@
# define BGFX_CONFIG_MAX_SHADERS 512
#endif // BGFX_CONFIG_MAX_FRAGMENT_SHADERS
-#ifndef BGFX_CONFIG_MAX_PROGRAMS
-// Must be power of 2.
-# define BGFX_CONFIG_MAX_PROGRAMS 512
-#endif // BGFX_CONFIG_MAX_PROGRAMS
-
#ifndef BGFX_CONFIG_MAX_TEXTURES
# define BGFX_CONFIG_MAX_TEXTURES (4<<10)
#endif // BGFX_CONFIG_MAX_TEXTURES
diff --git a/3rdparty/bgfx/src/glcontext_eagl.mm b/3rdparty/bgfx/src/glcontext_eagl.mm
index 253a31226c0..544fe0373d3 100644
--- a/3rdparty/bgfx/src/glcontext_eagl.mm
+++ b/3rdparty/bgfx/src/glcontext_eagl.mm
@@ -66,6 +66,8 @@ namespace bgfx { namespace gl
);
import();
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp
index d29a3422795..960500ac155 100644
--- a/3rdparty/bgfx/src/glcontext_egl.cpp
+++ b/3rdparty/bgfx/src/glcontext_egl.cpp
@@ -314,6 +314,8 @@ EGL_IMPORT
}
import();
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp
index 4e7e38f3bbe..20de9d71435 100644
--- a/3rdparty/bgfx/src/glcontext_glx.cpp
+++ b/3rdparty/bgfx/src/glcontext_glx.cpp
@@ -211,6 +211,8 @@ namespace bgfx { namespace gl
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glXSwapBuffers( (::Display*)g_platformData.ndt, (::Window)g_platformData.nwh);
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index e7acb814cab..b20de537500 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -115,6 +115,8 @@ namespace bgfx { namespace gl
}
import();
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glcontext_ppapi.cpp b/3rdparty/bgfx/src/glcontext_ppapi.cpp
index 977cd6c96da..a4290cc3005 100644
--- a/3rdparty/bgfx/src/glcontext_ppapi.cpp
+++ b/3rdparty/bgfx/src/glcontext_ppapi.cpp
@@ -191,6 +191,8 @@ namespace bgfx { namespace gl
{
BX_UNUSED(_width, _height);
BX_TRACE("GlContext::create");
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp
index 3c52702a6e5..eafee4f94b2 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.cpp
+++ b/3rdparty/bgfx/src/glcontext_wgl.cpp
@@ -268,6 +268,8 @@ namespace bgfx { namespace gl
}
import();
+
+ g_internalData.context = m_context;
}
void GlContext::destroy()
diff --git a/3rdparty/bgfx/src/glimports.h b/3rdparty/bgfx/src/glimports.h
index 5891bd55ec9..527f96f128d 100644
--- a/3rdparty/bgfx/src/glimports.h
+++ b/3rdparty/bgfx/src/glimports.h
@@ -149,6 +149,7 @@ typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, G
typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
typedef const GLubyte* (GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
+typedef const GLubyte* (GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
@@ -332,6 +333,7 @@ GL_IMPORT______(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObj
GL_IMPORT______(false, PFNGLGETSHADERIVPROC, glGetShaderiv);
GL_IMPORT______(false, PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog);
GL_IMPORT______(false, PFNGLGETSTRINGPROC, glGetString);
+GL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);
GL_IMPORT______(false, PFNGLGETUNIFORMLOCATIONPROC, glGetUniformLocation);
#if BGFX_CONFIG_RENDERER_OPENGL || !(BGFX_CONFIG_RENDERER_OPENGLES < 30)
GL_IMPORT______(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);
@@ -468,6 +470,8 @@ GL_IMPORT_____x(true, PFNGLGETCOMPRESSEDTEXIMAGEPROC, glGetCompress
GL_IMPORT_____x(true, PFNGLGETTEXIMAGEPROC, glGetTexImage);
# if BGFX_CONFIG_RENDERER_OPENGLES < 30
+GL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);
+
GL_IMPORT_OES__(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);
GL_IMPORT_OES__(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);
GL_IMPORT_OES__(true, PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);
@@ -538,6 +542,8 @@ GL_IMPORT_NV___(true, PFNGLQUERYCOUNTERPROC, glQueryCounte
GL_IMPORT (true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer, glDiscardFramebufferEXT);
# elif !BGFX_USE_GL_DYNAMIC_LIB
+GL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);
+
GL_IMPORT______(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);
GL_IMPORT______(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);
GL_IMPORT______(true, PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);
diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp
index 69bad82e943..6f8f79775fa 100644
--- a/3rdparty/bgfx/src/image.cpp
+++ b/3rdparty/bgfx/src/image.cpp
@@ -253,7 +253,7 @@ namespace bgfx
uint8_t numMips = 0;
for (uint32_t width = _width, height = _height, depth = _depth
- ; blockWidth < width && blockHeight < height && 1 < depth
+ ; blockWidth < width || blockHeight < height || 1 < depth
; ++numMips)
{
width = bx::uint32_max(blockWidth * minBlockX, ( (width + blockWidth - 1) / blockWidth )*blockWidth);
@@ -326,7 +326,7 @@ namespace bgfx
}
}
- void imageRgba8Downsample2x2Ref(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageRgba8Downsample2x2Ref(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
{
const uint32_t dstwidth = _width/2;
const uint32_t dstheight = _height/2;
@@ -340,27 +340,27 @@ namespace bgfx
uint8_t* dst = (uint8_t*)_dst;
const uint8_t* src = (const uint8_t*)_src;
- for (uint32_t yy = 0, ystep = _srcPitch*2; yy < dstheight; ++yy, src += ystep)
+ for (uint32_t yy = 0, ystep = _pitch*2; yy < dstheight; ++yy, src += ystep)
{
const uint8_t* rgba = src;
for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 8, dst += 4)
{
- float rr = powf(rgba[ 0], 2.2f);
- float gg = powf(rgba[ 1], 2.2f);
- float bb = powf(rgba[ 2], 2.2f);
- float aa = rgba[ 3];
- rr += powf(rgba[ 4], 2.2f);
- gg += powf(rgba[ 5], 2.2f);
- bb += powf(rgba[ 6], 2.2f);
- aa += rgba[ 7];
- rr += powf(rgba[_srcPitch+0], 2.2f);
- gg += powf(rgba[_srcPitch+1], 2.2f);
- bb += powf(rgba[_srcPitch+2], 2.2f);
- aa += rgba[_srcPitch+3];
- rr += powf(rgba[_srcPitch+4], 2.2f);
- gg += powf(rgba[_srcPitch+5], 2.2f);
- bb += powf(rgba[_srcPitch+6], 2.2f);
- aa += rgba[_srcPitch+7];
+ float rr = powf(rgba[ 0], 2.2f);
+ float gg = powf(rgba[ 1], 2.2f);
+ float bb = powf(rgba[ 2], 2.2f);
+ float aa = rgba[ 3];
+ rr += powf(rgba[ 4], 2.2f);
+ gg += powf(rgba[ 5], 2.2f);
+ bb += powf(rgba[ 6], 2.2f);
+ aa += rgba[ 7];
+ rr += powf(rgba[_pitch+0], 2.2f);
+ gg += powf(rgba[_pitch+1], 2.2f);
+ bb += powf(rgba[_pitch+2], 2.2f);
+ aa += rgba[_pitch+3];
+ rr += powf(rgba[_pitch+4], 2.2f);
+ gg += powf(rgba[_pitch+5], 2.2f);
+ bb += powf(rgba[_pitch+6], 2.2f);
+ aa += rgba[_pitch+7];
rr *= 0.25f;
gg *= 0.25f;
@@ -377,7 +377,7 @@ namespace bgfx
}
}
- void imageRgba8Downsample2x2(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageRgba8Downsample2x2(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
{
const uint32_t dstwidth = _width/2;
const uint32_t dstheight = _height/2;
@@ -402,15 +402,15 @@ namespace bgfx
const float4_t linear = float4_ld(2.2f, 2.2f, 2.2f, 1.0f);
const float4_t quater = float4_splat(0.25f);
- for (uint32_t yy = 0, ystep = _srcPitch*2; yy < dstheight; ++yy, src += ystep)
+ for (uint32_t yy = 0, ystep = _pitch*2; yy < dstheight; ++yy, src += ystep)
{
const uint8_t* rgba = src;
for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 8, dst += 4)
{
const float4_t abgr0 = float4_splat(rgba);
const float4_t abgr1 = float4_splat(rgba+4);
- const float4_t abgr2 = float4_splat(rgba+_srcPitch);
- const float4_t abgr3 = float4_splat(rgba+_srcPitch+4);
+ const float4_t abgr2 = float4_splat(rgba+_pitch);
+ const float4_t abgr3 = float4_splat(rgba+_pitch+4);
const float4_t abgr0m = float4_and(abgr0, umask);
const float4_t abgr1m = float4_and(abgr1, umask);
@@ -458,13 +458,56 @@ namespace bgfx
}
}
- void imageSwizzleBgra8Ref(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageRgba32fDownsample2x2NormalMapRef(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
+ {
+ const uint32_t dstwidth = _width/2;
+ const uint32_t dstheight = _height/2;
+
+ if (0 == dstwidth
+ || 0 == dstheight)
+ {
+ return;
+ }
+
+ const uint8_t* src = (const uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
+
+ for (uint32_t yy = 0, ystep = _pitch*2; yy < dstheight; ++yy, src += ystep)
+ {
+ const float* rgba0 = (const float*)&src[0];
+ const float* rgba1 = (const float*)&src[_pitch];
+ for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba0 += 8, rgba1 += 8, dst += 16)
+ {
+ float xyz[3];
+ xyz[0] = rgba0[0];
+ xyz[1] = rgba0[1];
+ xyz[2] = rgba0[2];
+ xyz[0] += rgba0[4];
+ xyz[1] += rgba0[5];
+ xyz[2] += rgba0[6];
+ xyz[0] += rgba1[0];
+ xyz[1] += rgba1[1];
+ xyz[2] += rgba1[2];
+ xyz[0] += rgba1[4];
+ xyz[1] += rgba1[5];
+ xyz[2] += rgba1[6];
+ bx::vec3Norm( (float*)dst, xyz);
+ }
+ }
+ }
+
+ void imageRgba32fDownsample2x2NormalMap(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
+ {
+ imageRgba32fDownsample2x2NormalMapRef(_width, _height, _pitch, _src, _dst);
+ }
+
+ void imageSwizzleBgra8Ref(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
{
const uint8_t* src = (uint8_t*) _src;
- const uint8_t* next = src + _srcPitch;
+ const uint8_t* next = src + _pitch;
uint8_t* dst = (uint8_t*)_dst;
- for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _srcPitch)
+ for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _pitch)
{
for (uint32_t xx = 0; xx < _width; ++xx, src += 4, dst += 4)
{
@@ -480,7 +523,7 @@ namespace bgfx
}
}
- void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst)
{
// Test can we do four 4-byte pixels at the time.
if (0 != (_width&0x3)
@@ -492,7 +535,7 @@ namespace bgfx
BX_WARN(bx::isPtrAligned(_src, 16), "Source %p is not 16-byte aligned.", _src);
BX_WARN(bx::isPtrAligned(_dst, 16), "Destination %p is not 16-byte aligned.", _dst);
BX_WARN(_width < 4, "Image width must be multiple of 4 (width %d).", _width);
- imageSwizzleBgra8Ref(_width, _height, _srcPitch, _src, _dst);
+ imageSwizzleBgra8Ref(_width, _height, _pitch, _src, _dst);
return;
}
@@ -501,12 +544,12 @@ namespace bgfx
const float4_t mf0f0 = float4_isplat(0xff00ff00);
const float4_t m0f0f = float4_isplat(0x00ff00ff);
const uint8_t* src = (uint8_t*) _src;
- const uint8_t* next = src + _srcPitch;
+ const uint8_t* next = src + _pitch;
uint8_t* dst = (uint8_t*)_dst;
const uint32_t width = _width/4;
- for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _srcPitch)
+ for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _pitch)
{
for (uint32_t xx = 0; xx < width; ++xx, src += 16, dst += 16)
{
@@ -534,10 +577,856 @@ namespace bgfx
}
}
- void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _pitch, const void* _src, void* _dst)
{
const uint32_t dstPitch = _width*_bpp/8;
- imageCopy(_height, _srcPitch, _src, dstPitch, _dst);
+ imageCopy(_height, _pitch, _src, dstPitch, _dst);
+ }
+
+ uint32_t toUnorm(float _value, float _scale)
+ {
+ return uint32_t(bx::fround(
+ bx::fsaturate(_value) * _scale)
+ );
+ }
+
+ float fromUnorm(uint32_t _value, float _scale)
+ {
+ return float(_value) / _scale;
+ }
+
+ int32_t toSnorm(float _value, float _scale)
+ {
+ return int32_t(bx::fround(
+ bx::fclamp(_value, -1.0f, 1.0f) * _scale)
+ );
+ }
+
+ float fromSnorm(int32_t _value, float _scale)
+ {
+ return bx::fmax(-1.0f, float(_value) / _scale);
+ }
+
+ // R8
+ void packR8(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(toUnorm(_src[0], 255.0f) );
+ }
+
+ void unpackR8(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = fromUnorm(src[0], 255.0f);
+ }
+
+ // R8S
+ void packR8S(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(toSnorm(_src[0], 127.0f) );
+ }
+
+ void unpackR8S(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = fromSnorm(src[0], 127.0f);
+ }
+
+ // R8I
+ void packR8I(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(_src[0]);
+ }
+
+ void unpackR8I(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = float(src[0]);
+ }
+
+ // R8U
+ void packR8U(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(_src[0]);
+ }
+
+ void unpackR8U(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = float(src[0]);
+ }
+
+ // RG8
+ void packRg8(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(toUnorm(_src[0], 255.0f) );
+ dst[1] = uint8_t(toUnorm(_src[1], 255.0f) );
+ }
+
+ void unpackRg8(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = fromUnorm(src[0], 255.0f);
+ _dst[1] = fromUnorm(src[1], 255.0f);
+ }
+
+ // RG8S
+ void packRg8S(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(toSnorm(_src[0], 127.0f) );
+ dst[1] = int8_t(toSnorm(_src[1], 127.0f) );
+ }
+
+ void unpackRg8S(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = fromSnorm(src[0], 127.0f);
+ _dst[1] = fromSnorm(src[1], 127.0f);
+ }
+
+ // RG8I
+ void packRg8I(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(_src[0]);
+ dst[1] = int8_t(_src[1]);
+ }
+
+ void unpackRg8I(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ }
+
+ // RG8U
+ void packRg8U(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(_src[0]);
+ dst[1] = uint8_t(_src[1]);
+ }
+
+ void unpackRg8U(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ }
+
+ // RGBA8
+ void packRgba8(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(toUnorm(_src[0], 255.0f) );
+ dst[1] = uint8_t(toUnorm(_src[1], 255.0f) );
+ dst[2] = uint8_t(toUnorm(_src[2], 255.0f) );
+ dst[3] = uint8_t(toUnorm(_src[3], 255.0f) );
+ }
+
+ void unpackRgba8(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = fromUnorm(src[0], 255.0f);
+ _dst[1] = fromUnorm(src[1], 255.0f);
+ _dst[2] = fromUnorm(src[2], 255.0f);
+ _dst[3] = fromUnorm(src[3], 255.0f);
+ }
+
+ // BGRA8
+ void packBgra8(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[2] = uint8_t(toUnorm(_src[0], 255.0f) );
+ dst[1] = uint8_t(toUnorm(_src[1], 255.0f) );
+ dst[0] = uint8_t(toUnorm(_src[2], 255.0f) );
+ dst[3] = uint8_t(toUnorm(_src[3], 255.0f) );
+ }
+
+ void unpackBgra8(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = fromUnorm(src[2], 255.0f);
+ _dst[1] = fromUnorm(src[1], 255.0f);
+ _dst[2] = fromUnorm(src[0], 255.0f);
+ _dst[3] = fromUnorm(src[3], 255.0f);
+ }
+
+ // RGBA8S
+ void packRgba8S(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(toSnorm(_src[0], 127.0f) );
+ dst[1] = int8_t(toSnorm(_src[1], 127.0f) );
+ dst[2] = int8_t(toSnorm(_src[2], 127.0f) );
+ dst[3] = int8_t(toSnorm(_src[3], 127.0f) );
+ }
+
+ void unpackRgba8S(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = fromSnorm(src[0], 127.0f);
+ _dst[1] = fromSnorm(src[1], 127.0f);
+ _dst[2] = fromSnorm(src[2], 127.0f);
+ _dst[3] = fromSnorm(src[3], 127.0f);
+ }
+
+ // RGBA8I
+ void packRgba8I(void* _dst, const float* _src)
+ {
+ int8_t* dst = (int8_t*)_dst;
+ dst[0] = int8_t(_src[0]);
+ dst[1] = int8_t(_src[1]);
+ dst[2] = int8_t(_src[2]);
+ dst[3] = int8_t(_src[3]);
+ }
+
+ void unpackRgba8I(float* _dst, const void* _src)
+ {
+ const int8_t* src = (const int8_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ _dst[2] = float(src[2]);
+ _dst[3] = float(src[3]);
+ }
+
+ // RGBA8U
+ void packRgba8U(void* _dst, const float* _src)
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ dst[0] = uint8_t(_src[0]);
+ dst[1] = uint8_t(_src[1]);
+ dst[2] = uint8_t(_src[2]);
+ dst[3] = uint8_t(_src[3]);
+ }
+
+ void unpackRgba8U(float* _dst, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ _dst[2] = float(src[2]);
+ _dst[3] = float(src[3]);
+ }
+
+ // R16
+ void packR16(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(toUnorm(_src[0], 65535.0f) );
+ }
+
+ void unpackR16(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = fromUnorm(src[0], 65535.0f);
+ }
+
+ // R16S
+ void packR16S(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(toSnorm(_src[0], 32767.0f) );
+ }
+
+ void unpackR16S(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = fromSnorm(src[0], 32767.0f);
+ }
+
+ // R16I
+ void packR16I(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(_src[0]);
+ }
+
+ void unpackR16I(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = float(src[0]);
+ }
+
+ // R16U
+ void packR16U(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(_src[0]);
+ }
+
+ void unpackR16U(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = float(src[0]);
+ }
+
+ // R16F
+ void packR16F(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = bx::halfFromFloat(_src[0]);
+ }
+
+ void unpackR16F(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = bx::halfToFloat(src[0]);
+ }
+
+ // RG16
+ void packRg16(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(toUnorm(_src[0], 65535.0f) );
+ dst[1] = uint16_t(toUnorm(_src[1], 65535.0f) );
+ }
+
+ void unpackRg16(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = fromUnorm(src[0], 65535.0f);
+ _dst[1] = fromUnorm(src[1], 65535.0f);
+ }
+
+ // RG16S
+ void packRg16S(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(toSnorm(_src[0], 32767.0f) );
+ dst[1] = int16_t(toSnorm(_src[1], 32767.0f) );
+ }
+
+ void unpackRg16S(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = fromSnorm(src[0], 32767.0f);
+ _dst[1] = fromSnorm(src[1], 32767.0f);
+ }
+
+ // RG16I
+ void packRg16I(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(_src[0]);
+ dst[1] = int16_t(_src[1]);
+ }
+
+ void unpackRg16I(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ }
+
+ // RG16U
+ void packRg16U(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(_src[0]);
+ dst[1] = uint16_t(_src[1]);
+ }
+
+ void unpackRg16U(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ }
+
+ // RG16F
+ void packRg16F(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = bx::halfFromFloat(_src[0]);
+ dst[1] = bx::halfFromFloat(_src[1]);
+ }
+
+ void unpackRg16F(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = bx::halfToFloat(src[0]);
+ _dst[1] = bx::halfToFloat(src[1]);
+ }
+
+ // RGBA16
+ void packRgba16(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(toUnorm(_src[0], 65535.0f) );
+ dst[1] = uint16_t(toUnorm(_src[1], 65535.0f) );
+ dst[2] = uint16_t(toUnorm(_src[2], 65535.0f) );
+ dst[3] = uint16_t(toUnorm(_src[3], 65535.0f) );
+ }
+
+ void unpackRgba16(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = fromUnorm(src[0], 65535.0f);
+ _dst[1] = fromUnorm(src[1], 65535.0f);
+ _dst[2] = fromUnorm(src[2], 65535.0f);
+ _dst[3] = fromUnorm(src[3], 65535.0f);
+ }
+
+ // RGBA16S
+ void packRgba16S(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(toSnorm(_src[0], 32767.0f) );
+ dst[1] = int16_t(toSnorm(_src[1], 32767.0f) );
+ dst[2] = int16_t(toSnorm(_src[2], 32767.0f) );
+ dst[3] = int16_t(toSnorm(_src[3], 32767.0f) );
+ }
+
+ void unpackRgba16S(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = fromSnorm(src[0], 32767.0f);
+ _dst[1] = fromSnorm(src[1], 32767.0f);
+ _dst[2] = fromSnorm(src[2], 32767.0f);
+ _dst[3] = fromSnorm(src[3], 32767.0f);
+ }
+
+ // RGBA16I
+ void packRgba16I(void* _dst, const float* _src)
+ {
+ int16_t* dst = (int16_t*)_dst;
+ dst[0] = int16_t(_src[0]);
+ dst[1] = int16_t(_src[1]);
+ dst[2] = int16_t(_src[2]);
+ dst[3] = int16_t(_src[3]);
+ }
+
+ void unpackRgba16I(float* _dst, const void* _src)
+ {
+ const int16_t* src = (const int16_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ _dst[2] = float(src[2]);
+ _dst[3] = float(src[3]);
+ }
+
+ // RGBA16U
+ void packRgba16U(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = uint16_t(_src[0]);
+ dst[1] = uint16_t(_src[1]);
+ dst[2] = uint16_t(_src[2]);
+ dst[3] = uint16_t(_src[3]);
+ }
+
+ void unpackRgba16U(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = float(src[0]);
+ _dst[1] = float(src[1]);
+ _dst[2] = float(src[2]);
+ _dst[3] = float(src[3]);
+ }
+
+ // RGBA16F
+ void packRgba16F(void* _dst, const float* _src)
+ {
+ uint16_t* dst = (uint16_t*)_dst;
+ dst[0] = bx::halfFromFloat(_src[0]);
+ dst[1] = bx::halfFromFloat(_src[1]);
+ dst[2] = bx::halfFromFloat(_src[2]);
+ dst[3] = bx::halfFromFloat(_src[3]);
+ }
+
+ void unpackRgba16F(float* _dst, const void* _src)
+ {
+ const uint16_t* src = (const uint16_t*)_src;
+ _dst[0] = bx::halfToFloat(src[0]);
+ _dst[1] = bx::halfToFloat(src[1]);
+ _dst[2] = bx::halfToFloat(src[2]);
+ _dst[3] = bx::halfToFloat(src[3]);
+ }
+
+ // R32I
+ void packR32I(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ void unpackR32I(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ // R32U
+ void packR32U(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ void unpackR32U(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ // R32F
+ void packR32F(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ void unpackR32F(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 4);
+ }
+
+ // RG32I
+ void packRg32I(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ void unpackRg32I(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ // RG32U
+ void packRg32U(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ void unpackRg32U(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ // RG32F
+ void packRg32F(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ void unpackRg32F(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 8);
+ }
+
+ template<int32_t MantissaBits, int32_t ExpBits>
+ void encodeRgbE(float* _dst, const float* _src)
+ {
+ // Reference:
+ // https://www.opengl.org/registry/specs/EXT/texture_shared_exponent.txt
+ const int32_t expMax = (1<<ExpBits) - 1;
+ const int32_t expBias = (1<<(ExpBits - 1) ) - 1;
+ const float sharedExpMax = float(expMax) / float(expMax + 1) * float(1 << (expMax - expBias) );
+
+ const float rr = bx::fclamp(_src[0], 0.0f, sharedExpMax);
+ const float gg = bx::fclamp(_src[1], 0.0f, sharedExpMax);
+ const float bb = bx::fclamp(_src[2], 0.0f, sharedExpMax);
+ const float max = bx::fmax3(rr, gg, bb);
+ union { float ff; uint32_t ui; } cast = { max };
+ int32_t expShared = int32_t(bx::uint32_imax(uint32_t(-expBias-1), ( ( (cast.ui>>23) & 0xff) - 127) ) ) + 1 + expBias;
+ float denom = bx::fpow(2.0f, float(expShared - expBias - MantissaBits) );
+
+ if ( (1<<MantissaBits) == int32_t(bx::fround(max/denom) ) )
+ {
+ denom *= 2.0f;
+ ++expShared;
+ }
+
+ const float invDenom = 1.0f/denom;
+ _dst[0] = bx::fround(rr * invDenom);
+ _dst[1] = bx::fround(gg * invDenom);
+ _dst[2] = bx::fround(bb * invDenom);
+ _dst[3] = float(expShared);
+ }
+
+ template<int32_t MantissaBits, int32_t ExpBits>
+ void decodeRgbE(float* _dst, const float* _src)
+ {
+ const int32_t expBias = (1<<(ExpBits - 1) ) - 1;
+ const float exponent = _src[3]-float(expBias-MantissaBits);
+ const float scale = bx::fpow(2.0f, exponent);
+ _dst[0] = _src[0] * scale;
+ _dst[1] = _src[1] * scale;
+ _dst[2] = _src[2] * scale;
+ }
+
+ // RGB9E5F
+ void packRgb9E5F(void* _dst, const float* _src)
+ {
+ float tmp[4];
+ encodeRgbE<9, 5>(tmp, _src);
+
+ *( (uint32_t*)_dst) = 0
+ | (uint32_t(tmp[0]) )
+ | (uint32_t(tmp[1]) << 9)
+ | (uint32_t(tmp[2]) <<18)
+ | (uint32_t(tmp[3]) <<27)
+ ;
+ }
+
+ void unpackRgb9E5F(float* _dst, const void* _src)
+ {
+ uint32_t packed = *( (const uint32_t*)_src);
+
+ float tmp[4];
+ tmp[0] = float( ( (packed ) & 0x1ff) ) / 511.0f;
+ tmp[1] = float( ( (packed>> 9) & 0x1ff) ) / 511.0f;
+ tmp[2] = float( ( (packed>>18) & 0x1ff) ) / 511.0f;
+ tmp[3] = float( ( (packed>>27) & 0x1f) );
+
+ decodeRgbE<9, 5>(_dst, tmp);
+ }
+
+ // RGBA32I
+ void packRgba32I(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ void unpackRgba32I(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ // RGBA32U
+ void packRgba32U(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ void unpackRgba32U(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ // RGBA32F
+ void packRgba32F(void* _dst, const float* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ void unpackRgba32F(float* _dst, const void* _src)
+ {
+ memcpy(_dst, _src, 16);
+ }
+
+ // R5G6B5
+ 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)
+ ;
+ }
+
+ 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;
+ }
+
+ // RGBA4
+ void packRgba4(void* _dst, const float* _src)
+ {
+ *( (uint16_t*)_dst) = 0
+ | uint16_t(toUnorm(_src[0], 15.0f) )
+ | uint16_t(toUnorm(_src[1], 15.0f)<< 4)
+ | uint16_t(toUnorm(_src[2], 15.0f)<< 8)
+ | uint16_t(toUnorm(_src[3], 15.0f)<<12)
+ ;
+ }
+
+ void unpackRgba4(float* _dst, const void* _src)
+ {
+ uint16_t packed = *( (const uint16_t*)_src);
+ _dst[0] = float( ( (packed ) & 0xf) ) / 15.0f;
+ _dst[1] = float( ( (packed>> 4) & 0xf) ) / 15.0f;
+ _dst[2] = float( ( (packed>> 8) & 0xf) ) / 15.0f;
+ _dst[3] = float( ( (packed>>12) & 0xf) ) / 15.0f;
+ }
+
+ // RGB5A1
+ void packRgb5a1(void* _dst, const float* _src)
+ {
+ *( (uint16_t*)_dst) = 0
+ | uint16_t(toUnorm(_src[0], 31.0f) )
+ | uint16_t(toUnorm(_src[1], 31.0f)<< 5)
+ | uint16_t(toUnorm(_src[2], 31.0f)<<10)
+ | uint16_t(toUnorm(_src[3], 1.0f)<<15)
+ ;
+ }
+
+ void unpackRgb5a1(float* _dst, const void* _src)
+ {
+ uint16_t packed = *( (const uint16_t*)_src);
+ _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) );
+ }
+
+ // RGB10A2
+ void packRgb10A2(void* _dst, const float* _src)
+ {
+ *( (uint32_t*)_dst) = 0
+ | (toUnorm(_src[0], 1023.0f) )
+ | (toUnorm(_src[1], 1023.0f)<<10)
+ | (toUnorm(_src[2], 1023.0f)<<20)
+ | (toUnorm(_src[3], 3.0f)<<30)
+ ;
+ }
+
+ void unpackRgb10A2(float* _dst, const void* _src)
+ {
+ uint32_t packed = *( (const uint32_t*)_src);
+ _dst[0] = float( ( (packed ) & 0x3ff) ) / 1023.0f;
+ _dst[1] = float( ( (packed>>10) & 0x3ff) ) / 1023.0f;
+ _dst[2] = float( ( (packed>>20) & 0x3ff) ) / 1023.0f;
+ _dst[3] = float( ( (packed>>30) & 0x3) ) / 3.0f;
+ }
+
+ // R11G11B10F
+ void packR11G11B10F(void* _dst, const float* _src)
+ {
+ *( (uint32_t*)_dst) = 0
+ | ( (bx::halfFromFloat(_src[0])>> 4) & 0x7ff)
+ | ( (bx::halfFromFloat(_src[0])<< 7) & 0x3ff800)
+ | ( (bx::halfFromFloat(_src[0])<<17) & 0xffc00000)
+ ;
+ }
+
+ void unpackR11G11B10F(float* _dst, const void* _src)
+ {
+ uint32_t packed = *( (const uint32_t*)_src);
+ _dst[0] = bx::halfToFloat( (packed<< 4) & 0x7ff0);
+ _dst[1] = bx::halfToFloat( (packed>> 7) & 0x7ff0);
+ _dst[2] = bx::halfToFloat( (packed>>17) & 0x7fe0);
+ }
+
+ typedef void (*PackFn)(void*, const float*);
+ typedef void (*UnpackFn)(float*, const void*);
+
+ struct PackUnpack
+ {
+ PackFn pack;
+ UnpackFn unpack;
+ };
+
+ static PackUnpack s_packUnpack[] =
+ {
+ { NULL, NULL }, // BC1
+ { NULL, NULL }, // BC2
+ { NULL, NULL }, // BC3
+ { NULL, NULL }, // BC4
+ { NULL, NULL }, // BC5
+ { NULL, NULL }, // BC6H
+ { NULL, NULL }, // BC7
+ { NULL, NULL }, // ETC1
+ { NULL, NULL }, // ETC2
+ { NULL, NULL }, // ETC2A
+ { NULL, NULL }, // ETC2A1
+ { NULL, NULL }, // PTC12
+ { NULL, NULL }, // PTC14
+ { NULL, NULL }, // PTC12A
+ { NULL, NULL }, // PTC14A
+ { NULL, NULL }, // PTC22
+ { NULL, NULL }, // PTC24
+ { NULL, NULL }, // Unknown
+ { NULL, NULL }, // R1
+ { packR8, unpackR8 }, // A8
+ { packR8, unpackR8 }, // R8
+ { packR8I, unpackR8I }, // R8I
+ { packR8U, unpackR8U }, // R8U
+ { packR8S, unpackR8S }, // R8S
+ { packR16, unpackR16 }, // R16
+ { packR16I, unpackR16I }, // R16I
+ { packR16U, unpackR16U }, // R16U
+ { packR16F, unpackR16F }, // R16F
+ { packR16S, unpackR16S }, // R16S
+ { packR32I, unpackR32I }, // R32I
+ { packR32U, unpackR32U }, // R32U
+ { packR32F, unpackR32F }, // R32F
+ { packRg8, unpackRg8 }, // RG8
+ { packRg8I, unpackRg8I }, // RG8I
+ { packRg8U, unpackRg8U }, // RG8U
+ { packRg8S, unpackRg8S }, // RG8S
+ { packRg16, unpackRg16 }, // RG16
+ { packRg16I, unpackRg16I }, // RG16I
+ { packRg16U, unpackRg16U }, // RG16U
+ { packRg16F, unpackRg16F }, // RG16F
+ { packRg16S, unpackRg16S }, // RG16S
+ { packRg32I, unpackRg32I }, // RG32I
+ { packRg32U, unpackRg32U }, // RG32U
+ { packRg32F, unpackRg32F }, // RG32F
+ { packRgb9E5F, unpackRgb9E5F }, // RGB9E5F
+ { packBgra8, unpackBgra8 }, // BGRA8
+ { packRgba8, unpackRgba8 }, // RGBA8
+ { packRgba8I, unpackRgba8I }, // RGBA8I
+ { packRgba8U, unpackRgba8U }, // RGBA8U
+ { packRgba8S, unpackRgba8S }, // RGBA8S
+ { packRgba16, unpackRgba16 }, // RGBA16
+ { packRgba16I, unpackRgba16I }, // RGBA16I
+ { packRgba16U, unpackRgba16U }, // RGBA16U
+ { packRgba16F, unpackRgba16F }, // RGBA16F
+ { packRgba16S, unpackRgba16S }, // RGBA16S
+ { packRgba32I, unpackRgba32I }, // RGBA32I
+ { packRgba32U, unpackRgba32U }, // RGBA32U
+ { packRgba32F, unpackRgba32F }, // RGBA32F
+ { packR5G6B5, unpackR5G6B5 }, // R5G6B5
+ { packRgba4, unpackRgba4 }, // RGBA4
+ { packRgb5a1, unpackRgb5a1 }, // RGB5A1
+ { packRgb10A2, unpackRgb10A2 }, // RGB10A2
+ { packR11G11B10F, unpackR11G11B10F }, // R11G11B10F
+ { NULL, NULL }, // UnknownDepth
+ { NULL, NULL }, // D16
+ { NULL, NULL }, // D24
+ { NULL, NULL }, // D24S8
+ { NULL, NULL }, // D32
+ { NULL, NULL }, // D16F
+ { NULL, NULL }, // D24F
+ { NULL, NULL }, // D32F
+ { NULL, NULL }, // D0S8
+ };
+ BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_packUnpack) );
+
+ bool imageConvert(void* _dst, TextureFormat::Enum _dstFormat, const void* _src, TextureFormat::Enum _srcFormat, uint32_t _width, uint32_t _height)
+ {
+ UnpackFn unpack = s_packUnpack[_srcFormat].unpack;
+ PackFn pack = s_packUnpack[_dstFormat].pack;
+ if (NULL == pack
+ || NULL == unpack)
+ {
+ return false;
+ }
+
+ const uint8_t* src = (uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
+
+ const uint32_t srcBpp = s_imageBlockInfo[_srcFormat].bitsPerPixel;
+ const uint32_t dstBpp = s_imageBlockInfo[_dstFormat].bitsPerPixel;
+ const uint32_t srcPitch = _width * srcBpp / 8;
+ const uint32_t dstPitch = _width * dstBpp / 8;
+
+ for (uint32_t yy = 0; yy < _height; ++yy, src += srcPitch, dst += dstPitch)
+ {
+ for (uint32_t xx = 0; xx < _width; ++xx)
+ {
+ float rgba[4];
+ unpack(rgba, &src[xx*srcBpp/8]);
+ pack(&dst[xx*dstBpp/8], rgba);
+ }
+ }
+
+ return true;
}
uint8_t bitRangeConvert(uint32_t _in, uint32_t _from, uint32_t _to)
@@ -1324,6 +2213,34 @@ namespace bgfx
}
}
+ const Memory* imageAlloc(ImageContainer& _imageContainer, TextureFormat::Enum _format, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, bool _mips)
+ {
+ const uint8_t numMips = _mips ? imageGetNumMips(_format, _width, _height) : 1;
+ uint32_t size = imageGetSize(_format, _width, _height, 0, false, numMips);
+ const Memory* image = alloc(size);
+
+ _imageContainer.m_data = image->data;
+ _imageContainer.m_format = _format;
+ _imageContainer.m_size = image->size;
+ _imageContainer.m_offset = 0;
+ _imageContainer.m_width = _width;
+ _imageContainer.m_height = _height;
+ _imageContainer.m_depth = _depth;
+ _imageContainer.m_numMips = numMips;
+ _imageContainer.m_hasAlpha = false;
+ _imageContainer.m_cubeMap = _cubeMap;
+ _imageContainer.m_ktx = false;
+ _imageContainer.m_ktxLE = false;
+ _imageContainer.m_srgb = false;
+
+ return image;
+ }
+
+ void imageFree(const Memory* _memory)
+ {
+ release(_memory);
+ }
+
// DDS
#define DDS_MAGIC BX_MAKEFOURCC('D', 'D', 'S', ' ')
#define DDS_HEADER_SIZE 124
@@ -1670,7 +2587,7 @@ namespace bgfx
_imageContainer.m_width = width;
_imageContainer.m_height = height;
_imageContainer.m_depth = depth;
- _imageContainer.m_format = uint8_t(format);
+ _imageContainer.m_format = format;
_imageContainer.m_numMips = uint8_t( (caps[0] & DDSCAPS_MIPMAP) ? mips : 1);
_imageContainer.m_hasAlpha = hasAlpha;
_imageContainer.m_cubeMap = cubeMap;
@@ -1852,7 +2769,7 @@ namespace bgfx
{ KTX_RG32UI, KTX_ZERO, KTX_RG, KTX_UNSIGNED_INT, }, // RG32U
{ KTX_RG32F, KTX_ZERO, KTX_RG, KTX_FLOAT, }, // RG32F
{ KTX_RGB9_E5, KTX_ZERO, KTX_RGB, KTX_UNSIGNED_INT_5_9_9_9_REV, }, // RGB9E5F
- { KTX_RGBA8, KTX_SRGB8_ALPHA8, KTX_BGRA, KTX_UNSIGNED_BYTE, }, // BGRA8
+ { KTX_BGRA, KTX_SRGB8_ALPHA8, KTX_BGRA, KTX_UNSIGNED_BYTE, }, // BGRA8
{ KTX_RGBA8, KTX_SRGB8_ALPHA8, KTX_RGBA, KTX_UNSIGNED_BYTE, }, // RGBA8
{ KTX_RGBA8I, KTX_ZERO, KTX_RGBA, KTX_BYTE, }, // RGBA8I
{ KTX_RGBA8UI, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_BYTE, }, // RGBA8U
@@ -1946,7 +2863,7 @@ namespace bgfx
_imageContainer.m_width = width;
_imageContainer.m_height = height;
_imageContainer.m_depth = depth;
- _imageContainer.m_format = uint8_t(format);
+ _imageContainer.m_format = format;
_imageContainer.m_numMips = uint8_t(numMips);
_imageContainer.m_hasAlpha = hasAlpha;
_imageContainer.m_cubeMap = numFaces > 1;
@@ -2094,7 +3011,7 @@ namespace bgfx
_imageContainer.m_width = width;
_imageContainer.m_height = height;
_imageContainer.m_depth = depth;
- _imageContainer.m_format = uint8_t(format);
+ _imageContainer.m_format = format;
_imageContainer.m_numMips = uint8_t(numMips);
_imageContainer.m_hasAlpha = hasAlpha;
_imageContainer.m_cubeMap = numFaces > 1;
@@ -2161,16 +3078,17 @@ namespace bgfx
return imageParse(_imageContainer, &reader);
}
- void imageDecodeToBgra8(uint8_t* _dst, const uint8_t* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, uint8_t _type)
+ void imageDecodeToBgra8(void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format)
{
- const uint8_t* src = _src;
+ const uint8_t* src = (const uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
uint32_t width = _width/4;
uint32_t height = _height/4;
uint8_t temp[16*4];
- switch (_type)
+ switch (_format)
{
case TextureFormat::BC1:
for (uint32_t yy = 0; yy < height; ++yy)
@@ -2180,11 +3098,11 @@ namespace bgfx
decodeBlockDxt1(temp, src);
src += 8;
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2199,11 +3117,11 @@ namespace bgfx
decodeBlockDxt(temp, src);
src += 8;
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2218,11 +3136,11 @@ namespace bgfx
decodeBlockDxt(temp, src);
src += 8;
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2235,11 +3153,11 @@ namespace bgfx
decodeBlockDxt45A(temp, src);
src += 8;
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2249,10 +3167,10 @@ namespace bgfx
{
for (uint32_t xx = 0; xx < width; ++xx)
{
- decodeBlockDxt45A(temp+1, src);
- src += 8;
decodeBlockDxt45A(temp+2, src);
src += 8;
+ decodeBlockDxt45A(temp+1, src);
+ src += 8;
for (uint32_t ii = 0; ii < 16; ++ii)
{
@@ -2263,11 +3181,11 @@ namespace bgfx
temp[ii*4+3] = 0;
}
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2281,11 +3199,11 @@ namespace bgfx
decodeBlockEtc12(temp, src);
src += 8;
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2317,11 +3235,11 @@ namespace bgfx
{
decodeBlockPtc14(temp, src, xx, yy, width, height);
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2333,11 +3251,11 @@ namespace bgfx
{
decodeBlockPtc14A(temp, src, xx, yy, width, height);
- uint8_t* dst = &_dst[(yy*_pitch+xx*4)*4];
- memcpy(&dst[0*_pitch], &temp[ 0], 16);
- memcpy(&dst[1*_pitch], &temp[16], 16);
- memcpy(&dst[2*_pitch], &temp[32], 16);
- memcpy(&dst[3*_pitch], &temp[48], 16);
+ uint8_t* block = &dst[(yy*_pitch+xx*4)*4];
+ memcpy(&block[0*_pitch], &temp[ 0], 16);
+ memcpy(&block[1*_pitch], &temp[16], 16);
+ memcpy(&block[2*_pitch], &temp[32], 16);
+ memcpy(&block[3*_pitch], &temp[48], 16);
}
}
break;
@@ -2367,9 +3285,9 @@ namespace bgfx
}
}
- void imageDecodeToRgba8(uint8_t* _dst, const uint8_t* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, uint8_t _type)
+ void imageDecodeToRgba8(void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format)
{
- switch (_type)
+ switch (_format)
{
case TextureFormat::RGBA8:
memcpy(_dst, _src, _pitch*_height);
@@ -2380,12 +3298,136 @@ namespace bgfx
break;
default:
- imageDecodeToBgra8(_dst, _src, _width, _height, _pitch, _type);
+ imageDecodeToBgra8(_dst, _src, _width, _height, _pitch, _format);
imageSwizzleBgra8(_width, _height, _pitch, _dst, _dst);
break;
}
}
+ void imageRgba8ToRgba32fRef(void* _dst, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src)
+ {
+ const uint32_t dstwidth = _width;
+ const uint32_t dstheight = _height;
+
+ if (0 == dstwidth
+ || 0 == dstheight)
+ {
+ return;
+ }
+
+ float* dst = (float*)_dst;
+ const uint8_t* src = (const uint8_t*)_src;
+
+ for (uint32_t yy = 0, ystep = _pitch; yy < dstheight; ++yy, src += ystep)
+ {
+ const uint8_t* rgba = src;
+ for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 4, dst += 4)
+ {
+ dst[0] = powf(rgba[ 0], 2.2f);
+ dst[1] = powf(rgba[ 1], 2.2f);
+ dst[2] = powf(rgba[ 2], 2.2f);
+ dst[3] = rgba[ 3];
+ }
+ }
+ }
+
+ void imageRgba8ToRgba32f(void* _dst, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src)
+ {
+ const uint32_t dstwidth = _width;
+ const uint32_t dstheight = _height;
+
+ if (0 == dstwidth
+ || 0 == dstheight)
+ {
+ return;
+ }
+
+ float* dst = (float*)_dst;
+ const uint8_t* src = (const uint8_t*)_src;
+
+ using namespace bx;
+ const float4_t unpack = float4_ld(1.0f, 1.0f/256.0f, 1.0f/65536.0f, 1.0f/16777216.0f);
+ const float4_t umask = float4_ild(0xff, 0xff00, 0xff0000, 0xff000000);
+ const float4_t wflip = float4_ild(0, 0, 0, 0x80000000);
+ const float4_t wadd = float4_ld(0.0f, 0.0f, 0.0f, 32768.0f*65536.0f);
+
+ for (uint32_t yy = 0, ystep = _pitch; yy < dstheight; ++yy, src += ystep)
+ {
+ const uint8_t* rgba = src;
+ for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 4, dst += 4)
+ {
+ const float4_t abgr0 = float4_splat(rgba);
+ const float4_t abgr0m = float4_and(abgr0, umask);
+ const float4_t abgr0x = float4_xor(abgr0m, wflip);
+ const float4_t abgr0f = float4_itof(abgr0x);
+ const float4_t abgr0c = float4_add(abgr0f, wadd);
+ const float4_t abgr0n = float4_mul(abgr0c, unpack);
+
+ float4_st(dst, abgr0n);
+ }
+ }
+ }
+
+ void imageDecodeToRgba32f(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
+
+ switch (_format)
+ {
+ case TextureFormat::BC5:
+ {
+ uint32_t width = _width/4;
+ uint32_t height = _height/4;
+
+ for (uint32_t yy = 0; yy < height; ++yy)
+ {
+ for (uint32_t xx = 0; xx < width; ++xx)
+ {
+ uint8_t temp[16*4];
+
+ decodeBlockDxt45A(temp+2, src);
+ src += 8;
+ decodeBlockDxt45A(temp+1, src);
+ src += 8;
+
+ for (uint32_t ii = 0; ii < 16; ++ii)
+ {
+ float nx = temp[ii*4+2]*2.0f/255.0f - 1.0f;
+ float ny = temp[ii*4+1]*2.0f/255.0f - 1.0f;
+ float nz = sqrtf(1.0f - nx*nx - ny*ny);
+
+ const uint32_t offset = (yy*4 + ii/4)*_width*16 + (xx*4 + ii%4)*16;
+ float* block = (float*)&dst[offset];
+ block[0] = nx;
+ block[1] = ny;
+ block[2] = nz;
+ block[3] = 0.0f;
+ }
+ }
+ }
+ }
+ break;
+
+ case TextureFormat::RGBA32F:
+ memcpy(_dst, _src, _pitch*_height);
+ break;
+
+ case TextureFormat::RGBA8:
+ imageRgba8ToRgba32f(_dst, _width, _height, _pitch, _src);
+ break;
+
+ default:
+ {
+ void* temp = BX_ALLOC(_allocator, imageGetSize(_format, uint16_t(_pitch/4), uint16_t(_height) ) );
+ imageDecodeToRgba8(temp, _src, _width, _height, _pitch, _format);
+ imageRgba8ToRgba32f(_dst, _width, _height, _pitch, temp);
+ BX_FREE(_allocator, temp);
+ }
+ break;
+ }
+ }
+
bool imageGetRawData(const ImageContainer& _imageContainer, uint8_t _side, uint8_t _lod, const void* _data, uint32_t _size, ImageMip& _mip)
{
uint32_t offset = _imageContainer.m_offset;
@@ -2443,7 +3485,7 @@ namespace bgfx
_mip.m_size = size;
_mip.m_data = &data[offset];
_mip.m_bpp = bpp;
- _mip.m_format = uint8_t(format);
+ _mip.m_format = format;
_mip.m_hasAlpha = hasAlpha;
return true;
}
@@ -2484,7 +3526,7 @@ namespace bgfx
_mip.m_size = size;
_mip.m_data = &data[offset];
_mip.m_bpp = bpp;
- _mip.m_format = uint8_t(format);
+ _mip.m_format = format;
_mip.m_hasAlpha = hasAlpha;
return true;
}
@@ -2504,7 +3546,7 @@ namespace bgfx
return false;
}
- void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip)
+ void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, bool _grayscale, bool _yflip)
{
uint8_t type = _grayscale ? 3 : 2;
uint8_t bpp = _grayscale ? 8 : 32;
@@ -2523,16 +3565,16 @@ namespace bgfx
uint32_t dstPitch = _width*bpp/8;
if (_yflip)
{
- uint8_t* data = (uint8_t*)_src + _srcPitch*_height - _srcPitch;
+ uint8_t* data = (uint8_t*)_src + _pitch*_height - _pitch;
for (uint32_t yy = 0; yy < _height; ++yy)
{
bx::write(_writer, data, dstPitch);
- data -= _srcPitch;
+ data -= _pitch;
}
}
- else if (_srcPitch == dstPitch)
+ else if (_pitch == dstPitch)
{
- bx::write(_writer, _src, _height*_srcPitch);
+ bx::write(_writer, _src, _height*_pitch);
}
else
{
@@ -2540,7 +3582,7 @@ namespace bgfx
for (uint32_t yy = 0; yy < _height; ++yy)
{
bx::write(_writer, data, dstPitch);
- data += _srcPitch;
+ data += _pitch;
}
}
}
diff --git a/3rdparty/bgfx/src/image.h b/3rdparty/bgfx/src/image.h
index 50824e5fd9e..458d7e51c46 100644
--- a/3rdparty/bgfx/src/image.h
+++ b/3rdparty/bgfx/src/image.h
@@ -13,12 +13,12 @@ namespace bgfx
struct ImageContainer
{
void* m_data;
+ TextureFormat::Enum m_format;
uint32_t m_size;
uint32_t m_offset;
uint32_t m_width;
uint32_t m_height;
uint32_t m_depth;
- uint8_t m_format;
uint8_t m_numMips;
bool m_hasAlpha;
bool m_cubeMap;
@@ -29,12 +29,12 @@ namespace bgfx
struct ImageMip
{
+ TextureFormat::Enum m_format;
uint32_t m_width;
uint32_t m_height;
uint32_t m_blockSize;
uint32_t m_size;
uint8_t m_bpp;
- uint8_t m_format;
bool m_hasAlpha;
const uint8_t* m_data;
};
@@ -103,19 +103,31 @@ namespace bgfx
void imageCheckerboard(uint32_t _width, uint32_t _height, uint32_t _step, uint32_t _0, uint32_t _1, void* _dst);
///
- void imageRgba8Downsample2x2(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst);
+ void imageRgba8Downsample2x2(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
///
- void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst);
+ void imageRgba32fDownsample2x2NormalMap(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
+
+ ///
+ void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
///
void imageCopy(uint32_t _height, uint32_t _srcPitch, const void* _src, uint32_t _dstPitch, void* _dst);
///
- void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst);
+ void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _pitch, const void* _src, void* _dst);
+
+ ///
+ bool imageConvert(void* _dst, TextureFormat::Enum _dstFormat, const void* _src, TextureFormat::Enum _srcFormat, uint32_t _width, uint32_t _height);
+
+ ///
+ const Memory* imageAlloc(ImageContainer& _imageContainer, TextureFormat::Enum _format, uint16_t _width, uint16_t _height, uint16_t _depth = 0, bool _cubeMap = false, bool _mips = false);
+
+ ///
+ void imageFree(const Memory* _memory);
///
- void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip);
+ void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, bool _grayscale, bool _yflip);
///
void imageWriteKtx(bx::WriterI* _writer, TextureFormat::Enum _format, bool _cubeMap, uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _numMips, const void* _src);
@@ -130,10 +142,13 @@ namespace bgfx
bool imageParse(ImageContainer& _imageContainer, const void* _data, uint32_t _size);
///
- void imageDecodeToBgra8(uint8_t* _dst, const uint8_t* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, uint8_t _type);
+ void imageDecodeToBgra8(void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format);
+
+ ///
+ void imageDecodeToRgba8(void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format);
///
- void imageDecodeToRgba8(uint8_t* _dst, const uint8_t* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, uint8_t _type);
+ void imageDecodeToRgba32f(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format);
///
bool imageGetRawData(const ImageContainer& _imageContainer, uint8_t _side, uint8_t _index, const void* _data, uint32_t _size, ImageMip& _mip);
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index 9fc75a8c452..1e36af03985 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -487,6 +487,8 @@ namespace bgfx { namespace d3d11
return false;
};
+ // Reference:
+ // https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK
enum AGS_RETURN_CODE
{
AGS_SUCCESS,
@@ -1465,6 +1467,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
BGFX_GPU_PROFILER_BIND(m_device, m_deviceCtx);
+
+ g_internalData.context = m_device;
return true;
error:
@@ -1742,7 +1746,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
tc.m_sides = 0;
tc.m_depth = 0;
tc.m_numMips = 1;
- tc.m_format = texture.m_requestedFormat;
+ tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
bx::write(&writer, tc);
@@ -1753,6 +1757,22 @@ BX_PRAGMA_DIAGNOSTIC_POP();
release(mem);
}
+ void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
+ {
+ // Resource ref. counts might be messed up outside of bgfx.
+ // Disabling ref. count check once texture is overridden.
+ setGraphicsDebuggerPresent(true);
+ m_textures[_handle.idx].overrideInternal(_ptr);
+ }
+
+ uintptr_t getInternal(TextureHandle _handle) BX_OVERRIDE
+ {
+ // Resource ref. counts might be messed up outside of bgfx.
+ // Disabling ref. count check once texture is overridden.
+ setGraphicsDebuggerPresent(true);
+ return uintptr_t(m_textures[_handle.idx].m_ptr);
+ }
+
void destroyTexture(TextureHandle _handle) BX_OVERRIDE
{
m_textures[_handle.idx].destroy();
@@ -2224,6 +2244,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
else
{
+ m_deviceCtx->ClearState();
+ m_deviceCtx->Flush();
+
if (resize)
{
m_deviceCtx->OMSetRenderTargets(1, s_zero.m_rtv, NULL);
@@ -3078,6 +3101,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
D3D11_MAPPED_SUBRESOURCE mapped;
DX_CHECK(m_deviceCtx->Map(m_captureTexture, 0, D3D11_MAP_READ, 0, &mapped) );
+ imageSwizzleBgra8(getBufferWidth()
+ , getBufferHeight()
+ , mapped.RowPitch
+ , mapped.pData
+ , mapped.pData
+ );
+
g_callback->captureFrame(mapped.pData, getBufferHeight()*mapped.RowPitch);
m_deviceCtx->Unmap(m_captureTexture, 0);
@@ -3999,7 +4029,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
}
- const bool bufferOnly = 0 != (m_flags&(BGFX_TEXTURE_RT_BUFFER_ONLY|BGFX_TEXTURE_READ_BACK) );
+ const bool writeOnly = 0 != (m_flags&(BGFX_TEXTURE_RT_WRITE_ONLY|BGFX_TEXTURE_READ_BACK) );
const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK);
const bool srgb = 0 != (m_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb;
@@ -4043,7 +4073,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
desc.Format = format;
desc.SampleDesc = msaa;
desc.Usage = kk == 0 || blit ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE;
- desc.BindFlags = bufferOnly ? 0 : D3D11_BIND_SHADER_RESOURCE;
+ desc.BindFlags = writeOnly ? 0 : D3D11_BIND_SHADER_RESOURCE;
desc.CPUAccessFlags = 0;
if (isDepth( (TextureFormat::Enum)m_textureFormat) )
@@ -4116,7 +4146,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
break;
}
- if (!bufferOnly)
+ if (!writeOnly)
{
DX_CHECK(s_renderD3D11->m_device->CreateShaderResourceView(m_ptr, &srvd, &m_srv) );
}
@@ -4147,7 +4177,19 @@ BX_PRAGMA_DIAGNOSTIC_POP();
s_renderD3D11->m_srvUavLru.invalidateWithParent(getHandle().idx);
DX_RELEASE(m_srv, 0);
DX_RELEASE(m_uav, 0);
- DX_RELEASE(m_ptr, 0);
+ if (0 == (m_flags & BGFX_TEXTURE_INTERNAL_SHARED) )
+ {
+ DX_RELEASE(m_ptr, 0);
+ }
+ }
+
+ void TextureD3D11::overrideInternal(uintptr_t _ptr)
+ {
+ destroy();
+ m_flags |= BGFX_TEXTURE_INTERNAL_SHARED;
+ m_ptr = (ID3D11Resource*)_ptr;
+
+ s_renderD3D11->m_device->CreateShaderResourceView(m_ptr, NULL, &m_srv);
}
void TextureD3D11::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
@@ -4175,7 +4217,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (convert)
{
temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height);
- imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat);
+ imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, TextureFormat::Enum(m_requestedFormat) );
data = temp;
}
@@ -4727,7 +4769,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
// reset the framebuffer to be the backbuffer; depending on the swap effect,
// if we don't do this we'll only see one frame of output and then nothing
- setFrameBuffer(fbh);
+ FrameBufferHandle invalid = BGFX_INVALID_HANDLE;
+ setFrameBuffer(invalid);
bool viewRestart = false;
uint8_t eye = 0;
@@ -4887,12 +4930,18 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
else
{
+ bool depthStencil = isDepth(TextureFormat::Enum(src.m_textureFormat) );
+ BX_CHECK(!depthStencil
+ || (width == src.m_width && height == src.m_height)
+ , "When blitting depthstencil surface, source resolution must match destination."
+ );
+
D3D11_BOX box;
box.left = blit.m_srcX;
box.top = blit.m_srcY;
box.front = 0;
box.right = blit.m_srcX + width;
- box.bottom = blit.m_srcY + height;;
+ box.bottom = blit.m_srcY + height;
box.back = 1;
const uint32_t srcZ = TextureD3D11::TextureCube == src.m_type
@@ -4904,7 +4953,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
: 0
;
- bool depthStencil = isDepth(TextureFormat::Enum(src.m_textureFormat) );
deviceCtx->CopySubresourceRegion(dst.m_ptr
, dstZ*dst.m_numMips+blit.m_dstMip
, blit.m_dstX
diff --git a/3rdparty/bgfx/src/renderer_d3d11.h b/3rdparty/bgfx/src/renderer_d3d11.h
index 67c05eb8161..151d3ce5cc7 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.h
+++ b/3rdparty/bgfx/src/renderer_d3d11.h
@@ -223,6 +223,7 @@ namespace bgfx { namespace d3d11
void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
void destroy();
+ void overrideInternal(uintptr_t _ptr);
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
void commit(uint8_t _stage, uint32_t _flags, const float _palette[][4]);
void resolve();
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index 22251bebf9d..76eb52e0e21 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -1042,6 +1042,8 @@ namespace bgfx { namespace d3d12
m_gpuTimer.init();
m_occlusionQuery.init();
}
+
+ g_internalData.context = m_device;
return true;
error:
@@ -1359,7 +1361,7 @@ namespace bgfx { namespace d3d12
tc.m_sides = 0;
tc.m_depth = 0;
tc.m_numMips = 1;
- tc.m_format = texture.m_requestedFormat;
+ tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
bx::write(&writer, tc);
@@ -1370,6 +1372,17 @@ namespace bgfx { namespace d3d12
release(mem);
}
+ void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
+ {
+ BX_UNUSED(_handle, _ptr);
+ }
+
+ uintptr_t getInternal(TextureHandle _handle) BX_OVERRIDE
+ {
+ BX_UNUSED(_handle);
+ return 0;
+ }
+
void destroyTexture(TextureHandle _handle) BX_OVERRIDE
{
m_textures[_handle.idx].destroy();
@@ -1860,8 +1873,8 @@ data.NumQualityLevels = 0;
if (isValid(frameBuffer.m_depth) )
{
TextureD3D12& texture = m_textures[frameBuffer.m_depth.idx];
- const bool bufferOnly = 0 != (texture.m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
- if (!bufferOnly)
+ const bool writeOnly = 0 != (texture.m_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
+ if (!writeOnly)
{
texture.setState(m_commandList, D3D12_RESOURCE_STATE_DEPTH_READ);
}
@@ -3801,7 +3814,7 @@ data.NumQualityLevels = 0;
blockHeight = blockInfo.blockHeight;
}
- const bool bufferOnly = 0 != (m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ const bool writeOnly = 0 != (m_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK);
@@ -3813,7 +3826,7 @@ data.NumQualityLevels = 0;
, textureHeight
, imageContainer.m_cubeMap ? "x6" : ""
, renderTarget ? 'x' : ' '
- , bufferOnly ? 'x' : ' '
+ , writeOnly ? 'x' : ' '
, computeWrite ? 'x' : ' '
, swizzle ? " (swizzle BGRA8 -> RGBA8)" : ""
);
@@ -3969,7 +3982,7 @@ data.NumQualityLevels = 0;
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
}
- if (bufferOnly)
+ if (writeOnly)
{
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index dc51a9eef3f..4fb4d435b4a 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -603,85 +603,85 @@ namespace bgfx { namespace d3d9
s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN;
g_caps.supported |= m_instancingSupport ? BGFX_CAPS_INSTANCING : 0;
+ }
- for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
- {
- uint8_t support = 0;
+ for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+ {
+ uint8_t support = 0;
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , 0
- , D3DRTYPE_TEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , D3DUSAGE_QUERY_SRGBREAD
- , D3DRTYPE_TEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , 0
- , D3DRTYPE_VOLUMETEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , D3DUSAGE_QUERY_SRGBREAD
- , D3DRTYPE_VOLUMETEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , 0
- , D3DRTYPE_CUBETEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , D3DUSAGE_QUERY_SRGBREAD
- , D3DRTYPE_CUBETEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , D3DUSAGE_QUERY_VERTEXTEXTURE
- , D3DRTYPE_TEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
- , m_deviceType
- , adapterFormat
- , isDepth(TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET
- , D3DRTYPE_TEXTURE
- , s_textureFormat[ii].m_fmt
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
-
- support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter
- , m_deviceType
- , s_textureFormat[ii].m_fmt
- , true
- , D3DMULTISAMPLE_2_SAMPLES
- , NULL
- ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , 0
+ , D3DRTYPE_TEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
- g_caps.formats[ii] = support;
- }
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , D3DUSAGE_QUERY_SRGBREAD
+ , D3DRTYPE_TEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , 0
+ , D3DRTYPE_VOLUMETEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , D3DUSAGE_QUERY_SRGBREAD
+ , D3DRTYPE_VOLUMETEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , 0
+ , D3DRTYPE_CUBETEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , D3DUSAGE_QUERY_SRGBREAD
+ , D3DRTYPE_CUBETEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , D3DUSAGE_QUERY_VERTEXTEXTURE
+ , D3DRTYPE_TEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , isDepth(TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET
+ , D3DRTYPE_TEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter
+ , m_deviceType
+ , s_textureFormat[ii].m_fmt
+ , true
+ , D3DMULTISAMPLE_2_SAMPLES
+ , NULL
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ g_caps.formats[ii] = support;
}
m_fmtDepth = D3DFMT_D24S8;
@@ -752,6 +752,7 @@ namespace bgfx { namespace d3d9
m_initialized = true;
+ g_internalData.context = m_device;
return true;
error:
@@ -996,6 +997,22 @@ namespace bgfx { namespace d3d9
texture.m_height = _height;
}
+ void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
+ {
+ // Resource ref. counts might be messed up outside of bgfx.
+ // Disabling ref. count check once texture is overridden.
+ setGraphicsDebuggerPresent(true);
+ m_textures[_handle.idx].overrideInternal(_ptr);
+ }
+
+ uintptr_t getInternal(TextureHandle _handle) BX_OVERRIDE
+ {
+ // Resource ref. counts might be messed up outside of bgfx.
+ // Disabling ref. count check once texture is overridden.
+ setGraphicsDebuggerPresent(true);
+ return uintptr_t(m_textures[_handle.idx].m_ptr);
+ }
+
void destroyTexture(TextureHandle _handle) BX_OVERRIDE
{
m_textures[_handle.idx].destroy();
@@ -1925,30 +1942,34 @@ namespace bgfx { namespace d3d9
device->SetVertexShader(program.m_vsh->m_vertexShader);
device->SetPixelShader(program.m_fsh->m_pixelShader);
+ float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
+
if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
{
- float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
for (uint32_t ii = 0; ii < numMrt; ++ii)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE - 1, _clear.m_index[ii]);
memcpy(mrtClear[ii], _palette[index], 16);
}
-
- DX_CHECK(m_device->SetPixelShaderConstantF(0, mrtClear[0], numMrt) );
}
else
{
float rgba[4] =
{
- _clear.m_index[0]*1.0f/255.0f,
- _clear.m_index[1]*1.0f/255.0f,
- _clear.m_index[2]*1.0f/255.0f,
- _clear.m_index[3]*1.0f/255.0f,
+ _clear.m_index[0] * 1.0f / 255.0f,
+ _clear.m_index[1] * 1.0f / 255.0f,
+ _clear.m_index[2] * 1.0f / 255.0f,
+ _clear.m_index[3] * 1.0f / 255.0f,
};
- DX_CHECK(m_device->SetPixelShaderConstantF(0, rgba, 1) );
+ for (uint32_t ii = 0; ii < numMrt; ++ii)
+ {
+ memcpy(mrtClear[ii], rgba, 16);
+ }
}
+ DX_CHECK(device->SetPixelShaderConstantF(0, mrtClear[0], numMrt));
+
DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, stride) );
DX_CHECK(device->SetStreamSourceFreq(0, 1) );
DX_CHECK(device->SetStreamSource(1, NULL, 0, 0) );
@@ -2427,10 +2448,10 @@ namespace bgfx { namespace d3d9
uint32_t msaaQuality = ( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT);
msaaQuality = bx::uint32_satsub(msaaQuality, 1);
- bool bufferOnly = 0 != (m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ bool writeOnly = 0 != (m_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
if (0 != msaaQuality
- || bufferOnly)
+ || writeOnly)
{
const Msaa& msaa = s_msaa[msaaQuality];
@@ -2461,7 +2482,7 @@ namespace bgfx { namespace d3d9
) );
}
- if (bufferOnly)
+ if (writeOnly)
{
// This is render buffer, there is no sampling, no need
// to create texture.
@@ -2798,8 +2819,8 @@ namespace bgfx { namespace d3d9
m_height = textureHeight;
m_depth = imageContainer.m_depth;
m_numMips = numMips;
- m_requestedFormat = imageContainer.m_format;
- m_textureFormat = imageContainer.m_format;
+ m_requestedFormat =
+ m_textureFormat = uint8_t(imageContainer.m_format);
const TextureFormatInfo& tfi = s_textureFormat[m_requestedFormat];
uint8_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
@@ -2837,7 +2858,7 @@ namespace bgfx { namespace d3d9
, 0 != (m_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : ""
);
- if (0 != (_flags&BGFX_TEXTURE_RT_BUFFER_ONLY) )
+ if (0 != (_flags&BGFX_TEXTURE_RT_WRITE_ONLY) )
{
return;
}
@@ -2892,13 +2913,7 @@ namespace bgfx { namespace d3d9
, mip.m_format
);
- uint32_t dstpitch = pitch;
- for (uint32_t yy = 0; yy < height; ++yy)
- {
- uint8_t* src = &temp[yy*srcpitch];
- uint8_t* dst = &bits[yy*dstpitch];
- memcpy(dst, src, dstpitch);
- }
+ bx::memCopy(bits, temp, pitch, height, srcpitch, pitch);
BX_FREE(g_allocator, temp);
}
@@ -2950,7 +2965,7 @@ namespace bgfx { namespace d3d9
if (convert)
{
temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height);
- imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat);
+ imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, TextureFormat::Enum(m_requestedFormat) );
data = temp;
}
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index 0bef1737058..aecfba57322 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -325,12 +325,22 @@ namespace bgfx { namespace d3d9
void destroy()
{
- DX_RELEASE(m_ptr, 0);
+ if (0 == (m_flags & BGFX_TEXTURE_INTERNAL_SHARED) )
+ {
+ DX_RELEASE(m_ptr, 0);
+ }
DX_RELEASE(m_surface, 0);
DX_RELEASE(m_staging, 0);
m_textureFormat = TextureFormat::Unknown;
}
+ void overrideInternal(uintptr_t _ptr)
+ {
+ destroy();
+ m_flags |= BGFX_TEXTURE_INTERNAL_SHARED;
+ m_ptr = (IDirect3DBaseTexture9*)_ptr;
+ }
+
void updateBegin(uint8_t _side, uint8_t _mip);
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
void updateEnd();
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index 35fbdc427cf..be4ab0a09d7 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -260,9 +260,9 @@ namespace bgfx { namespace gl
{ GL_RGBA32I, GL_ZERO, GL_RGBA, GL_INT, false }, // RGBA32I
{ GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32U
{ GL_RGBA32F, GL_ZERO, GL_RGBA, GL_FLOAT, false }, // RGBA32F
- { GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
- { GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, false }, // RGBA4
- { GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, false }, // RGB5A1
+ { GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, false }, // R5G6B5
+ { GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false }, // RGBA4
+ { GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false }, // RGB5A1
{ GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false }, // RGB10A2
{ GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false }, // R11G11B10F
{ GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // UnknownDepth
@@ -1209,6 +1209,34 @@ namespace bgfx { namespace gl
_minFilter = s_textureFilterMin[min][_hasMips ? mip+1 : 0];
}
+ void updateExtension(const char* _name)
+ {
+ bool supported = false;
+ for (uint32_t ii = 0; ii < Extension::Count; ++ii)
+ {
+ Extension& extension = s_extension[ii];
+ if (!extension.m_supported
+ && extension.m_initialize)
+ {
+ const char* ext = _name;
+ if (0 == strncmp(ext, "GL_", 3) ) // skip GL_
+ {
+ ext += 3;
+ }
+
+ if (0 == strcmp(ext, extension.m_name) )
+ {
+ extension.m_supported = true;
+ supported = true;
+ break;
+ }
+ }
+ }
+
+ BX_TRACE("GL_EXTENSION %s: %s", supported ? " (supported)" : "", _name);
+ BX_UNUSED(supported);
+ }
+
struct RendererContextGL : public RendererContextI
{
RendererContextGL()
@@ -1365,42 +1393,31 @@ namespace bgfx { namespace gl
strncpy(name, pos, len);
name[len] = '\0';
- bool supported = false;
- for (uint32_t ii = 0; ii < Extension::Count; ++ii)
- {
- Extension& extension = s_extension[ii];
- if (!extension.m_supported
- && extension.m_initialize)
- {
- const char* ext = name;
- if (0 == strncmp(ext, "GL_", 3) ) // skip GL_
- {
- ext += 3;
- }
-
- if (0 == strcmp(ext, extension.m_name) )
- {
- extension.m_supported = true;
- supported = true;
- break;
- }
- }
- }
-
- BX_TRACE("GL_EXTENSION %3d%s: %s", index, supported ? " (supported)" : "", name);
- BX_UNUSED(supported);
+ updateExtension(name);
pos += len+1;
++index;
}
+ }
+ else if (NULL != glGetStringi)
+ {
+ GLint numExtensions = 0;
+ glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
+ glGetError(); // ignore error if glGetIntegerv returns NULL.
- BX_TRACE("Supported extensions:");
- for (uint32_t ii = 0; ii < Extension::Count; ++ii)
+ for (GLint index = 0; index < numExtensions; ++index)
{
- if (s_extension[ii].m_supported)
- {
- BX_TRACE("\t%2d: %s", ii, s_extension[ii].m_name);
- }
+ const char* name = (const char*)glGetStringi(GL_EXTENSIONS, index);
+ updateExtension(name);
+ }
+ }
+
+ BX_TRACE("Supported extensions:");
+ for (uint32_t ii = 0; ii < Extension::Count; ++ii)
+ {
+ if (s_extension[ii].m_supported)
+ {
+ BX_TRACE("\t%2d: %s", ii, s_extension[ii].m_name);
}
}
}
@@ -1502,9 +1519,9 @@ 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::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
- setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
- setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
+ setTextureFormat(TextureFormat::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV);
+ setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV);
+ setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
if (s_extension[Extension::OES_texture_half_float].m_supported
|| s_extension[Extension::OES_texture_float ].m_supported)
@@ -2200,7 +2217,7 @@ namespace bgfx { namespace gl
tc.m_sides = 0;
tc.m_depth = 0;
tc.m_numMips = 1;
- tc.m_format = texture.m_requestedFormat;
+ tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
bx::write(&writer, tc);
@@ -2211,6 +2228,16 @@ namespace bgfx { namespace gl
release(mem);
}
+ void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].overrideInternal(_ptr);
+ }
+
+ uintptr_t getInternal(TextureHandle _handle) BX_OVERRIDE
+ {
+ return uintptr_t(m_textures[_handle.idx].m_id);
+ }
+
void destroyTexture(TextureHandle _handle) BX_OVERRIDE
{
m_textures[_handle.idx].destroy();
@@ -2882,6 +2909,11 @@ namespace bgfx { namespace gl
, m_capture
) );
+ if (GL_RGBA == m_readPixelsFmt)
+ {
+ imageSwizzleBgra8(m_resolution.m_width, m_resolution.m_height, m_resolution.m_width*4, m_capture, m_capture);
+ }
+
g_callback->captureFrame(m_capture, m_captureSize);
}
}
@@ -3171,29 +3203,34 @@ namespace bgfx { namespace gl
GL_CHECK(glUseProgram(program.m_id) );
program.bindAttributes(vertexDecl, 0);
+ float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
+
if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
{
- float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
for (uint32_t ii = 0; ii < numMrt; ++ii)
{
uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]);
memcpy(mrtClear[ii], _palette[index], 16);
}
-
- GL_CHECK(glUniform4fv(0, numMrt, mrtClear[0]) );
}
else
{
float rgba[4] =
{
- _clear.m_index[0]*1.0f/255.0f,
- _clear.m_index[1]*1.0f/255.0f,
- _clear.m_index[2]*1.0f/255.0f,
- _clear.m_index[3]*1.0f/255.0f,
+ _clear.m_index[0] * 1.0f / 255.0f,
+ _clear.m_index[1] * 1.0f / 255.0f,
+ _clear.m_index[2] * 1.0f / 255.0f,
+ _clear.m_index[3] * 1.0f / 255.0f,
};
- GL_CHECK(glUniform4fv(0, 1, rgba) );
+
+ for (uint32_t ii = 0; ii < numMrt; ++ii)
+ {
+ memcpy(mrtClear[ii], rgba, 16);
+ }
}
+ GL_CHECK(glUniform4fv(0, numMrt, mrtClear[0]) );
+
GL_CHECK(glDrawArrays(GL_TRIANGLE_STRIP
, 0
, 4
@@ -3909,7 +3946,7 @@ namespace bgfx { namespace gl
}
}
- bool TextureGL::init(GLenum _target, uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _format, uint8_t _numMips, uint32_t _flags)
+ bool TextureGL::init(GLenum _target, uint32_t _width, uint32_t _height, uint32_t _depth, TextureFormat::Enum _format, uint8_t _numMips, uint32_t _flags)
{
m_target = _target;
m_numMips = _numMips;
@@ -3918,13 +3955,13 @@ namespace bgfx { namespace gl
m_height = _height;
m_depth = _depth;
m_currentSamplerHash = UINT32_MAX;
- m_requestedFormat = _format;
- m_textureFormat = _format;
+ m_requestedFormat =
+ m_textureFormat = uint8_t(_format);
- const bool bufferOnly = 0 != (m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ const bool writeOnly = 0 != (m_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE );
- if (!bufferOnly)
+ if (!writeOnly)
{
GL_CHECK(glGenTextures(1, &m_id) );
BX_CHECK(0 != m_id, "Failed to generate texture id.");
@@ -3998,7 +4035,7 @@ namespace bgfx { namespace gl
msaaQuality = bx::uint32_min(s_renderGL->m_maxMsaa, msaaQuality == 0 ? 0 : 1<<msaaQuality);
if (0 != msaaQuality
- || bufferOnly)
+ || writeOnly)
{
GL_CHECK(glGenRenderbuffers(1, &m_rbo) );
BX_CHECK(0 != m_rbo, "Failed to generate renderbuffer id.");
@@ -4024,7 +4061,7 @@ namespace bgfx { namespace gl
GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, 0) );
- if (bufferOnly)
+ if (writeOnly)
{
// This is render buffer, there is no sampling, no need
// to create texture.
@@ -4234,7 +4271,8 @@ namespace bgfx { namespace gl
void TextureGL::destroy()
{
- if (0 != m_id)
+ if (0 == (m_flags & BGFX_TEXTURE_INTERNAL_SHARED)
+ && 0 != m_id)
{
GL_CHECK(glBindTexture(m_target, 0) );
GL_CHECK(glDeleteTextures(1, &m_id) );
@@ -4248,6 +4286,13 @@ namespace bgfx { namespace gl
}
}
+ void TextureGL::overrideInternal(uintptr_t _ptr)
+ {
+ destroy();
+ m_flags |= BGFX_TEXTURE_INTERNAL_SHARED;
+ m_id = (GLuint)_ptr;
+ }
+
void TextureGL::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
{
BX_UNUSED(_z, _depth);
@@ -4316,7 +4361,7 @@ namespace bgfx { namespace gl
if (convert)
{
- imageDecodeToRgba8(temp, data, width, height, srcpitch, m_requestedFormat);
+ imageDecodeToRgba8(temp, data, width, height, srcpitch, TextureFormat::Enum(m_requestedFormat) );
data = temp;
srcpitch = rectpitch;
}
@@ -6315,6 +6360,11 @@ namespace bgfx { namespace gl
blitMsaaFbo();
+ if (m_vaoSupport)
+ {
+ GL_CHECK(glBindVertexArray(m_vao) );
+ }
+
if (0 < _render->m_num)
{
if (0 != (m_resolution.m_flags & BGFX_RESET_FLUSH_AFTER_RENDER) )
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 34804d6b23c..06b1525fd64 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -321,6 +321,18 @@ typedef uint64_t GLuint64;
# define GL_R11F_G11F_B10F 0x8C3A
#endif // GL_R11F_G11F_B10F
+#ifndef GL_UNSIGNED_SHORT_5_6_5_REV
+# define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#endif // GL_UNSIGNED_SHORT_5_6_5_REV
+
+#ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
+# define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#endif // GL_UNSIGNED_SHORT_1_5_5_5_REV
+
+#ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV
+# define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#endif // GL_UNSIGNED_SHORT_4_4_4_4_REV
+
#ifndef GL_UNSIGNED_INT_10F_11F_11F_REV
# define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
#endif // GL_UNSIGNED_INT_10F_11F_11F_REV
@@ -742,6 +754,10 @@ typedef uint64_t GLuint64;
# define GL_FRAMEBUFFER_SRGB 0x8DB9
#endif // GL_FRAMEBUFFER_SRGB
+#ifndef GL_NUM_EXTENSIONS
+# define GL_NUM_EXTENSIONS 0x821D
+#endif // GL_NUM_EXTENSIONS
+
// _KHR or _ARB...
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
@@ -1103,9 +1119,10 @@ namespace bgfx { namespace gl
{
}
- bool init(GLenum _target, uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _format, uint8_t _numMips, uint32_t _flags);
+ bool init(GLenum _target, uint32_t _width, uint32_t _height, uint32_t _depth, TextureFormat::Enum _format, uint8_t _numMips, uint32_t _flags);
void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
void destroy();
+ void overrideInternal(uintptr_t _ptr);
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
void setSamplerState(uint32_t _flags, const float _rgba[4]);
void commit(uint32_t _stage, uint32_t _flags, const float _palette[][4]);
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
index bb52c45b855..833a53bea0d 100644
--- a/3rdparty/bgfx/src/renderer_mtl.mm
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -495,6 +495,7 @@ namespace bgfx { namespace mtl
m_occlusionQuery.preReset();
+ g_internalData.context = m_device;
return true;
}
@@ -666,7 +667,7 @@ namespace bgfx { namespace mtl
tc.m_sides = 0;
tc.m_depth = 0;
tc.m_numMips = 1;
- tc.m_format = texture.m_requestedFormat;
+ tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
bx::write(&writer, tc);
@@ -677,6 +678,17 @@ namespace bgfx { namespace mtl
release(mem);
}
+ void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
+ {
+ BX_UNUSED(_handle, _ptr);
+ }
+
+ uintptr_t getInternal(TextureHandle _handle) BX_OVERRIDE
+ {
+ BX_UNUSED(_handle);
+ return 0;
+ }
+
void destroyTexture(TextureHandle _handle) BX_OVERRIDE
{
m_textures[_handle.idx].destroy();
@@ -1887,7 +1899,7 @@ namespace bgfx { namespace mtl
, 0 != (_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : ""
);
- const bool bufferOnly = 0 != (_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ const bool writeOnly = 0 != (_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
// const bool computeWrite = 0 != (_flags&BGFX_TEXTURE_COMPUTE_WRITE);
// const bool renderTarget = 0 != (_flags&BGFX_TEXTURE_RT_MASK);
const bool srgb = 0 != (_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb;
@@ -1919,11 +1931,11 @@ namespace bgfx { namespace mtl
desc.resourceOptions = MTLResourceStorageModePrivate;
desc.cpuCacheMode = MTLCPUCacheModeDefaultCache;
- desc.storageMode = (MTLStorageMode)(bufferOnly
+ desc.storageMode = (MTLStorageMode)(writeOnly
? 2 /*MTLStorageModePrivate*/
: 1 /*MTLStorageModeManaged*/
);
- desc.usage = bufferOnly
+ desc.usage = writeOnly
? MTLTextureUsageShaderWrite
: MTLTextureUsageShaderRead
;
@@ -2040,7 +2052,13 @@ namespace bgfx { namespace mtl
if (convert)
{
temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height);
- imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat);
+ imageDecodeToBgra8(temp
+ , data
+ , _rect.m_width
+ , _rect.m_height
+ , srcpitch
+ , TextureFormat::Enum(m_requestedFormat)
+ );
data = temp;
}
diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp
index 021944e15cd..a68e66f0d68 100644
--- a/3rdparty/bgfx/src/renderer_null.cpp
+++ b/3rdparty/bgfx/src/renderer_null.cpp
@@ -121,6 +121,15 @@ namespace bgfx { namespace noop
{
}
+ void overrideInternal(TextureHandle /*_handle*/, uintptr_t /*_ptr*/) BX_OVERRIDE
+ {
+ }
+
+ uintptr_t getInternal(TextureHandle /*_handle*/) BX_OVERRIDE
+ {
+ return 0;
+ }
+
void destroyTexture(TextureHandle /*_handle*/) BX_OVERRIDE
{
}
diff --git a/3rdparty/bgfx/src/shader_dx9bc.cpp b/3rdparty/bgfx/src/shader_dx9bc.cpp
index 81d3dfb606a..071a9e2705e 100644
--- a/3rdparty/bgfx/src/shader_dx9bc.cpp
+++ b/3rdparty/bgfx/src/shader_dx9bc.cpp
@@ -722,8 +722,7 @@ namespace bgfx
{
bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
- bx::CrtAllocator r;
- bx::MemoryBlock mb(&r);
+ bx::MemoryBlock mb(g_allocator);
bx::MemoryWriter writer(&mb);
for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
diff --git a/3rdparty/bgfx/src/shader_dxbc.cpp b/3rdparty/bgfx/src/shader_dxbc.cpp
index a1fde52f7ab..36d81842c8d 100644
--- a/3rdparty/bgfx/src/shader_dxbc.cpp
+++ b/3rdparty/bgfx/src/shader_dxbc.cpp
@@ -1903,8 +1903,7 @@ namespace bgfx
{
bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
- bx::CrtAllocator r;
- bx::MemoryBlock mb(&r);
+ bx::MemoryBlock mb(g_allocator);
bx::MemoryWriter writer(&mb);
for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
index 4856d71ea12..b5fc62affe2 100644
--- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp
+++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
@@ -811,7 +811,7 @@ int main(int _argc, const char* _argv[])
PrimitiveArray primitives;
bx::CrtFileWriter writer;
- if (0 != writer.open(outFilePath) )
+ if (bx::open(&writer, outFilePath) )
{
printf("Unable to open output file '%s'.", outFilePath);
exit(EXIT_FAILURE);
@@ -1000,8 +1000,8 @@ int main(int _argc, const char* _argv[])
);
}
- printf("size: %d\n", uint32_t(writer.seek() ) );
- writer.close();
+ printf("size: %d\n", uint32_t(bx::seek(&writer) ) );
+ bx::close(&writer);
delete [] indexData;
delete [] vertexData;
diff --git a/3rdparty/bgfx/tools/makedisttex.cpp b/3rdparty/bgfx/tools/makedisttex.cpp
deleted file mode 100644
index 6bc99b5289d..00000000000
--- a/3rdparty/bgfx/tools/makedisttex.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <edtaa3/edtaa3func.h>
-
-#define STB_IMAGE_IMPLEMENTATION
-#include <stb/stb_image.c>
-
-#define BX_NAMESPACE 1
-#include <bx/bx.h>
-#include <bx/commandline.h>
-#include <bx/uint32_t.h>
-
-long int fsize(FILE* _file)
-{
- long int pos = ftell(_file);
- fseek(_file, 0L, SEEK_END);
- long int size = ftell(_file);
- fseek(_file, pos, SEEK_SET);
- return size;
-}
-
-void edtaa3(double* _img, uint16_t _width, uint16_t _height, double* _out)
-{
- uint32_t size = _width*_height;
-
- short* xdist = (short*)malloc(size*sizeof(short) );
- short* ydist = (short*)malloc(size*sizeof(short) );
- double* gx = (double*)malloc(size*sizeof(double) );
- double* gy = (double*)malloc(size*sizeof(double) );
-
- computegradient(_img, _width, _height, gx, gy);
- edtaa3(_img, gx, gy, _width, _height, xdist, ydist, _out);
-
- for (uint32_t ii = 0; ii < size; ++ii)
- {
- if (_out[ii] < 0.0)
- {
- _out[ii] = 0.0;
- }
- }
-
- free(xdist);
- free(ydist);
- free(gx);
- free(gy);
-}
-
-void saveTga(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, bool _grayscale, const void* _data)
-{
- FILE* file = fopen(_filePath, "wb");
- if ( NULL != file )
- {
- uint8_t type = _grayscale ? 3 : 2;
- uint8_t bpp = _grayscale ? 8 : 32;
- uint8_t xorig = 0;
- uint8_t yorig = 0;
-
- putc(0, file);
- putc(0, file);
- putc(type, file);
- putc(0, file);
- putc(0, file);
- putc(0, file);
- putc(0, file);
- putc(0, file);
- putc(0, file);
- putc(xorig, file);
- putc(0, file);
- putc(yorig, file);
- putc(_width&0xff, file);
- putc( (_width>>8)&0xff, file);
- putc(_height&0xff, file);
- putc( (_height>>8)&0xff, file);
- putc(bpp, file);
- putc(32, file);
-
- uint32_t width = _width * bpp / 8;
- uint8_t* data = (uint8_t*)_data;
- for (uint32_t yy = 0; yy < _height; ++yy)
- {
- fwrite(data, width, 1, file);
- data += _pitch;
- }
-
- fclose(file);
- }
-}
-
-inline double min(double _a, double _b)
-{
- return _a > _b ? _b : _a;
-}
-
-inline double max(double _a, double _b)
-{
- return _a > _b ? _a : _b;
-}
-
-inline double clamp(double _val, double _min, double _max)
-{
- return max(min(_val, _max), _min);
-}
-
-inline double saturate(double _val)
-{
- return clamp(_val, 0.0, 1.0);
-}
-
-int main(int _argc, const char* _argv[])
-{
- bx::CommandLine cmdLine(_argc, _argv);
-
- const char* inFilePath = cmdLine.findOption('i');
- if (NULL == inFilePath)
- {
- fprintf(stderr, "Input file name must be specified.\n");
- return EXIT_FAILURE;
- }
-
- const char* outFilePath = cmdLine.findOption('o');
- if (NULL == outFilePath)
- {
- fprintf(stderr, "Output file name must be specified.\n");
- return EXIT_FAILURE;
- }
-
- double edge = 16.0;
- const char* edgeOpt = cmdLine.findOption('e');
- if (NULL != edgeOpt)
- {
- edge = atof(edgeOpt);
- }
-
- int width;
- int height;
- int comp;
-
- stbi_uc* img = stbi_load(inFilePath, &width, &height, &comp, 1);
-
- if (NULL == img)
- {
- fprintf(stderr, "Failed to load %s.\n", inFilePath);
- return EXIT_FAILURE;
- }
-
- uint32_t size = width*height;
-
- double* imgIn = (double*)malloc(size*sizeof(double) );
- double* outside = (double*)malloc(size*sizeof(double) );
- double* inside = (double*)malloc(size*sizeof(double) );
-
- for (uint32_t ii = 0; ii < size; ++ii)
- {
- imgIn[ii] = double(img[ii])/255.0;
- }
-
- edtaa3(imgIn, width, height, outside);
-
- for (uint32_t ii = 0; ii < size; ++ii)
- {
- imgIn[ii] = 1.0 - imgIn[ii];
- }
-
- edtaa3(imgIn, width, height, inside);
-
- free(imgIn);
-
- uint8_t* grayscale = (uint8_t*)malloc(size);
-
- double edgeOffset = edge*0.5;
- double invEdge = 1.0/edge;
-
- for (uint32_t ii = 0; ii < size; ++ii)
- {
- double dist = saturate( ( (outside[ii] - inside[ii])+edgeOffset) * invEdge);
- grayscale[ii] = 255-uint8_t(dist * 255.0);
- }
-
- free(inside);
- free(outside);
-
- saveTga(outFilePath, width, height, width, true, grayscale);
-
- free(grayscale);
-
- return EXIT_SUCCESS;
-}
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
index 4b6c7ec0ff1..915119afc91 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
@@ -4,8 +4,7 @@
*/
#include "shaderc.h"
-
-bool g_verbose = false;
+#include <bx/tokenizecmd.h>
#define MAX_TAGS 256
extern "C"
@@ -13,215 +12,124 @@ extern "C"
#include <fpp.h>
} // extern "C"
-#define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x2)
-#define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x4)
-#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x4)
-
-long int fsize(FILE* _file)
+namespace bgfx
{
- long int pos = ftell(_file);
- fseek(_file, 0L, SEEK_END);
- long int size = ftell(_file);
- fseek(_file, pos, SEEK_SET);
- return size;
-}
+ bool g_verbose = false;
-static const char* s_ARB_shader_texture_lod[] =
-{
- "texture2DLod",
- "texture2DProjLod",
- "texture3DLod",
- "texture3DProjLod",
- "textureCubeLod",
- "shadow2DLod",
- "shadow2DProjLod",
- NULL
- // "texture1DLod",
- // "texture1DProjLod",
- // "shadow1DLod",
- // "shadow1DProjLod",
-};
-
-static const char* s_EXT_shadow_samplers[] =
-{
- "shadow2D",
- "shadow2DProj",
- "sampler2DShadow",
- NULL
-};
-
-static const char* s_OES_standard_derivatives[] =
-{
- "dFdx",
- "dFdy",
- "fwidth",
- NULL
-};
+ #define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x2)
+ #define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x4)
+ #define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x4)
-static const char* s_OES_texture_3D[] =
-{
- "texture3D",
- "texture3DProj",
- "texture3DLod",
- "texture3DProjLod",
- NULL
-};
-
-static const char* s_130[] =
-{
- "uint",
- "uint2",
- "uint3",
- "uint4",
- "isampler3D",
- "usampler3D",
- NULL
-};
-
-const char* s_uniformTypeName[UniformType::Count] =
-{
- "int",
- NULL,
- "vec4",
- "mat3",
- "mat4",
-};
-
-const char* interpolationDx11(const char* _glsl)
-{
- if (0 == strcmp(_glsl, "smooth") )
- {
- return "linear";
- }
- else if (0 == strcmp(_glsl, "flat") )
+ long int fsize(FILE* _file)
{
- return "nointerpolation";
+ long int pos = ftell(_file);
+ fseek(_file, 0L, SEEK_END);
+ long int size = ftell(_file);
+ fseek(_file, pos, SEEK_SET);
+ return size;
}
- return _glsl; // noperspective
-}
-
-const char* getUniformTypeName(UniformType::Enum _enum)
-{
- return s_uniformTypeName[_enum];
-}
-
-UniformType::Enum nameToUniformTypeEnum(const char* _name)
-{
- for (uint32_t ii = 0; ii < UniformType::Count; ++ii)
+ static const char* s_ARB_shader_texture_lod[] =
{
- if (NULL != s_uniformTypeName[ii]
- && 0 == strcmp(_name, s_uniformTypeName[ii]) )
- {
- return UniformType::Enum(ii);
- }
- }
-
- return UniformType::Count;
-}
-
-int32_t writef(bx::WriterI* _writer, const char* _format, ...)
-{
- va_list argList;
- va_start(argList, _format);
-
- char temp[2048];
-
- char* out = temp;
- int32_t max = sizeof(temp);
- int32_t len = bx::vsnprintf(out, max, _format, argList);
- if (len > max)
+ "texture2DLod",
+ "texture2DProjLod",
+ "texture3DLod",
+ "texture3DProjLod",
+ "textureCubeLod",
+ "shadow2DLod",
+ "shadow2DProjLod",
+ NULL
+ // "texture1DLod",
+ // "texture1DProjLod",
+ // "shadow1DLod",
+ // "shadow1DProjLod",
+ };
+
+ static const char* s_EXT_shadow_samplers[] =
{
- out = (char*)alloca(len);
- len = bx::vsnprintf(out, len, _format, argList);
- }
+ "shadow2D",
+ "shadow2DProj",
+ "sampler2DShadow",
+ NULL
+ };
- len = bx::write(_writer, out, len);
-
- va_end(argList);
-
- return len;
-}
-
-class Bin2cWriter : public bx::CrtFileWriter
-{
-public:
- Bin2cWriter(const char* _name)
- : m_name(_name)
+ static const char* s_OES_standard_derivatives[] =
{
- }
+ "dFdx",
+ "dFdy",
+ "fwidth",
+ NULL
+ };
- virtual ~Bin2cWriter()
+ static const char* s_OES_texture_3D[] =
{
- }
-
- virtual int32_t close() BX_OVERRIDE
+ "texture3D",
+ "texture3DProj",
+ "texture3DLod",
+ "texture3DProjLod",
+ NULL
+ };
+
+ static const char* s_130[] =
+ {
+ "uint",
+ "uint2",
+ "uint3",
+ "uint4",
+ "isampler3D",
+ "usampler3D",
+ NULL
+ };
+
+ const char* s_uniformTypeName[UniformType::Count] =
{
- generate();
- return bx::CrtFileWriter::close();
+ "int",
+ NULL,
+ "vec4",
+ "mat3",
+ "mat4",
+ };
+
+ const char* interpolationDx11(const char* _glsl)
+ {
+ if (0 == strcmp(_glsl, "smooth") )
+ {
+ return "linear";
+ }
+ else if (0 == strcmp(_glsl, "flat") )
+ {
+ return "nointerpolation";
+ }
+
+ return _glsl; // noperspective
}
- virtual int32_t write(const void* _data, int32_t _size) BX_OVERRIDE
+ const char* getUniformTypeName(UniformType::Enum _enum)
{
- const char* data = (const char*)_data;
- m_buffer.insert(m_buffer.end(), data, data+_size);
- return _size;
+ return s_uniformTypeName[_enum];
}
-private:
- void generate()
+ UniformType::Enum nameToUniformTypeEnum(const char* _name)
{
-#define HEX_DUMP_WIDTH 16
-#define HEX_DUMP_SPACE_WIDTH 96
-#define HEX_DUMP_FORMAT "%-" BX_STRINGIZE(HEX_DUMP_SPACE_WIDTH) "." BX_STRINGIZE(HEX_DUMP_SPACE_WIDTH) "s"
- const uint8_t* data = &m_buffer[0];
- uint32_t size = (uint32_t)m_buffer.size();
-
- outf("static const uint8_t %s[%d] =\n{\n", m_name.c_str(), size);
-
- if (NULL != data)
+ for (uint32_t ii = 0; ii < UniformType::Count; ++ii)
{
- char hex[HEX_DUMP_SPACE_WIDTH+1];
- char ascii[HEX_DUMP_WIDTH+1];
- uint32_t hexPos = 0;
- uint32_t asciiPos = 0;
- for (uint32_t ii = 0; ii < size; ++ii)
- {
- bx::snprintf(&hex[hexPos], sizeof(hex)-hexPos, "0x%02x, ", data[asciiPos]);
- hexPos += 6;
-
- ascii[asciiPos] = isprint(data[asciiPos]) && data[asciiPos] != '\\' ? data[asciiPos] : '.';
- asciiPos++;
-
- if (HEX_DUMP_WIDTH == asciiPos)
- {
- ascii[asciiPos] = '\0';
- outf("\t" HEX_DUMP_FORMAT "// %s\n", hex, ascii);
- data += asciiPos;
- hexPos = 0;
- asciiPos = 0;
- }
- }
-
- if (0 != asciiPos)
+ if (NULL != s_uniformTypeName[ii]
+ && 0 == strcmp(_name, s_uniformTypeName[ii]) )
{
- ascii[asciiPos] = '\0';
- outf("\t" HEX_DUMP_FORMAT "// %s\n", hex, ascii);
+ return UniformType::Enum(ii);
}
}
- outf("};\n");
-#undef HEX_DUMP_WIDTH
-#undef HEX_DUMP_SPACE_WIDTH
-#undef HEX_DUMP_FORMAT
+ return UniformType::Count;
}
- int32_t outf(const char* _format, ...)
+ int32_t writef(bx::WriterI* _writer, const char* _format, ...)
{
va_list argList;
va_start(argList, _format);
char temp[2048];
+
char* out = temp;
int32_t max = sizeof(temp);
int32_t len = bx::vsnprintf(out, max, _format, argList);
@@ -231,1584 +139,1703 @@ private:
len = bx::vsnprintf(out, len, _format, argList);
}
- int32_t size = bx::CrtFileWriter::write(out, len);
+ len = bx::write(_writer, out, len);
va_end(argList);
- return size;
+ return len;
}
- std::string m_filePath;
- std::string m_name;
- typedef std::vector<uint8_t> Buffer;
- Buffer m_buffer;
-};
-
-struct Varying
-{
- std::string m_precision;
- std::string m_interpolation;
- std::string m_name;
- std::string m_type;
- std::string m_init;
- std::string m_semantics;
-};
-
-typedef std::unordered_map<std::string, Varying> VaryingMap;
-
-class File
-{
-public:
- File(const char* _filePath)
- : m_data(NULL)
+ class Bin2cWriter : public bx::CrtFileWriter
{
- FILE* file = fopen(_filePath, "r");
- if (NULL != file)
+ public:
+ Bin2cWriter(const char* _name)
+ : m_name(_name)
{
- m_size = fsize(file);
- m_data = new char[m_size+1];
- m_size = (uint32_t)fread(m_data, 1, m_size, file);
- m_data[m_size] = '\0';
- fclose(file);
}
- }
- ~File()
- {
- delete [] m_data;
- }
-
- const char* getData() const
- {
- return m_data;
- }
+ virtual ~Bin2cWriter()
+ {
+ }
- uint32_t getSize() const
- {
- return m_size;
- }
+ virtual void close() BX_OVERRIDE
+ {
+ generate();
+ return bx::CrtFileWriter::close();
+ }
-private:
- char* m_data;
- uint32_t m_size;
-};
+ virtual int32_t write(const void* _data, int32_t _size, bx::Error*) BX_OVERRIDE
+ {
+ const char* data = (const char*)_data;
+ m_buffer.insert(m_buffer.end(), data, data+_size);
+ return _size;
+ }
-void strInsert(char* _str, const char* _insert)
-{
- size_t len = strlen(_insert);
- memmove(&_str[len], _str, strlen(_str) );
- memcpy(_str, _insert, len);
-}
+ private:
+ void generate()
+ {
+#define HEX_DUMP_WIDTH 16
+#define HEX_DUMP_SPACE_WIDTH 96
+#define HEX_DUMP_FORMAT "%-" BX_STRINGIZE(HEX_DUMP_SPACE_WIDTH) "." BX_STRINGIZE(HEX_DUMP_SPACE_WIDTH) "s"
+ const uint8_t* data = &m_buffer[0];
+ uint32_t size = (uint32_t)m_buffer.size();
-void strReplace(char* _str, const char* _find, const char* _replace)
-{
- const size_t len = strlen(_find);
+ outf("static const uint8_t %s[%d] =\n{\n", m_name.c_str(), size);
- char* replace = (char*)alloca(len+1);
- bx::strlcpy(replace, _replace, len+1);
- for (size_t ii = strlen(replace); ii < len; ++ii)
- {
- replace[ii] = ' ';
- }
- replace[len] = '\0';
+ if (NULL != data)
+ {
+ char hex[HEX_DUMP_SPACE_WIDTH+1];
+ char ascii[HEX_DUMP_WIDTH+1];
+ uint32_t hexPos = 0;
+ uint32_t asciiPos = 0;
+ for (uint32_t ii = 0; ii < size; ++ii)
+ {
+ bx::snprintf(&hex[hexPos], sizeof(hex)-hexPos, "0x%02x, ", data[asciiPos]);
+ hexPos += 6;
- BX_CHECK(len >= strlen(_replace), "");
- for (char* ptr = strstr(_str, _find); NULL != ptr; ptr = strstr(ptr + len, _find) )
- {
- memcpy(ptr, replace, len);
- }
-}
+ ascii[asciiPos] = isprint(data[asciiPos]) && data[asciiPos] != '\\' ? data[asciiPos] : '.';
+ asciiPos++;
-void strNormalizeEol(char* _str)
-{
- strReplace(_str, "\r\n", "\n");
- strReplace(_str, "\r", "\n");
-}
+ if (HEX_DUMP_WIDTH == asciiPos)
+ {
+ ascii[asciiPos] = '\0';
+ outf("\t" HEX_DUMP_FORMAT "// %s\n", hex, ascii);
+ data += asciiPos;
+ hexPos = 0;
+ asciiPos = 0;
+ }
+ }
-void printCode(const char* _code, int32_t _line, int32_t _start, int32_t _end)
-{
- fprintf(stderr, "Code:\n---\n");
+ if (0 != asciiPos)
+ {
+ ascii[asciiPos] = '\0';
+ outf("\t" HEX_DUMP_FORMAT "// %s\n", hex, ascii);
+ }
+ }
- LineReader lr(_code);
- for (int32_t line = 1; !lr.isEof() && line < _end; ++line)
- {
- if (line >= _start)
- {
- fprintf(stderr, "%s%3d: %s", _line == line ? ">>> " : " ", line, lr.getLine().c_str() );
- }
- else
- {
- lr.skipLine();
+ outf("};\n");
+#undef HEX_DUMP_WIDTH
+#undef HEX_DUMP_SPACE_WIDTH
+#undef HEX_DUMP_FORMAT
}
- }
-
- fprintf(stderr, "---\n");
-}
-void writeFile(const char* _filePath, const void* _data, int32_t _size)
-{
- bx::CrtFileWriter out;
- if (0 == out.open(_filePath) )
- {
- out.write(_data, _size);
- out.close();
- }
-}
+ int32_t outf(const char* _format, ...)
+ {
+ va_list argList;
+ va_start(argList, _format);
+
+ char temp[2048];
+ char* out = temp;
+ int32_t max = sizeof(temp);
+ int32_t len = bx::vsnprintf(out, max, _format, argList);
+ if (len > max)
+ {
+ out = (char*)alloca(len);
+ len = bx::vsnprintf(out, len, _format, argList);
+ }
-struct Preprocessor
-{
- Preprocessor(const char* _filePath, bool _gles, const char* _includeDir = NULL)
- : m_tagptr(m_tags)
- , m_scratchPos(0)
- , m_fgetsPos(0)
- {
- m_tagptr->tag = FPPTAG_USERDATA;
- m_tagptr->data = this;
- m_tagptr++;
+ bx::Error err;
+ int32_t size = bx::CrtFileWriter::write(out, len, &err);
- m_tagptr->tag = FPPTAG_DEPENDS;
- m_tagptr->data = (void*)fppDepends;
- m_tagptr++;
+ va_end(argList);
- m_tagptr->tag = FPPTAG_INPUT;
- m_tagptr->data = (void*)fppInput;
- m_tagptr++;
+ return size;
+ }
- m_tagptr->tag = FPPTAG_OUTPUT;
- m_tagptr->data = (void*)fppOutput;
- m_tagptr++;
+ std::string m_filePath;
+ std::string m_name;
+ typedef std::vector<uint8_t> Buffer;
+ Buffer m_buffer;
+ };
- m_tagptr->tag = FPPTAG_ERROR;
- m_tagptr->data = (void*)fppError;
- m_tagptr++;
+ struct Varying
+ {
+ std::string m_precision;
+ std::string m_interpolation;
+ std::string m_name;
+ std::string m_type;
+ std::string m_init;
+ std::string m_semantics;
+ };
- m_tagptr->tag = FPPTAG_IGNOREVERSION;
- m_tagptr->data = (void*)0;
- m_tagptr++;
+ typedef std::unordered_map<std::string, Varying> VaryingMap;
- m_tagptr->tag = FPPTAG_LINE;
- m_tagptr->data = (void*)0;
- m_tagptr++;
+ class File
+ {
+ public:
+ File(const char* _filePath)
+ : m_data(NULL)
+ {
+ FILE* file = fopen(_filePath, "r");
+ if (NULL != file)
+ {
+ m_size = fsize(file);
+ m_data = new char[m_size+1];
+ m_size = (uint32_t)fread(m_data, 1, m_size, file);
+ m_data[m_size] = '\0';
+ fclose(file);
+ }
+ }
- m_tagptr->tag = FPPTAG_INPUT_NAME;
- m_tagptr->data = scratch(_filePath);
- m_tagptr++;
+ ~File()
+ {
+ delete [] m_data;
+ }
- if (NULL != _includeDir)
+ const char* getData() const
{
- addInclude(_includeDir);
+ return m_data;
}
- if (!_gles)
+ uint32_t getSize() const
{
- m_default = "#define lowp\n#define mediump\n#define highp\n";
+ return m_size;
}
- }
- void setDefine(const char* _define)
+ private:
+ char* m_data;
+ uint32_t m_size;
+ };
+
+ void strInsert(char* _str, const char* _insert)
{
- m_tagptr->tag = FPPTAG_DEFINE;
- m_tagptr->data = scratch(_define);
- m_tagptr++;
+ size_t len = strlen(_insert);
+ memmove(&_str[len], _str, strlen(_str) );
+ memcpy(_str, _insert, len);
}
- void setDefaultDefine(const char* _name)
+ void strReplace(char* _str, const char* _find, const char* _replace)
{
- char temp[1024];
- bx::snprintf(temp, BX_COUNTOF(temp)
- , "#ifndef %s\n"
- "# define %s 0\n"
- "#endif // %s\n"
- "\n"
- , _name
- , _name
- , _name
- );
+ const size_t len = strlen(_find);
- m_default += temp;
+ char* replace = (char*)alloca(len+1);
+ bx::strlcpy(replace, _replace, len+1);
+ for (size_t ii = strlen(replace); ii < len; ++ii)
+ {
+ replace[ii] = ' ';
+ }
+ replace[len] = '\0';
+
+ BX_CHECK(len >= strlen(_replace), "");
+ for (char* ptr = strstr(_str, _find); NULL != ptr; ptr = strstr(ptr + len, _find) )
+ {
+ memcpy(ptr, replace, len);
+ }
}
- void writef(const char* _format, ...)
+ void strNormalizeEol(char* _str)
{
- va_list argList;
- va_start(argList, _format);
- bx::stringPrintfVargs(m_default, _format, argList);
- va_end(argList);
+ strReplace(_str, "\r\n", "\n");
+ strReplace(_str, "\r", "\n");
}
- void addInclude(const char* _includeDir)
+ void printCode(const char* _code, int32_t _line, int32_t _start, int32_t _end)
{
- char* start = scratch(_includeDir);
+ fprintf(stderr, "Code:\n---\n");
- for (char* split = strchr(start, ';'); NULL != split; split = strchr(start, ';'))
+ LineReader lr(_code);
+ for (int32_t line = 1; !lr.isEof() && line < _end; ++line)
{
- *split = '\0';
- m_tagptr->tag = FPPTAG_INCLUDE_DIR;
- m_tagptr->data = start;
- m_tagptr++;
- start = split + 1;
+ if (line >= _start)
+ {
+ fprintf(stderr, "%s%3d: %s", _line == line ? ">>> " : " ", line, lr.getLine().c_str() );
+ }
+ else
+ {
+ lr.skipLine();
+ }
}
- m_tagptr->tag = FPPTAG_INCLUDE_DIR;
- m_tagptr->data = start;
- m_tagptr++;
+ fprintf(stderr, "---\n");
}
- void addDependency(const char* _fileName)
+ void writeFile(const char* _filePath, const void* _data, int32_t _size)
{
- m_depends += " \\\n ";
- m_depends += _fileName;
+ bx::CrtFileWriter out;
+ if (bx::open(&out, _filePath) )
+ {
+ bx::write(&out, _data, _size);
+ bx::close(&out);
+ }
}
- bool run(const char* _input)
+ struct Preprocessor
{
- m_fgetsPos = 0;
+ Preprocessor(const char* _filePath, bool _gles, const char* _includeDir = NULL)
+ : m_tagptr(m_tags)
+ , m_scratchPos(0)
+ , m_fgetsPos(0)
+ {
+ m_tagptr->tag = FPPTAG_USERDATA;
+ m_tagptr->data = this;
+ m_tagptr++;
- m_preprocessed.clear();
- m_input = m_default;
- m_input += "\n\n";
+ m_tagptr->tag = FPPTAG_DEPENDS;
+ m_tagptr->data = (void*)fppDepends;
+ m_tagptr++;
- size_t len = strlen(_input)+1;
- char* temp = new char[len];
- bx::eolLF(temp, len, _input);
- m_input += temp;
- delete [] temp;
+ m_tagptr->tag = FPPTAG_INPUT;
+ m_tagptr->data = (void*)fppInput;
+ m_tagptr++;
- fppTag* tagptr = m_tagptr;
+ m_tagptr->tag = FPPTAG_OUTPUT;
+ m_tagptr->data = (void*)fppOutput;
+ m_tagptr++;
- tagptr->tag = FPPTAG_END;
- tagptr->data = 0;
- tagptr++;
+ m_tagptr->tag = FPPTAG_ERROR;
+ m_tagptr->data = (void*)fppError;
+ m_tagptr++;
- int result = fppPreProcess(m_tags);
+ m_tagptr->tag = FPPTAG_IGNOREVERSION;
+ m_tagptr->data = (void*)0;
+ m_tagptr++;
- return 0 == result;
- }
+ m_tagptr->tag = FPPTAG_LINE;
+ m_tagptr->data = (void*)0;
+ m_tagptr++;
- char* fgets(char* _buffer, int _size)
- {
- int ii = 0;
- for (char ch = m_input[m_fgetsPos]; m_fgetsPos < m_input.size() && ii < _size-1; ch = m_input[++m_fgetsPos])
- {
- _buffer[ii++] = ch;
+ m_tagptr->tag = FPPTAG_INPUT_NAME;
+ m_tagptr->data = scratch(_filePath);
+ m_tagptr++;
+
+ if (NULL != _includeDir)
+ {
+ addInclude(_includeDir);
+ }
- if (ch == '\n' || ii == _size)
+ if (!_gles)
{
- _buffer[ii] = '\0';
- m_fgetsPos++;
- return _buffer;
+ m_default = "#define lowp\n#define mediump\n#define highp\n";
}
}
- return NULL;
- }
+ void setDefine(const char* _define)
+ {
+ m_tagptr->tag = FPPTAG_DEFINE;
+ m_tagptr->data = scratch(_define);
+ m_tagptr++;
+ }
- static void fppDepends(char* _fileName, void* _userData)
- {
- Preprocessor* thisClass = (Preprocessor*)_userData;
- thisClass->addDependency(_fileName);
- }
+ void setDefaultDefine(const char* _name)
+ {
+ char temp[1024];
+ bx::snprintf(temp, BX_COUNTOF(temp)
+ , "#ifndef %s\n"
+ "# define %s 0\n"
+ "#endif // %s\n"
+ "\n"
+ , _name
+ , _name
+ , _name
+ );
+
+ m_default += temp;
+ }
- static char* fppInput(char* _buffer, int _size, void* _userData)
- {
- Preprocessor* thisClass = (Preprocessor*)_userData;
- return thisClass->fgets(_buffer, _size);
- }
+ void writef(const char* _format, ...)
+ {
+ va_list argList;
+ va_start(argList, _format);
+ bx::stringPrintfVargs(m_default, _format, argList);
+ va_end(argList);
+ }
- static void fppOutput(int _ch, void* _userData)
- {
- Preprocessor* thisClass = (Preprocessor*)_userData;
- thisClass->m_preprocessed += _ch;
- }
+ void addInclude(const char* _includeDir)
+ {
+ char* start = scratch(_includeDir);
- static void fppError(void* /*_userData*/, char* _format, va_list _vargs)
- {
- vfprintf(stderr, _format, _vargs);
- }
+ for (char* split = strchr(start, ';'); NULL != split; split = strchr(start, ';') )
+ {
+ *split = '\0';
+ m_tagptr->tag = FPPTAG_INCLUDE_DIR;
+ m_tagptr->data = start;
+ m_tagptr++;
+ start = split + 1;
+ }
- char* scratch(const char* _str)
- {
- char* result = &m_scratch[m_scratchPos];
- strcpy(result, _str);
- m_scratchPos += (uint32_t)strlen(_str)+1;
+ m_tagptr->tag = FPPTAG_INCLUDE_DIR;
+ m_tagptr->data = start;
+ m_tagptr++;
+ }
- return result;
- }
+ void addDependency(const char* _fileName)
+ {
+ m_depends += " \\\n ";
+ m_depends += _fileName;
+ }
- fppTag m_tags[MAX_TAGS];
- fppTag* m_tagptr;
+ bool run(const char* _input)
+ {
+ m_fgetsPos = 0;
- std::string m_depends;
- std::string m_default;
- std::string m_input;
- std::string m_preprocessed;
- char m_scratch[16<<10];
- uint32_t m_scratchPos;
- uint32_t m_fgetsPos;
-};
+ m_preprocessed.clear();
+ m_input = m_default;
+ m_input += "\n\n";
-typedef std::vector<std::string> InOut;
+ size_t len = strlen(_input)+1;
+ char* temp = new char[len];
+ bx::eolLF(temp, len, _input);
+ m_input += temp;
+ delete [] temp;
-uint32_t parseInOut(InOut& _inout, const char* _str, const char* _eol)
-{
- uint32_t hash = 0;
- _str = bx::strws(_str);
+ fppTag* tagptr = m_tagptr;
- if (_str < _eol)
- {
- const char* delim;
- do
+ tagptr->tag = FPPTAG_END;
+ tagptr->data = 0;
+ tagptr++;
+
+ int result = fppPreProcess(m_tags);
+
+ return 0 == result;
+ }
+
+ char* fgets(char* _buffer, int _size)
{
- delim = strpbrk(_str, " ,");
- if (NULL != delim)
+ int ii = 0;
+ for (char ch = m_input[m_fgetsPos]; m_fgetsPos < m_input.size() && ii < _size-1; ch = m_input[++m_fgetsPos])
{
- delim = delim > _eol ? _eol : delim;
- std::string token;
- token.assign(_str, delim-_str);
- _inout.push_back(token);
- _str = bx::strws(delim + 1);
+ _buffer[ii++] = ch;
+
+ if (ch == '\n' || ii == _size)
+ {
+ _buffer[ii] = '\0';
+ m_fgetsPos++;
+ return _buffer;
+ }
}
+
+ return NULL;
}
- while (delim < _eol && _str < _eol && NULL != delim);
- std::sort(_inout.begin(), _inout.end() );
+ static void fppDepends(char* _fileName, void* _userData)
+ {
+ Preprocessor* thisClass = (Preprocessor*)_userData;
+ thisClass->addDependency(_fileName);
+ }
- bx::HashMurmur2A murmur;
- murmur.begin();
- for (InOut::const_iterator it = _inout.begin(), itEnd = _inout.end(); it != itEnd; ++it)
+ static char* fppInput(char* _buffer, int _size, void* _userData)
{
- murmur.add(it->c_str(), (uint32_t)it->size() );
+ Preprocessor* thisClass = (Preprocessor*)_userData;
+ return thisClass->fgets(_buffer, _size);
}
- hash = murmur.end();
- }
- return hash;
-}
+ static void fppOutput(int _ch, void* _userData)
+ {
+ Preprocessor* thisClass = (Preprocessor*)_userData;
+ thisClass->m_preprocessed += _ch;
+ }
-void addFragData(Preprocessor& _preprocessor, char* _data, uint32_t _idx, bool _comma)
-{
- char find[32];
- bx::snprintf(find, sizeof(find), "gl_FragData[%d]", _idx);
+ static void fppError(void* /*_userData*/, char* _format, va_list _vargs)
+ {
+ vfprintf(stderr, _format, _vargs);
+ }
- char replace[32];
- bx::snprintf(replace, sizeof(replace), "gl_FragData_%d_", _idx);
+ char* scratch(const char* _str)
+ {
+ char* result = &m_scratch[m_scratchPos];
+ strcpy(result, _str);
+ m_scratchPos += (uint32_t)strlen(_str)+1;
- strReplace(_data, find, replace);
+ return result;
+ }
- _preprocessor.writef(
- " \\\n\t%sout vec4 gl_FragData_%d_ : SV_TARGET%d"
- , _comma ? ", " : " "
- , _idx
- , _idx
- );
-}
+ fppTag m_tags[MAX_TAGS];
+ fppTag* m_tagptr;
-void voidFragData(char* _data, uint32_t _idx)
-{
- char find[32];
- bx::snprintf(find, sizeof(find), "gl_FragData[%d]", _idx);
+ std::string m_depends;
+ std::string m_default;
+ std::string m_input;
+ std::string m_preprocessed;
+ char m_scratch[16<<10];
+ uint32_t m_scratchPos;
+ uint32_t m_fgetsPos;
+ };
- strReplace(_data, find, "bgfx_VoidFrag");
-}
+ typedef std::vector<std::string> InOut;
-// c - compute
-// d - domain
-// f - fragment
-// g - geometry
-// h - hull
-// v - vertex
-//
-// OpenGL #version Features Direct3D Features Shader Model
-// 2.1 120 vf 9.0 vf 2.0
-// 3.0 130
-// 3.1 140
-// 3.2 150 vgf
-// 3.3 330 10.0 vgf 4.0
-// 4.0 400 vhdgf
-// 4.1 410
-// 4.2 420 11.0 vhdgf+c 5.0
-// 4.3 430 vhdgf+c
-// 4.4 440
-
-void help(const char* _error = NULL)
-{
- if (NULL != _error)
+ uint32_t parseInOut(InOut& _inout, const char* _str, const char* _eol)
{
- fprintf(stderr, "Error:\n%s\n\n", _error);
- }
+ uint32_t hash = 0;
+ _str = bx::strws(_str);
- fprintf(stderr
- , "shaderc, bgfx shader compiler tool\n"
- "Copyright 2011-2016 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
- );
-
- fprintf(stderr
- , "Usage: shaderc -f <in> -o <out> --type <v/f> --platform <platform>\n"
-
- "\n"
- "Options:\n"
- " -f <file path> Input file path.\n"
- " -i <include path> Include path (for multiple paths use semicolon).\n"
- " -o <file path> Output file path.\n"
- " --bin2c <file path> Generate C header file.\n"
- " --depends Generate makefile style depends file.\n"
- " --platform <platform> Target platform.\n"
- " android\n"
- " asm.js\n"
- " ios\n"
- " linux\n"
- " nacl\n"
- " osx\n"
- " windows\n"
- " --preprocess Preprocess only.\n"
- " --raw Do not process shader. No preprocessor, and no glsl-optimizer (GLSL only).\n"
- " --type <type> Shader type (vertex, fragment)\n"
- " --varyingdef <file path> Path to varying.def.sc file.\n"
- " --verbose Verbose.\n"
-
- "\n"
- "Options (DX9 and DX11 only):\n"
-
- "\n"
- " --debug Debug information.\n"
- " --disasm Disassemble compiled shader.\n"
- " -p, --profile <profile> Shader model (f.e. ps_3_0).\n"
- " -O <level> Optimization level (0, 1, 2, 3).\n"
- " --Werror Treat warnings as errors.\n"
-
- "\n"
- "For additional information, see https://github.com/bkaradzic/bgfx\n"
- );
-}
+ if (_str < _eol)
+ {
+ const char* delim;
+ do
+ {
+ delim = strpbrk(_str, " ,");
+ if (NULL != delim)
+ {
+ delim = delim > _eol ? _eol : delim;
+ std::string token;
+ token.assign(_str, delim-_str);
+ _inout.push_back(token);
+ _str = bx::strws(delim + 1);
+ }
+ }
+ while (delim < _eol && _str < _eol && NULL != delim);
-int main(int _argc, const char* _argv[])
-{
- bx::CommandLine cmdLine(_argc, _argv);
+ std::sort(_inout.begin(), _inout.end() );
- if (cmdLine.hasArg('h', "help") )
- {
- help();
- return EXIT_FAILURE;
- }
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ for (InOut::const_iterator it = _inout.begin(), itEnd = _inout.end(); it != itEnd; ++it)
+ {
+ murmur.add(it->c_str(), (uint32_t)it->size() );
+ }
+ hash = murmur.end();
+ }
- g_verbose = cmdLine.hasArg("verbose");
+ return hash;
+ }
- const char* filePath = cmdLine.findOption('f');
- if (NULL == filePath)
+ void addFragData(Preprocessor& _preprocessor, char* _data, uint32_t _idx, bool _comma)
{
- help("Shader file name must be specified.");
- return EXIT_FAILURE;
+ char find[32];
+ bx::snprintf(find, sizeof(find), "gl_FragData[%d]", _idx);
+
+ char replace[32];
+ bx::snprintf(replace, sizeof(replace), "gl_FragData_%d_", _idx);
+
+ strReplace(_data, find, replace);
+
+ _preprocessor.writef(
+ " \\\n\t%sout vec4 gl_FragData_%d_ : SV_TARGET%d"
+ , _comma ? ", " : " "
+ , _idx
+ , _idx
+ );
}
- const char* outFilePath = cmdLine.findOption('o');
- if (NULL == outFilePath)
+ void voidFragData(char* _data, uint32_t _idx)
{
- help("Output file name must be specified.");
- return EXIT_FAILURE;
+ char find[32];
+ bx::snprintf(find, sizeof(find), "gl_FragData[%d]", _idx);
+
+ strReplace(_data, find, "bgfx_VoidFrag");
}
- const char* type = cmdLine.findOption('\0', "type");
- if (NULL == type)
+ // c - compute
+ // d - domain
+ // f - fragment
+ // g - geometry
+ // h - hull
+ // v - vertex
+ //
+ // OpenGL #version Features Direct3D Features Shader Model
+ // 2.1 120 vf 9.0 vf 2.0
+ // 3.0 130
+ // 3.1 140
+ // 3.2 150 vgf
+ // 3.3 330 10.0 vgf 4.0
+ // 4.0 400 vhdgf
+ // 4.1 410
+ // 4.2 420 11.0 vhdgf+c 5.0
+ // 4.3 430 vhdgf+c
+ // 4.4 440
+
+ void help(const char* _error = NULL)
{
- help("Must specify shader type.");
- return EXIT_FAILURE;
+ if (NULL != _error)
+ {
+ fprintf(stderr, "Error:\n%s\n\n", _error);
+ }
+
+ fprintf(stderr
+ , "shaderc, bgfx shader compiler tool\n"
+ "Copyright 2011-2016 Branimir Karadzic. All rights reserved.\n"
+ "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
+ );
+
+ fprintf(stderr
+ , "Usage: shaderc -f <in> -o <out> --type <v/f> --platform <platform>\n"
+
+ "\n"
+ "Options:\n"
+ " -f <file path> Input file path.\n"
+ " -i <include path> Include path (for multiple paths use semicolon).\n"
+ " -o <file path> Output file path.\n"
+ " --bin2c <file path> Generate C header file.\n"
+ " --depends Generate makefile style depends file.\n"
+ " --platform <platform> Target platform.\n"
+ " android\n"
+ " asm.js\n"
+ " ios\n"
+ " linux\n"
+ " nacl\n"
+ " osx\n"
+ " windows\n"
+ " --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)\n"
+ " --varyingdef <file path> Path to varying.def.sc file.\n"
+ " --verbose Verbose.\n"
+
+ "\n"
+ "Options (DX9 and DX11 only):\n"
+
+ "\n"
+ " --debug Debug information.\n"
+ " --disasm Disassemble compiled shader.\n"
+ " -p, --profile <profile> Shader model (f.e. ps_3_0).\n"
+ " -O <level> Optimization level (0, 1, 2, 3).\n"
+ " --Werror Treat warnings as errors.\n"
+
+ "\n"
+ "For additional information, see https://github.com/bkaradzic/bgfx\n"
+ );
}
- const char* platform = cmdLine.findOption('\0', "platform");
- if (NULL == platform)
+ int compileShader(int _argc, const char* _argv[])
{
- help("Must specify platform.");
- return EXIT_FAILURE;
- }
+ bx::CommandLine cmdLine(_argc, _argv);
- bool raw = cmdLine.hasArg('\0', "raw");
+ if (cmdLine.hasArg('h', "help") )
+ {
+ help();
+ return EXIT_FAILURE;
+ }
- uint32_t glsl = 0;
- uint32_t essl = 0;
- uint32_t hlsl = 2;
- uint32_t d3d = 11;
- uint32_t metal = 0;
- const char* profile = cmdLine.findOption('p', "profile");
- if (NULL != profile)
- {
- if (0 == strncmp(&profile[1], "s_4_0_level", 11) )
+ g_verbose = cmdLine.hasArg("verbose");
+
+ const char* filePath = cmdLine.findOption('f');
+ if (NULL == filePath)
{
- hlsl = 2;
+ help("Shader file name must be specified.");
+ return EXIT_FAILURE;
}
- else if (0 == strncmp(&profile[1], "s_3", 3) )
+
+ const char* outFilePath = cmdLine.findOption('o');
+ if (NULL == outFilePath)
{
- hlsl = 3;
- d3d = 9;
+ help("Output file name must be specified.");
+ return EXIT_FAILURE;
}
- else if (0 == strncmp(&profile[1], "s_4", 3) )
+
+ const char* type = cmdLine.findOption('\0', "type");
+ if (NULL == type)
{
- hlsl = 4;
+ help("Must specify shader type.");
+ return EXIT_FAILURE;
}
- else if (0 == strncmp(&profile[1], "s_5", 3) )
+
+ const char* platform = cmdLine.findOption('\0', "platform");
+ if (NULL == platform)
{
- hlsl = 5;
+ help("Must specify platform.");
+ return EXIT_FAILURE;
}
- else if (0 == strcmp(profile, "metal") )
+
+ bool raw = cmdLine.hasArg('\0', "raw");
+
+ uint32_t glsl = 0;
+ uint32_t essl = 0;
+ uint32_t hlsl = 2;
+ uint32_t d3d = 11;
+ uint32_t metal = 0;
+ const char* profile = cmdLine.findOption('p', "profile");
+ if (NULL != profile)
{
- metal = 1;
+ if (0 == strncmp(&profile[1], "s_4_0_level", 11) )
+ {
+ hlsl = 2;
+ }
+ else if (0 == strncmp(&profile[1], "s_3", 3) )
+ {
+ hlsl = 3;
+ d3d = 9;
+ }
+ else if (0 == strncmp(&profile[1], "s_4", 3) )
+ {
+ hlsl = 4;
+ }
+ else if (0 == strncmp(&profile[1], "s_5", 3) )
+ {
+ hlsl = 5;
+ }
+ else if (0 == strcmp(profile, "metal") )
+ {
+ metal = 1;
+ }
+ else
+ {
+ glsl = atoi(profile);
+ }
}
else
{
- glsl = atoi(profile);
+ essl = 2;
}
- }
- else
- {
- essl = 2;
- }
- const char* bin2c = NULL;
- if (cmdLine.hasArg("bin2c") )
- {
- bin2c = cmdLine.findOption("bin2c");
- if (NULL == bin2c)
+ const char* bin2c = NULL;
+ if (cmdLine.hasArg("bin2c") )
{
- bin2c = bx::baseName(outFilePath);
- uint32_t len = (uint32_t)strlen(bin2c);
- char* temp = (char*)alloca(len+1);
- for (char *out = temp; *bin2c != '\0';)
+ bin2c = cmdLine.findOption("bin2c");
+ if (NULL == bin2c)
{
- char ch = *bin2c++;
- if (isalnum(ch) )
+ bin2c = bx::baseName(outFilePath);
+ uint32_t len = (uint32_t)strlen(bin2c);
+ char* temp = (char*)alloca(len+1);
+ for (char *out = temp; *bin2c != '\0';)
{
- *out++ = ch;
- }
- else
- {
- *out++ = '_';
+ char ch = *bin2c++;
+ if (isalnum(ch) )
+ {
+ *out++ = ch;
+ }
+ else
+ {
+ *out++ = '_';
+ }
}
- }
- temp[len] = '\0';
+ temp[len] = '\0';
- bin2c = temp;
+ bin2c = temp;
+ }
}
- }
- bool depends = cmdLine.hasArg("depends");
- bool preprocessOnly = cmdLine.hasArg("preprocess");
- const char* includeDir = cmdLine.findOption('i');
+ bool depends = cmdLine.hasArg("depends");
+ bool preprocessOnly = cmdLine.hasArg("preprocess");
+ const char* includeDir = cmdLine.findOption('i');
- Preprocessor preprocessor(filePath, 0 != essl, includeDir);
+ Preprocessor preprocessor(filePath, 0 != essl, includeDir);
- std::string dir;
- {
- const char* base = bx::baseName(filePath);
+ std::string dir;
+ {
+ const char* base = bx::baseName(filePath);
- if (base != filePath)
+ if (base != filePath)
+ {
+ dir.assign(filePath, base-filePath);
+ preprocessor.addInclude(dir.c_str() );
+ }
+ }
+
+ const char* defines = cmdLine.findOption("define");
+ while (NULL != defines
+ && '\0' != *defines)
{
- dir.assign(filePath, base-filePath);
- preprocessor.addInclude(dir.c_str() );
+ defines = bx::strws(defines);
+ const char* eol = strchr(defines, ';');
+ if (NULL == eol)
+ {
+ eol = defines + strlen(defines);
+ }
+ std::string define(defines, eol);
+ preprocessor.setDefine(define.c_str() );
+ defines = ';' == *eol ? eol+1 : eol;
}
- }
- preprocessor.setDefaultDefine("BX_PLATFORM_ANDROID");
- preprocessor.setDefaultDefine("BX_PLATFORM_EMSCRIPTEN");
- preprocessor.setDefaultDefine("BX_PLATFORM_IOS");
- preprocessor.setDefaultDefine("BX_PLATFORM_LINUX");
- preprocessor.setDefaultDefine("BX_PLATFORM_NACL");
- preprocessor.setDefaultDefine("BX_PLATFORM_OSX");
- preprocessor.setDefaultDefine("BX_PLATFORM_WINDOWS");
- preprocessor.setDefaultDefine("BX_PLATFORM_XBOX360");
-// preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_ESSL");
- preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_GLSL");
- preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_HLSL");
- preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_METAL");
- preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_COMPUTE");
- preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT");
- preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX");
-
- char glslDefine[128];
- bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", essl ? 1 : glsl);
-
- if (0 == bx::stricmp(platform, "android") )
- {
- preprocessor.setDefine("BX_PLATFORM_ANDROID=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
- }
- else if (0 == bx::stricmp(platform, "asm.js") )
- {
- preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
- }
- else if (0 == bx::stricmp(platform, "ios") )
- {
- preprocessor.setDefine("BX_PLATFORM_IOS=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
- }
- else if (0 == bx::stricmp(platform, "linux") )
- {
- preprocessor.setDefine("BX_PLATFORM_LINUX=1");
- preprocessor.setDefine(glslDefine);
- }
- else if (0 == bx::stricmp(platform, "nacl") )
- {
- preprocessor.setDefine("BX_PLATFORM_NACL=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
- }
- else if (0 == bx::stricmp(platform, "osx") )
- {
- preprocessor.setDefine("BX_PLATFORM_OSX=1");
- preprocessor.setDefine(glslDefine);
- char temp[256];
- bx::snprintf(temp, sizeof(temp), "BGFX_SHADER_LANGUAGE_METAL=%d", metal);
- preprocessor.setDefine(temp);
- }
- else if (0 == bx::stricmp(platform, "windows") )
- {
- preprocessor.setDefine("BX_PLATFORM_WINDOWS=1");
- char temp[256];
- bx::snprintf(temp, sizeof(temp), "BGFX_SHADER_LANGUAGE_HLSL=%d", hlsl);
- preprocessor.setDefine(temp);
- }
- else if (0 == bx::stricmp(platform, "xbox360") )
- {
- preprocessor.setDefine("BX_PLATFORM_XBOX360=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_HLSL=3");
- }
- else
- {
- fprintf(stderr, "Unknown platform %s?!", platform);
- return EXIT_FAILURE;
- }
+ preprocessor.setDefaultDefine("BX_PLATFORM_ANDROID");
+ preprocessor.setDefaultDefine("BX_PLATFORM_EMSCRIPTEN");
+ preprocessor.setDefaultDefine("BX_PLATFORM_IOS");
+ preprocessor.setDefaultDefine("BX_PLATFORM_LINUX");
+ preprocessor.setDefaultDefine("BX_PLATFORM_NACL");
+ preprocessor.setDefaultDefine("BX_PLATFORM_OSX");
+ preprocessor.setDefaultDefine("BX_PLATFORM_WINDOWS");
+ preprocessor.setDefaultDefine("BX_PLATFORM_XBOX360");
+ // preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_ESSL");
+ preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_GLSL");
+ preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_HLSL");
+ preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_METAL");
+ preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_COMPUTE");
+ preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT");
+ preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX");
+
+ char glslDefine[128];
+ bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", essl ? 1 : glsl);
+
+ if (0 == bx::stricmp(platform, "android") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_ANDROID=1");
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ }
+ else if (0 == bx::stricmp(platform, "asm.js") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1");
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ }
+ else if (0 == bx::stricmp(platform, "ios") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_IOS=1");
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ }
+ else if (0 == bx::stricmp(platform, "linux") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_LINUX=1");
+ preprocessor.setDefine(glslDefine);
+ }
+ else if (0 == bx::stricmp(platform, "nacl") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_NACL=1");
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ }
+ else if (0 == bx::stricmp(platform, "osx") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_OSX=1");
+ preprocessor.setDefine(glslDefine);
+ char temp[256];
+ bx::snprintf(temp, sizeof(temp), "BGFX_SHADER_LANGUAGE_METAL=%d", metal);
+ preprocessor.setDefine(temp);
+ }
+ else if (0 == bx::stricmp(platform, "windows") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_WINDOWS=1");
+ char temp[256];
+ bx::snprintf(temp, sizeof(temp), "BGFX_SHADER_LANGUAGE_HLSL=%d", hlsl);
+ preprocessor.setDefine(temp);
+ }
+ else if (0 == bx::stricmp(platform, "xbox360") )
+ {
+ preprocessor.setDefine("BX_PLATFORM_XBOX360=1");
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_HLSL=3");
+ }
+ else
+ {
+ fprintf(stderr, "Unknown platform %s?!", platform);
+ return EXIT_FAILURE;
+ }
- preprocessor.setDefine("M_PI=3.1415926535897932384626433832795");
+ preprocessor.setDefine("M_PI=3.1415926535897932384626433832795");
- char shaderType = tolower(type[0]);
- switch (shaderType)
- {
- case 'c':
- preprocessor.setDefine("BGFX_SHADER_TYPE_COMPUTE=1");
- break;
+ char shaderType = tolower(type[0]);
+ switch (shaderType)
+ {
+ case 'c':
+ preprocessor.setDefine("BGFX_SHADER_TYPE_COMPUTE=1");
+ break;
- case 'f':
- preprocessor.setDefine("BGFX_SHADER_TYPE_FRAGMENT=1");
- break;
+ case 'f':
+ preprocessor.setDefine("BGFX_SHADER_TYPE_FRAGMENT=1");
+ break;
- case 'v':
- preprocessor.setDefine("BGFX_SHADER_TYPE_VERTEX=1");
- break;
+ case 'v':
+ preprocessor.setDefine("BGFX_SHADER_TYPE_VERTEX=1");
+ break;
- default:
- fprintf(stderr, "Unknown type: %s?!", type);
- return EXIT_FAILURE;
- }
+ default:
+ fprintf(stderr, "Unknown type: %s?!", type);
+ return EXIT_FAILURE;
+ }
- bool compiled = false;
+ bool compiled = false;
- FILE* file = fopen(filePath, "r");
- if (NULL == file)
- {
- fprintf(stderr, "Unable to open file '%s'.\n", filePath);
- }
- else
- {
- VaryingMap varyingMap;
-
- std::string defaultVarying = dir + "varying.def.sc";
- const char* varyingdef = cmdLine.findOption("varyingdef", defaultVarying.c_str() );
- File attribdef(varyingdef);
- const char* parse = attribdef.getData();
- if (NULL != parse
- && *parse != '\0')
+ FILE* file = fopen(filePath, "r");
+ if (NULL == file)
{
- preprocessor.addDependency(varyingdef);
+ fprintf(stderr, "Unable to open file '%s'.\n", filePath);
}
else
{
- fprintf(stderr, "ERROR: Failed to parse varying def file: \"%s\" No input/output semantics will be generated in the code!\n", varyingdef);
- }
-
- while (NULL != parse
- && *parse != '\0')
- {
- parse = bx::strws(parse);
- const char* eol = strchr(parse, ';');
- if (NULL == eol)
+ VaryingMap varyingMap;
+
+ std::string defaultVarying = dir + "varying.def.sc";
+ const char* varyingdef = cmdLine.findOption("varyingdef", defaultVarying.c_str() );
+ File attribdef(varyingdef);
+ const char* parse = attribdef.getData();
+ if (NULL != parse
+ && *parse != '\0')
{
- eol = bx::streol(parse);
+ preprocessor.addDependency(varyingdef);
}
-
- if (NULL != eol)
+ else
{
- const char* precision = NULL;
- const char* interpolation = NULL;
- const char* typen = parse;
+ fprintf(stderr, "ERROR: Failed to parse varying def file: \"%s\" No input/output semantics will be generated in the code!\n", varyingdef);
+ }
- if (0 == strncmp(typen, "lowp", 4)
- || 0 == strncmp(typen, "mediump", 7)
- || 0 == strncmp(typen, "highp", 5) )
+ while (NULL != parse
+ && *parse != '\0')
+ {
+ parse = bx::strws(parse);
+ const char* eol = strchr(parse, ';');
+ if (NULL == eol)
{
- precision = typen;
- typen = parse = bx::strws(bx::strword(parse) );
+ eol = bx::streol(parse);
}
- if (0 == strncmp(typen, "flat", 4)
- || 0 == strncmp(typen, "smooth", 6)
- || 0 == strncmp(typen, "noperspective", 13) )
+ if (NULL != eol)
{
- interpolation = typen;
- typen = parse = bx::strws(bx::strword(parse) );
- }
+ const char* precision = NULL;
+ const char* interpolation = NULL;
+ const char* typen = parse;
- const char* name = parse = bx::strws(bx::strword(parse) );
- const char* column = parse = bx::strws(bx::strword(parse) );
- const char* semantics = parse = bx::strws((*parse == ':' ? ++parse : parse));
- const char* assign = parse = bx::strws(bx::strword(parse) );
- const char* init = parse = bx::strws((*parse == '=' ? ++parse : parse));
-
- if (typen < eol
- && name < eol
- && column < eol
- && ':' == *column
- && semantics < eol)
- {
- Varying var;
- if (NULL != precision)
+ if (0 == strncmp(typen, "lowp", 4)
+ || 0 == strncmp(typen, "mediump", 7)
+ || 0 == strncmp(typen, "highp", 5) )
{
- var.m_precision.assign(precision, bx::strword(precision)-precision);
+ precision = typen;
+ typen = parse = bx::strws(bx::strword(parse) );
}
- if (NULL != interpolation)
+ if (0 == strncmp(typen, "flat", 4)
+ || 0 == strncmp(typen, "smooth", 6)
+ || 0 == strncmp(typen, "noperspective", 13) )
{
- var.m_interpolation.assign(interpolation, bx::strword(interpolation)-interpolation);
+ interpolation = typen;
+ typen = parse = bx::strws(bx::strword(parse) );
}
- var.m_type.assign(typen, bx::strword(typen)-typen);
- var.m_name.assign(name, bx::strword(name)-name);
- var.m_semantics.assign(semantics, bx::strword(semantics)-semantics);
-
- if (d3d == 9
- && var.m_semantics == "BITANGENT")
+ const char* name = parse = bx::strws(bx::strword(parse) );
+ const char* column = parse = bx::strws(bx::strword(parse) );
+ const char* semantics = parse = bx::strws( (*parse == ':' ? ++parse : parse) );
+ const char* assign = parse = bx::strws(bx::strword(parse) );
+ const char* init = parse = bx::strws( (*parse == '=' ? ++parse : parse) );
+
+ if (typen < eol
+ && name < eol
+ && column < eol
+ && ':' == *column
+ && semantics < eol)
{
- var.m_semantics = "BINORMAL";
- }
+ Varying var;
+ if (NULL != precision)
+ {
+ var.m_precision.assign(precision, bx::strword(precision)-precision);
+ }
- if (assign < eol
- && '=' == *assign
- && init < eol)
- {
- var.m_init.assign(init, eol-init);
+ if (NULL != interpolation)
+ {
+ var.m_interpolation.assign(interpolation, bx::strword(interpolation)-interpolation);
+ }
+
+ var.m_type.assign(typen, bx::strword(typen)-typen);
+ var.m_name.assign(name, bx::strword(name)-name);
+ var.m_semantics.assign(semantics, bx::strword(semantics)-semantics);
+
+ if (d3d == 9
+ && var.m_semantics == "BITANGENT")
+ {
+ var.m_semantics = "BINORMAL";
+ }
+
+ if (assign < eol
+ && '=' == *assign
+ && init < eol)
+ {
+ var.m_init.assign(init, eol-init);
+ }
+
+ varyingMap.insert(std::make_pair(var.m_name, var) );
}
- varyingMap.insert(std::make_pair(var.m_name, var) );
+ parse = bx::strws(bx::strnl(eol) );
}
-
- parse = bx::strws(bx::strnl(eol) );
}
- }
- InOut shaderInputs;
- InOut shaderOutputs;
- uint32_t inputHash = 0;
- uint32_t outputHash = 0;
+ InOut shaderInputs;
+ InOut shaderOutputs;
+ uint32_t inputHash = 0;
+ uint32_t outputHash = 0;
- char* data;
- char* input;
- {
- const size_t padding = 1024;
- uint32_t size = (uint32_t)fsize(file);
- data = new char[size+padding+1];
- size = (uint32_t)fread(data, 1, size, file);
- // Compiler generates "error X3000: syntax error: unexpected end of file"
- // if input doesn't have empty line at EOF.
- data[size] = '\n';
- memset(&data[size+1], 0, padding);
- fclose(file);
-
- strNormalizeEol(data);
-
- input = const_cast<char*>(bx::strws(data) );
- while (input[0] == '$')
+ char* data;
+ char* input;
{
- const char* str = bx::strws(input+1);
- const char* eol = bx::streol(str);
- const char* nl = bx::strnl(eol);
- input = const_cast<char*>(nl);
+ const size_t padding = 1024;
+ uint32_t size = (uint32_t)fsize(file);
+ data = new char[size+padding+1];
+ size = (uint32_t)fread(data, 1, size, file);
+ // Compiler generates "error X3000: syntax error: unexpected end of file"
+ // if input doesn't have empty line at EOF.
+ data[size] = '\n';
+ memset(&data[size+1], 0, padding);
+ fclose(file);
- if (0 == strncmp(str, "input", 5) )
- {
- str += 5;
- const char* comment = strstr(str, "//");
- eol = NULL != comment && comment < eol ? comment : eol;
- inputHash = parseInOut(shaderInputs, str, eol);
- }
- else if (0 == strncmp(str, "output", 6) )
+ strNormalizeEol(data);
+
+ input = const_cast<char*>(bx::strws(data) );
+ while (input[0] == '$')
{
- str += 6;
- const char* comment = strstr(str, "//");
- eol = NULL != comment && comment < eol ? comment : eol;
- outputHash = parseInOut(shaderOutputs, str, eol);
+ const char* str = bx::strws(input+1);
+ const char* eol = bx::streol(str);
+ const char* nl = bx::strnl(eol);
+ input = const_cast<char*>(nl);
+
+ if (0 == strncmp(str, "input", 5) )
+ {
+ str += 5;
+ const char* comment = strstr(str, "//");
+ eol = NULL != comment && comment < eol ? comment : eol;
+ inputHash = parseInOut(shaderInputs, str, eol);
+ }
+ else if (0 == strncmp(str, "output", 6) )
+ {
+ str += 6;
+ const char* comment = strstr(str, "//");
+ eol = NULL != comment && comment < eol ? comment : eol;
+ outputHash = parseInOut(shaderOutputs, str, eol);
+ }
+ else if (0 == strncmp(str, "raw", 3) )
+ {
+ raw = true;
+ str += 3;
+ }
+
+ input = const_cast<char*>(bx::strws(input) );
}
- else if (0 == strncmp(str, "raw", 3) )
+
+ if (!raw)
{
- raw = true;
- str += 3;
+ // To avoid commented code being recognized as used feature,
+ // first preprocess pass is used to strip all comments before
+ // substituting code.
+ preprocessor.run(input);
+ delete [] data;
+
+ size = (uint32_t)preprocessor.m_preprocessed.size();
+ data = new char[size+padding+1];
+ memcpy(data, preprocessor.m_preprocessed.c_str(), size);
+ memset(&data[size], 0, padding+1);
+ input = data;
}
-
- input = const_cast<char*>(bx::strws(input) );
}
- if (!raw)
+ if (raw)
{
- // To avoid commented code being recognized as used feature,
- // first preprocess pass is used to strip all comments before
- // substituting code.
- preprocessor.run(input);
- delete [] data;
-
- size = (uint32_t)preprocessor.m_preprocessed.size();
- data = new char[size+padding+1];
- memcpy(data, preprocessor.m_preprocessed.c_str(), size);
- memset(&data[size], 0, padding+1);
- input = data;
- }
- }
+ bx::CrtFileWriter* writer = NULL;
- if (raw)
- {
- bx::CrtFileWriter* writer = NULL;
-
- if (NULL != bin2c)
- {
- writer = new Bin2cWriter(bin2c);
- }
- else
- {
- writer = new bx::CrtFileWriter;
- }
+ if (NULL != bin2c)
+ {
+ writer = new Bin2cWriter(bin2c);
+ }
+ else
+ {
+ writer = new bx::CrtFileWriter;
+ }
- if (0 != writer->open(outFilePath) )
- {
- fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
- return EXIT_FAILURE;
- }
+ if (!bx::open(writer, outFilePath) )
+ {
+ fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
+ return EXIT_FAILURE;
+ }
- if ('f' == shaderType)
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_FSH);
- bx::write(writer, inputHash);
- }
- else if ('v' == shaderType)
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_VSH);
- bx::write(writer, outputHash);
- }
- else
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
- bx::write(writer, outputHash);
- }
+ if ('f' == shaderType)
+ {
+ bx::write(writer, BGFX_CHUNK_MAGIC_FSH);
+ bx::write(writer, inputHash);
+ }
+ else if ('v' == shaderType)
+ {
+ bx::write(writer, BGFX_CHUNK_MAGIC_VSH);
+ bx::write(writer, outputHash);
+ }
+ else
+ {
+ bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
+ bx::write(writer, outputHash);
+ }
- if (0 != glsl)
- {
- bx::write(writer, uint16_t(0) );
+ if (0 != glsl)
+ {
+ bx::write(writer, uint16_t(0) );
- uint32_t shaderSize = (uint32_t)strlen(input);
- bx::write(writer, shaderSize);
- bx::write(writer, input, shaderSize);
- bx::write(writer, uint8_t(0) );
+ uint32_t shaderSize = (uint32_t)strlen(input);
+ bx::write(writer, shaderSize);
+ bx::write(writer, input, shaderSize);
+ bx::write(writer, uint8_t(0) );
- compiled = true;
- }
- else
- {
- compiled = compileHLSLShader(cmdLine, d3d, input, writer);
- }
+ compiled = true;
+ }
+ else
+ {
+ compiled = compileHLSLShader(cmdLine, d3d, input, writer);
+ }
- writer->close();
- delete writer;
- }
- else if ('c' == shaderType) // Compute
- {
- char* entry = strstr(input, "void main()");
- if (NULL == entry)
- {
- fprintf(stderr, "Shader entry point 'void main()' is not found.\n");
+ bx::close(writer);
+ delete writer;
}
- else
+ else if ('c' == shaderType) // Compute
{
- if (0 != glsl
- || 0 != essl
- || 0 != metal)
+ char* entry = strstr(input, "void main()");
+ if (NULL == entry)
{
+ fprintf(stderr, "Shader entry point 'void main()' is not found.\n");
}
else
{
- preprocessor.writef(
- "#define lowp\n"
- "#define mediump\n"
- "#define highp\n"
- "#define ivec2 int2\n"
- "#define ivec3 int3\n"
- "#define ivec4 int4\n"
- "#define uvec2 uint2\n"
- "#define uvec3 uint3\n"
- "#define uvec4 uint4\n"
- "#define vec2 float2\n"
- "#define vec3 float3\n"
- "#define vec4 float4\n"
- "#define mat2 float2x2\n"
- "#define mat3 float3x3\n"
- "#define mat4 float4x4\n"
- );
-
- entry[4] = '_';
-
- preprocessor.writef("#define void_main()");
- preprocessor.writef(" \\\n\tvoid main(");
-
- uint32_t arg = 0;
-
- const bool hasLocalInvocationID = NULL != strstr(input, "gl_LocalInvocationID");
- const bool hasLocalInvocationIndex = NULL != strstr(input, "gl_LocalInvocationIndex");
- const bool hasGlobalInvocationID = NULL != strstr(input, "gl_GlobalInvocationID");
- const bool hasWorkGroupID = NULL != strstr(input, "gl_WorkGroupID");
-
- if (hasLocalInvocationID)
- {
- preprocessor.writef(
- " \\\n\t%sint3 gl_LocalInvocationID : SV_GroupThreadID"
- , arg++ > 0 ? ", " : " "
- );
- }
-
- if (hasLocalInvocationIndex)
+ if (0 != glsl
+ || 0 != essl
+ || 0 != metal)
{
- preprocessor.writef(
- " \\\n\t%sint gl_LocalInvocationIndex : SV_GroupIndex"
- , arg++ > 0 ? ", " : " "
- );
}
-
- if (hasGlobalInvocationID)
+ else
{
preprocessor.writef(
- " \\\n\t%sint3 gl_GlobalInvocationID : SV_DispatchThreadID"
- , arg++ > 0 ? ", " : " "
+ "#define lowp\n"
+ "#define mediump\n"
+ "#define highp\n"
+ "#define ivec2 int2\n"
+ "#define ivec3 int3\n"
+ "#define ivec4 int4\n"
+ "#define uvec2 uint2\n"
+ "#define uvec3 uint3\n"
+ "#define uvec4 uint4\n"
+ "#define vec2 float2\n"
+ "#define vec3 float3\n"
+ "#define vec4 float4\n"
+ "#define mat2 float2x2\n"
+ "#define mat3 float3x3\n"
+ "#define mat4 float4x4\n"
);
- }
- if (hasWorkGroupID)
- {
- preprocessor.writef(
- " \\\n\t%sint3 gl_WorkGroupID : SV_GroupID"
- , arg++ > 0 ? ", " : " "
- );
- }
+ entry[4] = '_';
- preprocessor.writef(
- " \\\n\t)\n"
- );
- }
+ preprocessor.writef("#define void_main()");
+ preprocessor.writef(" \\\n\tvoid main(");
- if (preprocessor.run(input) )
- {
- BX_TRACE("Input file: %s", filePath);
- BX_TRACE("Output file: %s", outFilePath);
+ uint32_t arg = 0;
- if (preprocessOnly)
- {
- bx::CrtFileWriter writer;
+ const bool hasLocalInvocationID = NULL != strstr(input, "gl_LocalInvocationID");
+ const bool hasLocalInvocationIndex = NULL != strstr(input, "gl_LocalInvocationIndex");
+ const bool hasGlobalInvocationID = NULL != strstr(input, "gl_GlobalInvocationID");
+ const bool hasWorkGroupID = NULL != strstr(input, "gl_WorkGroupID");
- if (0 != writer.open(outFilePath) )
+ if (hasLocalInvocationID)
{
- fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
- return EXIT_FAILURE;
+ preprocessor.writef(
+ " \\\n\t%sint3 gl_LocalInvocationID : SV_GroupThreadID"
+ , arg++ > 0 ? ", " : " "
+ );
}
- writer.write(preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
- writer.close();
-
- return EXIT_SUCCESS;
- }
-
- {
- bx::CrtFileWriter* writer = NULL;
-
- if (NULL != bin2c)
+ if (hasLocalInvocationIndex)
{
- writer = new Bin2cWriter(bin2c);
+ preprocessor.writef(
+ " \\\n\t%sint gl_LocalInvocationIndex : SV_GroupIndex"
+ , arg++ > 0 ? ", " : " "
+ );
}
- else
+
+ if (hasGlobalInvocationID)
{
- writer = new bx::CrtFileWriter;
+ preprocessor.writef(
+ " \\\n\t%sint3 gl_GlobalInvocationID : SV_DispatchThreadID"
+ , arg++ > 0 ? ", " : " "
+ );
}
- if (0 != writer->open(outFilePath) )
+ if (hasWorkGroupID)
{
- fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
- return EXIT_FAILURE;
+ preprocessor.writef(
+ " \\\n\t%sint3 gl_WorkGroupID : SV_GroupID"
+ , arg++ > 0 ? ", " : " "
+ );
}
- bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
- bx::write(writer, outputHash);
+ preprocessor.writef(
+ " \\\n\t)\n"
+ );
+ }
- if (0 != glsl
- || 0 != essl)
+ if (preprocessor.run(input) )
+ {
+ BX_TRACE("Input file: %s", filePath);
+ BX_TRACE("Output file: %s", outFilePath);
+
+ if (preprocessOnly)
{
- std::string code;
+ bx::CrtFileWriter writer;
- if (essl)
- {
- bx::stringPrintf(code, "#version 310 es\n");
- }
- else
+ if (!bx::open(&writer, outFilePath) )
{
- bx::stringPrintf(code, "#version %d\n", glsl == 0 ? 430 : glsl);
+ fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
+ return EXIT_FAILURE;
}
- code += preprocessor.m_preprocessed;
-#if 1
- bx::write(writer, uint16_t(0) );
-
- 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, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
+ bx::close(&writer);
- compiled = true;
-#else
- compiled = compileGLSLShader(cmdLine, essl, code, writer);
-#endif // 0
- }
- else
- {
- compiled = compileHLSLShader(cmdLine, d3d, preprocessor.m_preprocessed, writer);
+ return EXIT_SUCCESS;
}
- writer->close();
- delete writer;
- }
-
- if (compiled)
- {
- if (depends)
{
- std::string ofp = outFilePath;
- ofp += ".d";
- bx::CrtFileWriter writer;
- if (0 == writer.open(ofp.c_str() ) )
+ bx::CrtFileWriter* writer = NULL;
+
+ if (NULL != bin2c)
{
- writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() );
- writer.close();
+ writer = new Bin2cWriter(bin2c);
+ }
+ else
+ {
+ writer = new bx::CrtFileWriter;
}
- }
- }
- }
- }
- }
- else // Vertex/Fragment
- {
- char* entry = strstr(input, "void main()");
- if (NULL == entry)
- {
- fprintf(stderr, "Shader entry point 'void main()' is not found.\n");
- }
- else
- {
- if (0 != glsl
- || 0 != essl
- || 0 != metal)
- {
- if (120 == glsl
- || 0 != essl)
- {
- preprocessor.writef(
- "#define ivec2 vec2\n"
- "#define ivec3 vec3\n"
- "#define ivec4 vec4\n"
- );
- }
- if (0 == essl)
- {
- // bgfx shadow2D/Proj behave like EXT_shadow_samplers
- // not as GLSL language 1.2 specs shadow2D/Proj.
- preprocessor.writef(
- "#define shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord).x\n"
- "#define shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord).x\n"
- );
- }
+ if (!bx::open(writer, outFilePath) )
+ {
+ fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
+ return EXIT_FAILURE;
+ }
- for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
- {
- VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
- if (varyingIt != varyingMap.end() )
- {
- const Varying& var = varyingIt->second;
- const char* name = var.m_name.c_str();
+ bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
+ bx::write(writer, outputHash);
- if (0 == strncmp(name, "a_", 2)
- || 0 == strncmp(name, "i_", 2) )
+ if (0 != glsl
+ || 0 != essl)
{
- preprocessor.writef("attribute %s %s %s %s;\n"
- , var.m_precision.c_str()
- , var.m_interpolation.c_str()
- , var.m_type.c_str()
- , name
- );
+ std::string code;
+
+ if (essl)
+ {
+ bx::stringPrintf(code, "#version 310 es\n");
+ }
+ else
+ {
+ bx::stringPrintf(code, "#version %d\n", glsl == 0 ? 430 : glsl);
+ }
+
+ code += preprocessor.m_preprocessed;
+ #if 1
+ bx::write(writer, uint16_t(0) );
+
+ uint32_t shaderSize = (uint32_t)code.size();
+ bx::write(writer, shaderSize);
+ bx::write(writer, code.c_str(), shaderSize);
+ bx::write(writer, uint8_t(0) );
+
+ compiled = true;
+ #else
+ compiled = compileGLSLShader(cmdLine, essl, code, writer);
+ #endif // 0
}
else
{
- preprocessor.writef("%s varying %s %s %s;\n"
- , var.m_interpolation.c_str()
- , var.m_precision.c_str()
- , var.m_type.c_str()
- , name
- );
+ compiled = compileHLSLShader(cmdLine, d3d, preprocessor.m_preprocessed, writer);
}
+
+ bx::close(writer);
+ delete writer;
}
- }
- for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
- {
- VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
- if (varyingIt != varyingMap.end() )
+ if (compiled)
{
- const Varying& var = varyingIt->second;
- preprocessor.writef("%s varying %s %s;\n"
- , var.m_interpolation.c_str()
- , var.m_type.c_str()
- , var.m_name.c_str()
- );
+ if (depends)
+ {
+ std::string ofp = outFilePath;
+ ofp += ".d";
+ bx::CrtFileWriter writer;
+ if (bx::open(&writer, ofp.c_str() ) )
+ {
+ writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() );
+ bx::close(&writer);
+ }
+ }
}
}
}
+ }
+ else // Vertex/Fragment
+ {
+ char* entry = strstr(input, "void main()");
+ if (NULL == entry)
+ {
+ fprintf(stderr, "Shader entry point 'void main()' is not found.\n");
+ }
else
{
- preprocessor.writef(
- "#define lowp\n"
- "#define mediump\n"
- "#define highp\n"
- "#define ivec2 int2\n"
- "#define ivec3 int3\n"
- "#define ivec4 int4\n"
- "#define uvec2 uint2\n"
- "#define uvec3 uint3\n"
- "#define uvec4 uint4\n"
- "#define vec2 float2\n"
- "#define vec3 float3\n"
- "#define vec4 float4\n"
- "#define mat2 float2x2\n"
- "#define mat3 float3x3\n"
- "#define mat4 float4x4\n"
- );
-
- if (hlsl < 4)
+ if (0 != glsl
+ || 0 != essl
+ || 0 != metal)
{
- preprocessor.writef(
- "#define flat\n"
- "#define smooth\n"
- "#define noperspective\n"
- );
- }
-
- entry[4] = '_';
-
- if ('f' == shaderType)
- {
- const char* brace = strstr(entry, "{");
- if (NULL != brace)
+ if (120 == glsl
+ || 0 != essl)
{
- strInsert(const_cast<char*>(brace+1), "\nvec4 bgfx_VoidFrag;\n");
+ preprocessor.writef(
+ "#define ivec2 vec2\n"
+ "#define ivec3 vec3\n"
+ "#define ivec4 vec4\n"
+ );
}
- const bool hasFragCoord = NULL != strstr(input, "gl_FragCoord") || hlsl > 3 || hlsl == 2;
- const bool hasFragDepth = NULL != strstr(input, "gl_FragDepth");
- const bool hasFrontFacing = NULL != strstr(input, "gl_FrontFacing");
- const bool hasPrimitiveId = NULL != strstr(input, "gl_PrimitiveID");
-
- bool hasFragData[8] = {};
- uint32_t numFragData = 0;
- for (uint32_t ii = 0; ii < BX_COUNTOF(hasFragData); ++ii)
+ if (0 == essl)
{
- char temp[32];
- bx::snprintf(temp, BX_COUNTOF(temp), "gl_FragData[%d]", ii);
- hasFragData[ii] = NULL != strstr(input, temp);
- numFragData += hasFragData[ii];
+ // bgfx shadow2D/Proj behave like EXT_shadow_samplers
+ // not as GLSL language 1.2 specs shadow2D/Proj.
+ preprocessor.writef(
+ "#define shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord).x\n"
+ "#define shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord).x\n"
+ );
}
- if (0 == numFragData)
+ for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
{
- // GL errors when both gl_FragColor and gl_FragData is used.
- // This will trigger the same error with HLSL compiler too.
- preprocessor.writef("#define gl_FragColor gl_FragData_0_\n");
- }
-
- preprocessor.writef("#define void_main()");
- preprocessor.writef(" \\\n\tvoid main(");
-
- uint32_t arg = 0;
+ VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
+ if (varyingIt != varyingMap.end() )
+ {
+ const Varying& var = varyingIt->second;
+ const char* name = var.m_name.c_str();
- if (hasFragCoord)
- {
- preprocessor.writef(" \\\n\tvec4 gl_FragCoord : SV_POSITION");
- ++arg;
+ if (0 == strncmp(name, "a_", 2)
+ || 0 == strncmp(name, "i_", 2) )
+ {
+ preprocessor.writef("attribute %s %s %s %s;\n"
+ , var.m_precision.c_str()
+ , var.m_interpolation.c_str()
+ , var.m_type.c_str()
+ , name
+ );
+ }
+ else
+ {
+ preprocessor.writef("%s varying %s %s %s;\n"
+ , var.m_interpolation.c_str()
+ , var.m_precision.c_str()
+ , var.m_type.c_str()
+ , name
+ );
+ }
+ }
}
- for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
+ for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
{
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
if (varyingIt != varyingMap.end() )
{
const Varying& var = varyingIt->second;
- preprocessor.writef(" \\\n\t%s%s %s %s : %s"
- , arg++ > 0 ? ", " : " "
- , interpolationDx11(var.m_interpolation.c_str() )
+ preprocessor.writef("%s varying %s %s;\n"
+ , var.m_interpolation.c_str()
, var.m_type.c_str()
, var.m_name.c_str()
- , var.m_semantics.c_str()
);
}
}
+ }
+ else
+ {
+ preprocessor.writef(
+ "#define lowp\n"
+ "#define mediump\n"
+ "#define highp\n"
+ "#define ivec2 int2\n"
+ "#define ivec3 int3\n"
+ "#define ivec4 int4\n"
+ "#define uvec2 uint2\n"
+ "#define uvec3 uint3\n"
+ "#define uvec4 uint4\n"
+ "#define vec2 float2\n"
+ "#define vec3 float3\n"
+ "#define vec4 float4\n"
+ "#define mat2 float2x2\n"
+ "#define mat3 float3x3\n"
+ "#define mat4 float4x4\n"
+ );
- addFragData(preprocessor, input, 0, arg++ > 0);
+ if (hlsl < 4)
+ {
+ preprocessor.writef(
+ "#define flat\n"
+ "#define smooth\n"
+ "#define noperspective\n"
+ );
+ }
- const uint32_t maxRT = d3d > 9 ? BX_COUNTOF(hasFragData) : 4;
+ entry[4] = '_';
- for (uint32_t ii = 1; ii < BX_COUNTOF(hasFragData); ++ii)
+ if ('f' == shaderType)
{
- if (ii < maxRT)
+ const char* brace = strstr(entry, "{");
+ if (NULL != brace)
{
- if (hasFragData[ii])
- {
- addFragData(preprocessor, input, ii, arg++ > 0);
- }
+ strInsert(const_cast<char*>(brace+1), "\nvec4 bgfx_VoidFrag;\n");
}
- else
+
+ const bool hasFragCoord = NULL != strstr(input, "gl_FragCoord") || hlsl > 3 || hlsl == 2;
+ const bool hasFragDepth = NULL != strstr(input, "gl_FragDepth");
+ const bool hasFrontFacing = NULL != strstr(input, "gl_FrontFacing");
+ const bool hasPrimitiveId = NULL != strstr(input, "gl_PrimitiveID");
+
+ bool hasFragData[8] = {};
+ uint32_t numFragData = 0;
+ for (uint32_t ii = 0; ii < BX_COUNTOF(hasFragData); ++ii)
{
- voidFragData(input, ii);
+ char temp[32];
+ bx::snprintf(temp, BX_COUNTOF(temp), "gl_FragData[%d]", ii);
+ hasFragData[ii] = NULL != strstr(input, temp);
+ numFragData += hasFragData[ii];
}
- }
- if (hasFragDepth)
- {
- preprocessor.writef(
- " \\\n\t%sout float gl_FragDepth : SV_DEPTH"
- , arg++ > 0 ? ", " : " "
- );
- }
+ if (0 == numFragData)
+ {
+ // GL errors when both gl_FragColor and gl_FragData is used.
+ // This will trigger the same error with HLSL compiler too.
+ preprocessor.writef("#define gl_FragColor gl_FragData_0_\n");
+ }
- if (hasFrontFacing
- && hlsl >= 3)
- {
- preprocessor.writef(
- " \\\n\t%sfloat __vface : VFACE"
- , arg++ > 0 ? ", " : " "
- );
- }
+ preprocessor.writef("#define void_main()");
+ preprocessor.writef(" \\\n\tvoid main(");
- if (hasPrimitiveId)
- {
- if (d3d > 9)
+ uint32_t arg = 0;
+
+ if (hasFragCoord)
{
- preprocessor.writef(
- " \\\n\t%suint gl_PrimitiveID : SV_PrimitiveID"
- , arg++ > 0 ? ", " : " "
- );
+ preprocessor.writef(" \\\n\tvec4 gl_FragCoord : SV_POSITION");
+ ++arg;
}
- else
+
+ for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
{
- fprintf(stderr, "PrimitiveID builtin is not supported by this D3D9 HLSL.\n");
- return EXIT_FAILURE;
+ VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
+ if (varyingIt != varyingMap.end() )
+ {
+ const Varying& var = varyingIt->second;
+ preprocessor.writef(" \\\n\t%s%s %s %s : %s"
+ , arg++ > 0 ? ", " : " "
+ , interpolationDx11(var.m_interpolation.c_str() )
+ , var.m_type.c_str()
+ , var.m_name.c_str()
+ , var.m_semantics.c_str()
+ );
+ }
}
- }
- preprocessor.writef(
- " \\\n\t)\n"
- );
+ addFragData(preprocessor, input, 0, arg++ > 0);
- if (hasFrontFacing)
- {
- if (hlsl >= 3)
+ const uint32_t maxRT = d3d > 9 ? BX_COUNTOF(hasFragData) : 4;
+
+ for (uint32_t ii = 1; ii < BX_COUNTOF(hasFragData); ++ii)
+ {
+ if (ii < maxRT)
+ {
+ if (hasFragData[ii])
+ {
+ addFragData(preprocessor, input, ii, arg++ > 0);
+ }
+ }
+ else
+ {
+ voidFragData(input, ii);
+ }
+ }
+
+ if (hasFragDepth)
{
preprocessor.writef(
- "#define gl_FrontFacing (__vface <= 0.0)\n"
+ " \\\n\t%sout float gl_FragDepth : SV_DEPTH"
+ , arg++ > 0 ? ", " : " "
);
}
- else
+
+ if (hasFrontFacing
+ && hlsl >= 3)
{
preprocessor.writef(
- "#define gl_FrontFacing false\n"
+ " \\\n\t%sfloat __vface : VFACE"
+ , arg++ > 0 ? ", " : " "
);
}
- }
- }
- else if ('v' == shaderType)
- {
- const char* brace = strstr(entry, "{");
- if (NULL != brace)
- {
- const char* end = bx::strmb(brace, '{', '}');
- if (NULL != end)
+
+ if (hasPrimitiveId)
{
- strInsert(const_cast<char*>(end), "__RETURN__;\n");
+ if (d3d > 9)
+ {
+ preprocessor.writef(
+ " \\\n\t%suint gl_PrimitiveID : SV_PrimitiveID"
+ , arg++ > 0 ? ", " : " "
+ );
+ }
+ else
+ {
+ fprintf(stderr, "PrimitiveID builtin is not supported by this D3D9 HLSL.\n");
+ return EXIT_FAILURE;
+ }
}
- }
- preprocessor.writef(
- "struct Output\n"
- "{\n"
- "\tvec4 gl_Position : SV_POSITION;\n"
- "#define gl_Position _varying_.gl_Position\n"
- );
- for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
- {
- VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
- if (varyingIt != varyingMap.end() )
+ preprocessor.writef(
+ " \\\n\t)\n"
+ );
+
+ if (hasFrontFacing)
{
- const Varying& var = varyingIt->second;
- preprocessor.writef("\t%s %s : %s;\n", var.m_type.c_str(), var.m_name.c_str(), var.m_semantics.c_str() );
- preprocessor.writef("#define %s _varying_.%s\n", var.m_name.c_str(), var.m_name.c_str() );
+ if (hlsl >= 3)
+ {
+ preprocessor.writef(
+ "#define gl_FrontFacing (__vface <= 0.0)\n"
+ );
+ }
+ else
+ {
+ preprocessor.writef(
+ "#define gl_FrontFacing false\n"
+ );
+ }
}
}
- preprocessor.writef(
- "};\n"
- );
-
- preprocessor.writef("#define void_main() \\\n");
- preprocessor.writef("Output main(");
- bool first = true;
- for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
+ else if ('v' == shaderType)
{
- VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
- if (varyingIt != varyingMap.end() )
+ const char* brace = strstr(entry, "{");
+ if (NULL != brace)
{
- const Varying& var = varyingIt->second;
- preprocessor.writef("%s%s %s : %s\\\n", first ? "" : "\t, ", var.m_type.c_str(), var.m_name.c_str(), var.m_semantics.c_str() );
- first = false;
+ const char* end = bx::strmb(brace, '{', '}');
+ if (NULL != end)
+ {
+ strInsert(const_cast<char*>(end), "__RETURN__;\n");
+ }
}
- }
- preprocessor.writef(
- ") \\\n"
- "{ \\\n"
- "\tOutput _varying_;"
- );
- for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
- {
- VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
- if (varyingIt != varyingMap.end() )
+ preprocessor.writef(
+ "struct Output\n"
+ "{\n"
+ "\tvec4 gl_Position : SV_POSITION;\n"
+ "#define gl_Position _varying_.gl_Position\n"
+ );
+ for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
{
- const Varying& var = varyingIt->second;
- preprocessor.writef(" \\\n\t%s", var.m_name.c_str() );
- if (!var.m_init.empty() )
+ VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
+ if (varyingIt != varyingMap.end() )
{
- preprocessor.writef(" = %s", var.m_init.c_str() );
+ const Varying& var = varyingIt->second;
+ preprocessor.writef("\t%s %s : %s;\n", var.m_type.c_str(), var.m_name.c_str(), var.m_semantics.c_str() );
+ preprocessor.writef("#define %s _varying_.%s\n", var.m_name.c_str(), var.m_name.c_str() );
}
- preprocessor.writef(";");
}
- }
-
- preprocessor.writef(
- "\n#define __RETURN__ \\\n"
- "\t} \\\n"
- "\treturn _varying_"
- );
- }
- }
-
- if (preprocessor.run(input) )
- {
- BX_TRACE("Input file: %s", filePath);
- BX_TRACE("Output file: %s", outFilePath);
-
- if (preprocessOnly)
- {
- bx::CrtFileWriter writer;
+ preprocessor.writef(
+ "};\n"
+ );
- if (0 != writer.open(outFilePath) )
- {
- fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
- return EXIT_FAILURE;
- }
+ preprocessor.writef("#define void_main() \\\n");
+ preprocessor.writef("Output main(");
+ bool first = true;
+ for (InOut::const_iterator it = shaderInputs.begin(), itEnd = shaderInputs.end(); it != itEnd; ++it)
+ {
+ VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
+ if (varyingIt != varyingMap.end() )
+ {
+ const Varying& var = varyingIt->second;
+ preprocessor.writef("%s%s %s : %s\\\n", first ? "" : "\t, ", var.m_type.c_str(), var.m_name.c_str(), var.m_semantics.c_str() );
+ first = false;
+ }
+ }
+ preprocessor.writef(
+ ") \\\n"
+ "{ \\\n"
+ "\tOutput _varying_;"
+ );
- if (0 != glsl)
- {
- if (NULL == profile)
+ for (InOut::const_iterator it = shaderOutputs.begin(), itEnd = shaderOutputs.end(); it != itEnd; ++it)
{
- writef(&writer
- , "#ifdef GL_ES\n"
- "precision highp float;\n"
- "#endif // GL_ES\n\n"
- );
+ VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
+ if (varyingIt != varyingMap.end() )
+ {
+ const Varying& var = varyingIt->second;
+ preprocessor.writef(" \\\n\t%s", var.m_name.c_str() );
+ if (!var.m_init.empty() )
+ {
+ preprocessor.writef(" = %s", var.m_init.c_str() );
+ }
+ preprocessor.writef(";");
+ }
}
- }
- writer.write(preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
- writer.close();
- return EXIT_SUCCESS;
+ preprocessor.writef(
+ "\n#define __RETURN__ \\\n"
+ "\t} \\\n"
+ "\treturn _varying_"
+ );
+ }
}
+ if (preprocessor.run(input) )
{
- bx::CrtFileWriter* writer = NULL;
+ BX_TRACE("Input file: %s", filePath);
+ BX_TRACE("Output file: %s", outFilePath);
- if (NULL != bin2c)
- {
- writer = new Bin2cWriter(bin2c);
- }
- else
+ if (preprocessOnly)
{
- writer = new bx::CrtFileWriter;
- }
+ bx::CrtFileWriter writer;
- if (0 != writer->open(outFilePath) )
- {
- fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
- return EXIT_FAILURE;
- }
+ if (!bx::open(&writer, outFilePath) )
+ {
+ fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
+ return EXIT_FAILURE;
+ }
- if ('f' == shaderType)
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_FSH);
- bx::write(writer, inputHash);
- }
- else if ('v' == shaderType)
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_VSH);
- bx::write(writer, outputHash);
- }
- else
- {
- bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
- bx::write(writer, outputHash);
+ if (0 != glsl)
+ {
+ if (NULL == profile)
+ {
+ writef(&writer
+ , "#ifdef GL_ES\n"
+ "precision highp float;\n"
+ "#endif // GL_ES\n\n"
+ );
+ }
+ }
+ bx::write(&writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
+ bx::close(&writer);
+
+ return EXIT_SUCCESS;
}
- if (0 != glsl
- || 0 != essl
- || 0 != metal)
{
- std::string code;
-
- bool hasTextureLod = NULL != bx::findIdentifierMatch(input, s_ARB_shader_texture_lod /*EXT_shader_texture_lod*/);
+ bx::CrtFileWriter* writer = NULL;
- if (0 == essl)
+ if (NULL != bin2c)
{
- const bool need130 = 120 == glsl
- && bx::findIdentifierMatch(input, s_130)
- ;
-
- if (0 != metal)
- {
- bx::stringPrintf(code, "#version 120\n");
- }
- else
- {
- bx::stringPrintf(code, "#version %s\n", need130 ? "130" : profile);
- }
+ writer = new Bin2cWriter(bin2c);
+ }
+ else
+ {
+ writer = new bx::CrtFileWriter;
+ }
- bx::stringPrintf(code
- , "#define bgfxShadow2D shadow2D\n"
- "#define bgfxShadow2DProj shadow2DProj\n"
- );
+ if (!bx::open(writer, outFilePath) )
+ {
+ fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
+ return EXIT_FAILURE;
+ }
- if (hasTextureLod
- && 130 > glsl)
- {
- bx::stringPrintf(code
- , "#extension GL_ARB_shader_texture_lod : enable\n"
- );
- }
+ if ('f' == shaderType)
+ {
+ bx::write(writer, BGFX_CHUNK_MAGIC_FSH);
+ bx::write(writer, inputHash);
+ }
+ else if ('v' == shaderType)
+ {
+ bx::write(writer, BGFX_CHUNK_MAGIC_VSH);
+ bx::write(writer, outputHash);
}
else
{
- // Pretend that all extensions are available.
- // This will be stripped later.
- if (hasTextureLod)
+ bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
+ bx::write(writer, outputHash);
+ }
+
+ if (0 != glsl
+ || 0 != essl
+ || 0 != metal)
+ {
+ std::string code;
+
+ bool hasTextureLod = NULL != bx::findIdentifierMatch(input, s_ARB_shader_texture_lod /*EXT_shader_texture_lod*/);
+
+ if (0 == essl)
{
+ const bool need130 = 120 == glsl
+ && bx::findIdentifierMatch(input, s_130)
+ ;
+
+ if (0 != metal)
+ {
+ bx::stringPrintf(code, "#version 120\n");
+ }
+ else
+ {
+ bx::stringPrintf(code, "#version %s\n", need130 ? "130" : profile);
+ }
+
bx::stringPrintf(code
- , "#extension GL_EXT_shader_texture_lod : enable\n"
- "#define texture2DLod texture2DLodEXT\n"
- "#define texture2DProjLod texture2DProjLodEXT\n"
- "#define textureCubeLod textureCubeLodEXT\n"
-// "#define texture2DGrad texture2DGradEXT\n"
-// "#define texture2DProjGrad texture2DProjGradEXT\n"
-// "#define textureCubeGrad textureCubeGradEXT\n"
+ , "#define bgfxShadow2D shadow2D\n"
+ "#define bgfxShadow2DProj shadow2DProj\n"
);
- }
- if (NULL != bx::findIdentifierMatch(input, s_OES_standard_derivatives) )
- {
- bx::stringPrintf(code, "#extension GL_OES_standard_derivatives : enable\n");
+ if (hasTextureLod
+ && 130 > glsl)
+ {
+ bx::stringPrintf(code
+ , "#extension GL_ARB_shader_texture_lod : enable\n"
+ );
+ }
}
-
- if (NULL != bx::findIdentifierMatch(input, s_OES_texture_3D) )
+ else
{
- bx::stringPrintf(code, "#extension GL_OES_texture_3D : enable\n");
+ // Pretend that all extensions are available.
+ // This will be stripped later.
+ if (hasTextureLod)
+ {
+ bx::stringPrintf(code
+ , "#extension GL_EXT_shader_texture_lod : enable\n"
+ "#define texture2DLod texture2DLodEXT\n"
+ "#define texture2DProjLod texture2DProjLodEXT\n"
+ "#define textureCubeLod textureCubeLodEXT\n"
+ // "#define texture2DGrad texture2DGradEXT\n"
+ // "#define texture2DProjGrad texture2DProjGradEXT\n"
+ // "#define textureCubeGrad textureCubeGradEXT\n"
+ );
+ }
+
+ if (NULL != bx::findIdentifierMatch(input, s_OES_standard_derivatives) )
+ {
+ bx::stringPrintf(code, "#extension GL_OES_standard_derivatives : enable\n");
+ }
+
+ if (NULL != bx::findIdentifierMatch(input, s_OES_texture_3D) )
+ {
+ bx::stringPrintf(code, "#extension GL_OES_texture_3D : enable\n");
+ }
+
+ if (NULL != bx::findIdentifierMatch(input, s_EXT_shadow_samplers) )
+ {
+ bx::stringPrintf(code
+ , "#extension GL_EXT_shadow_samplers : enable\n"
+ "#define shadow2D shadow2DEXT\n"
+ "#define shadow2DProj shadow2DProjEXT\n"
+ );
+ }
+
+ if (NULL != bx::findIdentifierMatch(input, "gl_FragDepth") )
+ {
+ bx::stringPrintf(code
+ , "#extension GL_EXT_frag_depth : enable\n"
+ "#define gl_FragDepth gl_FragDepthEXT\n"
+ );
+ }
}
- if (NULL != bx::findIdentifierMatch(input, s_EXT_shadow_samplers) )
- {
- bx::stringPrintf(code
- , "#extension GL_EXT_shadow_samplers : enable\n"
- "#define shadow2D shadow2DEXT\n"
- "#define shadow2DProj shadow2DProjEXT\n"
+ code += preprocessor.m_preprocessed;
+ compiled = compileGLSLShader(cmdLine
+ , metal ? BX_MAKEFOURCC('M', 'T', 'L', 0) : essl
+ , code
+ , writer
);
- }
-
- if (NULL != bx::findIdentifierMatch(input, "gl_FragDepth") )
- {
- bx::stringPrintf(code
- , "#extension GL_EXT_frag_depth : enable\n"
- "#define gl_FragDepth gl_FragDepthEXT\n"
+ }
+ else
+ {
+ compiled = compileHLSLShader(cmdLine
+ , d3d
+ , preprocessor.m_preprocessed
+ , writer
);
- }
}
- code += preprocessor.m_preprocessed;
- compiled = compileGLSLShader(cmdLine
- , metal ? BX_MAKEFOURCC('M', 'T', 'L', 0) : essl
- , code
- , writer
- );
- }
- else
- {
- compiled = compileHLSLShader(cmdLine
- , d3d
- , preprocessor.m_preprocessed
- , writer
- );
+ bx::close(writer);
+ delete writer;
}
- writer->close();
- delete writer;
- }
-
- if (compiled)
- {
- if (depends)
+ if (compiled)
{
- std::string ofp = outFilePath;
- ofp += ".d";
- bx::CrtFileWriter writer;
- if (0 == writer.open(ofp.c_str() ) )
+ if (depends)
{
- writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() );
- writer.close();
+ std::string ofp = outFilePath;
+ ofp += ".d";
+ bx::CrtFileWriter writer;
+ if (bx::open(&writer, ofp.c_str() ) )
+ {
+ writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() );
+ bx::close(&writer);
+ }
}
}
}
}
}
+
+ delete [] data;
}
- delete [] data;
- }
+ if (compiled)
+ {
+ return EXIT_SUCCESS;
+ }
- if (compiled)
- {
- return EXIT_SUCCESS;
+ remove(outFilePath);
+
+ fprintf(stderr, "Failed to build shader.\n");
+ return EXIT_FAILURE;
}
- remove(outFilePath);
+} // namespace bgfx
- fprintf(stderr, "Failed to build shader.\n");
- return EXIT_FAILURE;
+int main(int _argc, const char* _argv[])
+{
+ return bgfx::compileShader(_argc, _argv);
}
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.h b/3rdparty/bgfx/tools/shaderc/shaderc.h
index b7818ff1867..29bf450e474 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.h
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.h
@@ -6,9 +6,14 @@
#ifndef SHADERC_H_HEADER_GUARD
#define SHADERC_H_HEADER_GUARD
+namespace bgfx
+{
+ extern bool g_verbose;
+}
+
#define _BX_TRACE(_format, ...) \
BX_MACRO_BLOCK_BEGIN \
- if (g_verbose) \
+ if (bgfx::g_verbose) \
{ \
fprintf(stderr, BX_FILE_LINE_LITERAL "" _format "\n", ##__VA_ARGS__); \
} \
@@ -39,8 +44,6 @@
# define SHADERC_CONFIG_HLSL BX_PLATFORM_WINDOWS
#endif // SHADERC_CONFIG_HLSL
-extern bool g_verbose;
-
#include <alloca.h>
#include <stdio.h>
#include <stdint.h>
@@ -61,83 +64,74 @@ extern bool g_verbose;
#include <bx/hash.h>
#include "../../src/vertexdecl.h"
-class LineReader
+namespace bgfx
{
-public:
- LineReader(const char* _str)
- : m_str(_str)
- , m_pos(0)
- , m_size((uint32_t)strlen(_str))
- {
- }
-
- std::string getLine()
- {
- const char* str = &m_str[m_pos];
- skipLine();
-
- const char* eol = &m_str[m_pos];
-
- std::string tmp;
- tmp.assign(str, eol - str);
- return tmp;
- }
+ extern bool g_verbose;
- bool isEof() const
+ class LineReader
{
- return m_str[m_pos] == '\0';
- }
+ public:
+ LineReader(const char* _str)
+ : m_str(_str)
+ , m_pos(0)
+ , m_size((uint32_t)strlen(_str))
+ {
+ }
+
+ std::string getLine()
+ {
+ const char* str = &m_str[m_pos];
+ skipLine();
+
+ const char* eol = &m_str[m_pos];
+
+ std::string tmp;
+ tmp.assign(str, eol - str);
+ return tmp;
+ }
+
+ bool isEof() const
+ {
+ return m_str[m_pos] == '\0';
+ }
+
+ void skipLine()
+ {
+ const char* str = &m_str[m_pos];
+ const char* nl = bx::strnl(str);
+ m_pos += (uint32_t)(nl - str);
+ }
+
+ const char* m_str;
+ uint32_t m_pos;
+ uint32_t m_size;
+ };
- void skipLine()
- {
- const char* str = &m_str[m_pos];
- const char* nl = bx::strnl(str);
- m_pos += (uint32_t)(nl - str);
- }
+ #define BGFX_UNIFORM_FRAGMENTBIT UINT8_C(0x10)
+ #define BGFX_UNIFORM_SAMPLERBIT UINT8_C(0x20)
- const char* m_str;
- uint32_t m_pos;
- uint32_t m_size;
-};
+ const char* getUniformTypeName(UniformType::Enum _enum);
+ UniformType::Enum nameToUniformTypeEnum(const char* _name);
-struct UniformType
-{
- enum Enum
+ struct Uniform
{
- Int1,
- End,
-
- Vec4,
- Mat3,
- Mat4,
-
- Count
+ std::string name;
+ UniformType::Enum type;
+ uint8_t num;
+ uint16_t regIndex;
+ uint16_t regCount;
};
-};
-#define BGFX_UNIFORM_FRAGMENTBIT UINT8_C(0x10)
-#define BGFX_UNIFORM_SAMPLERBIT UINT8_C(0x20)
+ typedef std::vector<Uniform> UniformArray;
-const char* getUniformTypeName(UniformType::Enum _enum);
-UniformType::Enum nameToUniformTypeEnum(const char* _name);
+ void printCode(const char* _code, int32_t _line = 0, int32_t _start = 0, int32_t _end = INT32_MAX);
+ void strReplace(char* _str, const char* _find, const char* _replace);
+ int32_t writef(bx::WriterI* _writer, const char* _format, ...);
+ void writeFile(const char* _filePath, const void* _data, int32_t _size);
-struct Uniform
-{
- std::string name;
- UniformType::Enum type;
- uint8_t num;
- uint16_t regIndex;
- uint16_t regCount;
-};
-
-typedef std::vector<Uniform> UniformArray;
-
-void printCode(const char* _code, int32_t _line = 0, int32_t _start = 0, int32_t _end = INT32_MAX);
-void strReplace(char* _str, const char* _find, const char* _replace);
-int32_t writef(bx::WriterI* _writer, const char* _format, ...);
-void writeFile(const char* _filePath, const void* _data, int32_t _size);
-
-bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool firstPass = true);
-bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::string& _code, bx::WriterI* _writer);
+ bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool firstPass = true);
+ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::string& _code, bx::WriterI* _writer);
+
+} // namespace bgfx
#endif // SHADERC_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
index 674b19d16fd..0a4ce15d937 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
@@ -6,207 +6,211 @@
#include "shaderc.h"
#include "glsl_optimizer.h"
-bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::string& _code, bx::WriterI* _writer)
+namespace bgfx
{
- char ch = tolower(_cmdLine.findOption('\0', "type")[0]);
- const glslopt_shader_type type = ch == 'f'
- ? kGlslOptShaderFragment
- : (ch == 'c' ? kGlslOptShaderCompute : kGlslOptShaderVertex);
-
- glslopt_target target = kGlslTargetOpenGL;
- switch (_gles)
+ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::string& _code, bx::WriterI* _writer)
{
- case BX_MAKEFOURCC('M', 'T', 'L', 0):
- target = kGlslTargetMetal;
- break;
-
- case 2:
- target = kGlslTargetOpenGLES20;
- break;
-
- case 3:
- target = kGlslTargetOpenGLES30;
- break;
-
- default:
- target = kGlslTargetOpenGL;
- break;
- }
-
- glslopt_ctx* ctx = glslopt_initialize(target);
-
- glslopt_shader* shader = glslopt_optimize(ctx, type, _code.c_str(), 0);
+ char ch = tolower(_cmdLine.findOption('\0', "type")[0]);
+ const glslopt_shader_type type = ch == 'f'
+ ? kGlslOptShaderFragment
+ : (ch == 'c' ? kGlslOptShaderCompute : kGlslOptShaderVertex);
- if (!glslopt_get_status(shader) )
- {
- const char* log = glslopt_get_log(shader);
- int32_t source = 0;
- int32_t line = 0;
- int32_t column = 0;
- int32_t start = 0;
- int32_t end = INT32_MAX;
-
- if (3 == sscanf(log, "%u:%u(%u):", &source, &line, &column)
- && 0 != line)
+ glslopt_target target = kGlslTargetOpenGL;
+ switch (_gles)
{
- start = bx::uint32_imax(1, line-10);
- end = start + 20;
- }
+ case BX_MAKEFOURCC('M', 'T', 'L', 0):
+ target = kGlslTargetMetal;
+ break;
- printCode(_code.c_str(), line, start, end);
- fprintf(stderr, "Error: %s\n", log);
- glslopt_cleanup(ctx);
- return false;
- }
+ case 2:
+ target = kGlslTargetOpenGLES20;
+ break;
- const char* optimizedShader = glslopt_get_output(shader);
-
- // Trim all directives.
- while ('#' == *optimizedShader)
- {
- optimizedShader = bx::strnl(optimizedShader);
- }
+ case 3:
+ target = kGlslTargetOpenGLES30;
+ break;
- if (0 != _gles)
- {
- char* code = const_cast<char*>(optimizedShader);
- strReplace(code, "gl_FragDepthEXT", "gl_FragDepth");
-
- strReplace(code, "texture2DLodEXT", "texture2DLod");
- strReplace(code, "texture2DProjLodEXT", "texture2DProjLod");
- strReplace(code, "textureCubeLodEXT", "textureCubeLod");
- strReplace(code, "texture2DGradEXT", "texture2DGrad");
- strReplace(code, "texture2DProjGradEXT", "texture2DProjGrad");
- strReplace(code, "textureCubeGradEXT", "textureCubeGrad");
-
- strReplace(code, "shadow2DEXT", "shadow2D");
- strReplace(code, "shadow2DProjEXT", "shadow2DProj");
- }
+ default:
+ target = kGlslTargetOpenGL;
+ break;
+ }
- UniformArray uniforms;
+ glslopt_ctx* ctx = glslopt_initialize(target);
- {
- const char* parse = optimizedShader;
+ glslopt_shader* shader = glslopt_optimize(ctx, type, _code.c_str(), 0);
- while (NULL != parse
- && *parse != '\0')
+ if (!glslopt_get_status(shader) )
{
- parse = bx::strws(parse);
- const char* eol = strchr(parse, ';');
- if (NULL != eol)
+ const char* log = glslopt_get_log(shader);
+ int32_t source = 0;
+ int32_t line = 0;
+ int32_t column = 0;
+ int32_t start = 0;
+ int32_t end = INT32_MAX;
+
+ if (3 == sscanf(log, "%u:%u(%u):", &source, &line, &column)
+ && 0 != line)
{
- const char* qualifier = parse;
- parse = bx::strws(bx::strword(parse) );
-
- if (0 == strncmp(qualifier, "attribute", 9)
- || 0 == strncmp(qualifier, "varying", 7) )
- {
- // skip attributes and varyings.
- parse = eol + 1;
- continue;
- }
-
- if (0 != strncmp(qualifier, "uniform", 7) )
- {
- // end if there is no uniform keyword.
- parse = NULL;
- continue;
- }
-
- const char* precision = NULL;
- const char* typen = parse;
-
- if (0 == strncmp(typen, "lowp", 4)
- || 0 == strncmp(typen, "mediump", 7)
- || 0 == strncmp(typen, "highp", 5) )
- {
- precision = typen;
- typen = parse = bx::strws(bx::strword(parse) );
- }
-
- BX_UNUSED(precision);
+ start = bx::uint32_imax(1, line-10);
+ end = start + 20;
+ }
- char uniformType[256];
- parse = bx::strword(parse);
+ printCode(_code.c_str(), line, start, end);
+ fprintf(stderr, "Error: %s\n", log);
+ glslopt_cleanup(ctx);
+ return false;
+ }
- if (0 == strncmp(typen, "sampler", 7) )
- {
- strcpy(uniformType, "int");
- }
- else
- {
- bx::strlcpy(uniformType, typen, parse-typen+1);
- }
+ const char* optimizedShader = glslopt_get_output(shader);
- const char* name = parse = bx::strws(parse);
+ // Trim all directives.
+ while ('#' == *optimizedShader)
+ {
+ optimizedShader = bx::strnl(optimizedShader);
+ }
- char uniformName[256];
- uint8_t num = 1;
- const char* array = bx::strnstr(name, "[", eol-parse);
- if (NULL != array)
- {
- bx::strlcpy(uniformName, name, array-name+1);
+ if (0 != _gles)
+ {
+ char* code = const_cast<char*>(optimizedShader);
+ strReplace(code, "gl_FragDepthEXT", "gl_FragDepth");
+
+ strReplace(code, "texture2DLodEXT", "texture2DLod");
+ strReplace(code, "texture2DProjLodEXT", "texture2DProjLod");
+ strReplace(code, "textureCubeLodEXT", "textureCubeLod");
+ strReplace(code, "texture2DGradEXT", "texture2DGrad");
+ strReplace(code, "texture2DProjGradEXT", "texture2DProjGrad");
+ strReplace(code, "textureCubeGradEXT", "textureCubeGrad");
+
+ strReplace(code, "shadow2DEXT", "shadow2D");
+ strReplace(code, "shadow2DProjEXT", "shadow2DProj");
+ }
- char arraySize[32];
- const char* end = bx::strnstr(array, "]", eol-array);
- bx::strlcpy(arraySize, array+1, end-array);
- num = atoi(arraySize);
- }
- else
- {
- bx::strlcpy(uniformName, name, eol-name+1);
- }
+ UniformArray uniforms;
- Uniform un;
- un.type = nameToUniformTypeEnum(uniformType);
+ {
+ const char* parse = optimizedShader;
- if (UniformType::Count != un.type)
+ while (NULL != parse
+ && *parse != '\0')
+ {
+ parse = bx::strws(parse);
+ const char* eol = strchr(parse, ';');
+ if (NULL != eol)
{
- BX_TRACE("name: %s (type %d, num %d)", uniformName, un.type, num);
+ const char* qualifier = parse;
+ parse = bx::strws(bx::strword(parse) );
+
+ if (0 == strncmp(qualifier, "attribute", 9)
+ || 0 == strncmp(qualifier, "varying", 7) )
+ {
+ // skip attributes and varyings.
+ parse = eol + 1;
+ continue;
+ }
+
+ if (0 != strncmp(qualifier, "uniform", 7) )
+ {
+ // end if there is no uniform keyword.
+ parse = NULL;
+ continue;
+ }
+
+ const char* precision = NULL;
+ const char* typen = parse;
+
+ if (0 == strncmp(typen, "lowp", 4)
+ || 0 == strncmp(typen, "mediump", 7)
+ || 0 == strncmp(typen, "highp", 5) )
+ {
+ precision = typen;
+ typen = parse = bx::strws(bx::strword(parse) );
+ }
+
+ BX_UNUSED(precision);
+
+ char uniformType[256];
+ parse = bx::strword(parse);
+
+ if (0 == strncmp(typen, "sampler", 7) )
+ {
+ strcpy(uniformType, "int");
+ }
+ else
+ {
+ bx::strlcpy(uniformType, typen, parse-typen+1);
+ }
+
+ const char* name = parse = bx::strws(parse);
+
+ char uniformName[256];
+ uint8_t num = 1;
+ const char* array = bx::strnstr(name, "[", eol-parse);
+ if (NULL != array)
+ {
+ bx::strlcpy(uniformName, name, array-name+1);
+
+ char arraySize[32];
+ const char* end = bx::strnstr(array, "]", eol-array);
+ bx::strlcpy(arraySize, array+1, end-array);
+ num = atoi(arraySize);
+ }
+ else
+ {
+ bx::strlcpy(uniformName, name, eol-name+1);
+ }
+
+ Uniform un;
+ un.type = nameToUniformTypeEnum(uniformType);
+
+ if (UniformType::Count != un.type)
+ {
+ BX_TRACE("name: %s (type %d, num %d)", uniformName, un.type, num);
+
+ un.name = uniformName;
+ un.num = num;
+ un.regIndex = 0;
+ un.regCount = num;
+ uniforms.push_back(un);
+ }
- un.name = uniformName;
- un.num = num;
- un.regIndex = 0;
- un.regCount = num;
- uniforms.push_back(un);
+ parse = eol + 1;
}
-
- parse = eol + 1;
}
}
- }
- uint16_t count = (uint16_t)uniforms.size();
- bx::write(_writer, count);
+ uint16_t count = (uint16_t)uniforms.size();
+ bx::write(_writer, count);
- 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);
- uint8_t uniformType = un.type;
- bx::write(_writer, uniformType);
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
-
- BX_TRACE("%s, %s, %d, %d, %d"
- , un.name.c_str()
- , getUniformTypeName(un.type)
- , un.num
- , un.regIndex
- , un.regCount
- );
- }
+ 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);
+ uint8_t uniformType = un.type;
+ bx::write(_writer, uniformType);
+ bx::write(_writer, un.num);
+ bx::write(_writer, un.regIndex);
+ bx::write(_writer, un.regCount);
+
+ BX_TRACE("%s, %s, %d, %d, %d"
+ , un.name.c_str()
+ , getUniformTypeName(un.type)
+ , un.num
+ , un.regIndex
+ , un.regCount
+ );
+ }
- uint32_t shaderSize = (uint32_t)strlen(optimizedShader);
- bx::write(_writer, shaderSize);
- bx::write(_writer, optimizedShader, shaderSize);
- uint8_t nul = 0;
- bx::write(_writer, nul);
+ uint32_t shaderSize = (uint32_t)strlen(optimizedShader);
+ bx::write(_writer, shaderSize);
+ bx::write(_writer, optimizedShader, shaderSize);
+ uint8_t nul = 0;
+ bx::write(_writer, nul);
- glslopt_cleanup(ctx);
+ glslopt_cleanup(ctx);
+
+ return true;
+ }
- return true;
-}
+} // namespace bgfx
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
index cdac5edd7b3..8f861047ded 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
@@ -7,677 +7,796 @@
#if SHADERC_CONFIG_HLSL
-#define INITGUID
+#if defined(__MINGW32__)
+# define __REQUIRED_RPCNDR_H_VERSION__ 475
+# define __in
+# define __out
+#endif // defined(__MINGW32__)
+
#include <d3dcompiler.h>
#include <d3d11shader.h>
+#include <bx/os.h>
#ifndef D3D_SVF_USED
# define D3D_SVF_USED 2
#endif // D3D_SVF_USED
-struct CTHeader
-{
- uint32_t Size;
- uint32_t Creator;
- uint32_t Version;
- uint32_t Constants;
- uint32_t ConstantInfo;
- uint32_t Flags;
- uint32_t Target;
-};
-
-struct CTInfo
-{
- uint32_t Name;
- uint16_t RegisterSet;
- uint16_t RegisterIndex;
- uint16_t RegisterCount;
- uint16_t Reserved;
- uint32_t TypeInfo;
- uint32_t DefaultValue;
-};
-
-struct CTType
-{
- uint16_t Class;
- uint16_t Type;
- uint16_t Rows;
- uint16_t Columns;
- uint16_t Elements;
- uint16_t StructMembers;
- uint32_t StructMemberInfo;
-};
-
-struct RemapInputSemantic
+namespace bgfx
{
- bgfx::Attrib::Enum m_attr;
- const char* m_name;
- uint8_t m_index;
-};
+ typedef HRESULT(WINAPI* PFN_D3D_COMPILE)(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData
+ , _In_ SIZE_T SrcDataSize
+ , _In_opt_ LPCSTR pSourceName
+ , _In_reads_opt_(_Inexpressible_(pDefines->Name != NULL) ) CONST D3D_SHADER_MACRO* pDefines
+ , _In_opt_ ID3DInclude* pInclude
+ , _In_opt_ LPCSTR pEntrypoint
+ , _In_ LPCSTR pTarget
+ , _In_ UINT Flags1
+ , _In_ UINT Flags2
+ , _Out_ ID3DBlob** ppCode
+ , _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs
+ );
-static const RemapInputSemantic s_remapInputSemantic[bgfx::Attrib::Count+1] =
-{
- { bgfx::Attrib::Position, "POSITION", 0 },
- { bgfx::Attrib::Normal, "NORMAL", 0 },
- { bgfx::Attrib::Tangent, "TANGENT", 0 },
- { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
- { bgfx::Attrib::Color0, "COLOR", 0 },
- { bgfx::Attrib::Color1, "COLOR", 1 },
- { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
- { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
- { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
- { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
- { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
- { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
- { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
- { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
- { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
- { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
- { bgfx::Attrib::Count, "", 0 },
-};
-
-const RemapInputSemantic& findInputSemantic(const char* _name, uint8_t _index)
-{
- for (uint32_t ii = 0; ii < bgfx::Attrib::Count; ++ii)
- {
- const RemapInputSemantic& ris = s_remapInputSemantic[ii];
- if (0 == strcmp(ris.m_name, _name)
- && ris.m_index == _index)
- {
- return ris;
- }
- }
+ typedef HRESULT(WINAPI* PFN_D3D_DISASSEMBLE)(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData
+ , _In_ SIZE_T SrcDataSize
+ , _In_ UINT Flags
+ , _In_opt_ LPCSTR szComments
+ , _Out_ ID3DBlob** ppDisassembly
+ );
- return s_remapInputSemantic[bgfx::Attrib::Count];
-}
+ typedef HRESULT(WINAPI* PFN_D3D_REFLECT)(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData
+ , _In_ SIZE_T SrcDataSize
+ , _In_ REFIID pInterface
+ , _Out_ void** ppReflector
+ );
-struct UniformRemap
-{
- UniformType::Enum id;
- D3D_SHADER_VARIABLE_CLASS paramClass;
- D3D_SHADER_VARIABLE_TYPE paramType;
- uint8_t columns;
- uint8_t rows;
-};
-
-static const UniformRemap s_uniformRemap[] =
-{
- { UniformType::Int1, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 },
- { UniformType::Vec4, D3D_SVC_VECTOR, D3D_SVT_FLOAT, 0, 0 },
- { UniformType::Mat3, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 3, 3 },
- { UniformType::Mat4, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 4, 4 },
- { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER, 0, 0 },
- { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER2D, 0, 0 },
- { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER3D, 0, 0 },
- { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLERCUBE, 0, 0 },
-};
-
-UniformType::Enum findUniformType(const D3D11_SHADER_TYPE_DESC& constDesc)
-{
- for (uint32_t ii = 0; ii < BX_COUNTOF(s_uniformRemap); ++ii)
- {
- const UniformRemap& remap = s_uniformRemap[ii];
+ typedef HRESULT(WINAPI* PFN_D3D_STRIP_SHADER)(_In_reads_bytes_(BytecodeLength) LPCVOID pShaderBytecode
+ , _In_ SIZE_T BytecodeLength
+ , _In_ UINT uStripFlags
+ , _Out_ ID3DBlob** ppStrippedBlob
+ );
+
+ PFN_D3D_COMPILE D3DCompile;
+ PFN_D3D_DISASSEMBLE D3DDisassemble;
+ PFN_D3D_REFLECT D3DReflect;
+ PFN_D3D_STRIP_SHADER D3DStripShader;
- if (remap.paramClass == constDesc.Class
- && remap.paramType == constDesc.Type)
+ struct D3DCompiler
+ {
+ const char* fileName;
+ const GUID IID_ID3D11ShaderReflection;
+ };
+
+ static const D3DCompiler s_d3dcompiler[] =
+ { // BK - the only different in interface is GetRequiresFlags at the end
+ // of IID_ID3D11ShaderReflection47 (which is not used anyway).
+ { "D3DCompiler_47.dll", { 0x8d536ca1, 0x0cca, 0x4956, { 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84 } } },
+ { "D3DCompiler_46.dll", { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } } },
+ { "D3DCompiler_45.dll", { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } } },
+ { "D3DCompiler_44.dll", { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } } },
+ { "D3DCompiler_43.dll", { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } } },
+ };
+
+ static const D3DCompiler* s_compiler;
+ static void* s_d3dcompilerdll;
+
+ const D3DCompiler* load()
+ {
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_d3dcompiler); ++ii)
{
- if (D3D_SVC_MATRIX_COLUMNS != constDesc.Class)
+ const D3DCompiler* compiler = &s_d3dcompiler[ii];
+ s_d3dcompilerdll = bx::dlopen(compiler->fileName);
+ if (NULL == s_d3dcompilerdll)
{
- return remap.id;
+ continue;
}
- if (remap.columns == constDesc.Columns
- && remap.rows == constDesc.Rows)
+ D3DCompile = (PFN_D3D_COMPILE )bx::dlsym(s_d3dcompilerdll, "D3DCompile");
+ D3DDisassemble = (PFN_D3D_DISASSEMBLE )bx::dlsym(s_d3dcompilerdll, "D3DDisassemble");
+ D3DReflect = (PFN_D3D_REFLECT )bx::dlsym(s_d3dcompilerdll, "D3DReflect");
+ D3DStripShader = (PFN_D3D_STRIP_SHADER)bx::dlsym(s_d3dcompilerdll, "D3DStripShader");
+
+ if (NULL == D3DCompile
+ || NULL == D3DDisassemble
+ || NULL == D3DReflect
+ || NULL == D3DStripShader)
{
- return remap.id;
+ bx::dlclose(s_d3dcompilerdll);
+ continue;
}
- }
- }
- return UniformType::Count;
-}
-
-static uint32_t s_optimizationLevelDx11[4] =
-{
- D3DCOMPILE_OPTIMIZATION_LEVEL0,
- D3DCOMPILE_OPTIMIZATION_LEVEL1,
- D3DCOMPILE_OPTIMIZATION_LEVEL2,
- D3DCOMPILE_OPTIMIZATION_LEVEL3,
-};
+ BX_TRACE("Loaded %s compiler.", compiler->fileName);
+ return compiler;
+ }
-typedef std::vector<std::string> UniformNameList;
+ fprintf(stderr, "Error: Unable to open D3DCompiler_*.dll shader compiler.\n");
+ return NULL;
+ }
-static bool isSampler(D3D_SHADER_VARIABLE_TYPE _svt)
-{
- switch (_svt)
+ void unload()
{
- case D3D_SVT_SAMPLER:
- case D3D_SVT_SAMPLER1D:
- case D3D_SVT_SAMPLER2D:
- case D3D_SVT_SAMPLER3D:
- case D3D_SVT_SAMPLERCUBE:
- return true;
-
- default:
- break;
+ bx::dlclose(s_d3dcompilerdll);
}
- return false;
-}
-
-bool getReflectionDataDx9(ID3DBlob* _code, UniformArray& _uniforms)
-{
- // see reference for magic values: https://msdn.microsoft.com/en-us/library/ff552891(VS.85).aspx
- const uint32_t D3DSIO_COMMENT = 0x0000FFFE;
- const uint32_t D3DSIO_END = 0x0000FFFF;
- const uint32_t D3DSI_OPCODE_MASK = 0x0000FFFF;
- const uint32_t D3DSI_COMMENTSIZE_MASK = 0x7FFF0000;
- const uint32_t CTAB_CONSTANT = MAKEFOURCC('C','T','A','B');
-
- // parse the shader blob for the constant table
- const size_t codeSize = _code->GetBufferSize();
- const uint32_t* ptr = (const uint32_t*)_code->GetBufferPointer();
- const uint32_t* end = (const uint32_t*)( (const uint8_t*)ptr + codeSize);
- const CTHeader* header = NULL;
-
- ptr++; // first byte is shader type / version; skip it since we already know
-
- while (ptr < end && *ptr != D3DSIO_END)
+ struct CTHeader
{
- uint32_t cur = *ptr++;
- if ( (cur & D3DSI_OPCODE_MASK) != D3DSIO_COMMENT)
- {
- continue;
- }
+ uint32_t Size;
+ uint32_t Creator;
+ uint32_t Version;
+ uint32_t Constants;
+ uint32_t ConstantInfo;
+ uint32_t Flags;
+ uint32_t Target;
+ };
+
+ struct CTInfo
+ {
+ uint32_t Name;
+ uint16_t RegisterSet;
+ uint16_t RegisterIndex;
+ uint16_t RegisterCount;
+ uint16_t Reserved;
+ uint32_t TypeInfo;
+ uint32_t DefaultValue;
+ };
+
+ struct CTType
+ {
+ uint16_t Class;
+ uint16_t Type;
+ uint16_t Rows;
+ uint16_t Columns;
+ uint16_t Elements;
+ uint16_t StructMembers;
+ uint32_t StructMemberInfo;
+ };
+
+ struct RemapInputSemantic
+ {
+ bgfx::Attrib::Enum m_attr;
+ const char* m_name;
+ uint8_t m_index;
+ };
- // try to find CTAB comment block
- uint32_t commentSize = (cur & D3DSI_COMMENTSIZE_MASK) >> 16;
- uint32_t fourcc = *ptr;
- if (fourcc == CTAB_CONSTANT)
+ static const RemapInputSemantic s_remapInputSemantic[bgfx::Attrib::Count + 1] =
+ {
+ { bgfx::Attrib::Position, "POSITION", 0 },
+ { bgfx::Attrib::Normal, "NORMAL", 0 },
+ { bgfx::Attrib::Tangent, "TANGENT", 0 },
+ { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
+ { bgfx::Attrib::Color0, "COLOR", 0 },
+ { bgfx::Attrib::Color1, "COLOR", 1 },
+ { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
+ { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
+ { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
+ { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
+ { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
+ { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
+ { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
+ { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
+ { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
+ { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
+ { bgfx::Attrib::Count, "", 0 },
+ };
+
+ const RemapInputSemantic& findInputSemantic(const char* _name, uint8_t _index)
+ {
+ for (uint32_t ii = 0; ii < bgfx::Attrib::Count; ++ii)
{
- // found the constant table data
- header = (const CTHeader*)(ptr + 1);
- uint32_t tableSize = (commentSize - 1) * 4;
- if (tableSize < sizeof(CTHeader) || header->Size != sizeof(CTHeader) )
+ const RemapInputSemantic& ris = s_remapInputSemantic[ii];
+ if (0 == strcmp(ris.m_name, _name)
+ && ris.m_index == _index)
{
- fprintf(stderr, "Error: Invalid constant table data\n");
- return false;
+ return ris;
}
- break;
}
- // this is a different kind of comment section, so skip over it
- ptr += commentSize - 1;
+ return s_remapInputSemantic[bgfx::Attrib::Count];
}
- if (!header)
+ struct UniformRemap
{
- fprintf(stderr, "Error: Could not find constant table data\n");
- return false;
- }
+ UniformType::Enum id;
+ D3D_SHADER_VARIABLE_CLASS paramClass;
+ D3D_SHADER_VARIABLE_TYPE paramType;
+ uint8_t columns;
+ uint8_t rows;
+ };
+
+ static const UniformRemap s_uniformRemap[] =
+ {
+ { UniformType::Int1, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 },
+ { UniformType::Vec4, D3D_SVC_VECTOR, D3D_SVT_FLOAT, 0, 0 },
+ { UniformType::Mat3, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 3, 3 },
+ { UniformType::Mat4, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 4, 4 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER2D, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER3D, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLERCUBE, 0, 0 },
+ };
+
+ UniformType::Enum findUniformType(const D3D11_SHADER_TYPE_DESC& constDesc)
+ {
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_uniformRemap); ++ii)
+ {
+ const UniformRemap& remap = s_uniformRemap[ii];
- const uint8_t* headerBytePtr = (const uint8_t*)header;
- const char* creator = (const char*)(headerBytePtr + header->Creator);
+ if (remap.paramClass == constDesc.Class
+ && remap.paramType == constDesc.Type)
+ {
+ if (D3D_SVC_MATRIX_COLUMNS != constDesc.Class)
+ {
+ return remap.id;
+ }
+
+ if (remap.columns == constDesc.Columns
+ && remap.rows == constDesc.Rows)
+ {
+ return remap.id;
+ }
+ }
+ }
- BX_TRACE("Creator: %s 0x%08x", creator, header->Version);
- BX_TRACE("Num constants: %d", header->Constants);
- BX_TRACE("# cl ty RxC S By Name");
+ return UniformType::Count;
+ }
- const CTInfo* ctInfoArray = (const CTInfo*)(headerBytePtr + header->ConstantInfo);
- for (uint32_t ii = 0; ii < header->Constants; ++ii)
+ static uint32_t s_optimizationLevelD3D11[4] =
{
- const CTInfo& ctInfo = ctInfoArray[ii];
- const CTType& ctType = *(const CTType*)(headerBytePtr + ctInfo.TypeInfo);
- const char* name = (const char*)(headerBytePtr + ctInfo.Name);
-
- BX_TRACE("%3d %2d %2d [%dx%d] %d %s[%d] c%d (%d)"
- , ii
- , ctType.Class
- , ctType.Type
- , ctType.Rows
- , ctType.Columns
- , ctType.StructMembers
- , name
- , ctType.Elements
- , ctInfo.RegisterIndex
- , ctInfo.RegisterCount
- );
+ D3DCOMPILE_OPTIMIZATION_LEVEL0,
+ D3DCOMPILE_OPTIMIZATION_LEVEL1,
+ D3DCOMPILE_OPTIMIZATION_LEVEL2,
+ D3DCOMPILE_OPTIMIZATION_LEVEL3,
+ };
- D3D11_SHADER_TYPE_DESC desc;
- desc.Class = (D3D_SHADER_VARIABLE_CLASS)ctType.Class;
- desc.Type = (D3D_SHADER_VARIABLE_TYPE)ctType.Type;
- desc.Rows = ctType.Rows;
- desc.Columns = ctType.Columns;
+ typedef std::vector<std::string> UniformNameList;
- UniformType::Enum type = findUniformType(desc);
- if (UniformType::Count != type)
+ static bool isSampler(D3D_SHADER_VARIABLE_TYPE _svt)
+ {
+ switch (_svt)
{
- Uniform un;
- un.name = '$' == name[0] ? name + 1 : name;
- un.type = isSampler(desc.Type)
- ? UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | type)
- : type
- ;
- un.num = (uint8_t)ctType.Elements;
- un.regIndex = ctInfo.RegisterIndex;
- un.regCount = ctInfo.RegisterCount;
-
- _uniforms.push_back(un);
+ case D3D_SVT_SAMPLER:
+ case D3D_SVT_SAMPLER1D:
+ case D3D_SVT_SAMPLER2D:
+ case D3D_SVT_SAMPLER3D:
+ case D3D_SVT_SAMPLERCUBE:
+ return true;
+
+ default:
+ break;
}
- }
-
- return true;
-}
-bool getReflectionDataDx11(ID3DBlob* _code, bool _vshader, UniformArray& _uniforms, uint8_t& _numAttrs, uint16_t* _attrs, uint16_t& _size, UniformNameList& unusedUniforms)
-{
- ID3D11ShaderReflection* reflect = NULL;
- HRESULT hr = D3DReflect(_code->GetBufferPointer()
- , _code->GetBufferSize()
- , IID_ID3D11ShaderReflection
- , (void**)&reflect
- );
- if (FAILED(hr) )
- {
- fprintf(stderr, "Error: 0x%08x\n", (uint32_t)hr);
return false;
}
- D3D11_SHADER_DESC desc;
- hr = reflect->GetDesc(&desc);
- if (FAILED(hr) )
+ bool getReflectionDataD3D9(ID3DBlob* _code, UniformArray& _uniforms)
{
- fprintf(stderr, BX_FILE_LINE_LITERAL "Error: 0x%08x\n", (uint32_t)hr);
- return false;
- }
+ // see reference for magic values: https://msdn.microsoft.com/en-us/library/ff552891(VS.85).aspx
+ const uint32_t D3DSIO_COMMENT = 0x0000FFFE;
+ const uint32_t D3DSIO_END = 0x0000FFFF;
+ const uint32_t D3DSI_OPCODE_MASK = 0x0000FFFF;
+ const uint32_t D3DSI_COMMENTSIZE_MASK = 0x7FFF0000;
+ const uint32_t CTAB_CONSTANT = MAKEFOURCC('C', 'T', 'A', 'B');
+
+ // parse the shader blob for the constant table
+ const size_t codeSize = _code->GetBufferSize();
+ const uint32_t* ptr = (const uint32_t*)_code->GetBufferPointer();
+ const uint32_t* end = (const uint32_t*)( (const uint8_t*)ptr + codeSize);
+ const CTHeader* header = NULL;
+
+ ptr++; // first byte is shader type / version; skip it since we already know
+
+ while (ptr < end && *ptr != D3DSIO_END)
+ {
+ uint32_t cur = *ptr++;
+ if ( (cur & D3DSI_OPCODE_MASK) != D3DSIO_COMMENT)
+ {
+ continue;
+ }
- BX_TRACE("Creator: %s 0x%08x", desc.Creator, desc.Version);
- BX_TRACE("Num constant buffers: %d", desc.ConstantBuffers);
+ // try to find CTAB comment block
+ uint32_t commentSize = (cur & D3DSI_COMMENTSIZE_MASK) >> 16;
+ uint32_t fourcc = *ptr;
+ if (fourcc == CTAB_CONSTANT)
+ {
+ // found the constant table data
+ header = (const CTHeader*)(ptr + 1);
+ uint32_t tableSize = (commentSize - 1) * 4;
+ if (tableSize < sizeof(CTHeader) || header->Size != sizeof(CTHeader) )
+ {
+ fprintf(stderr, "Error: Invalid constant table data\n");
+ return false;
+ }
+ break;
+ }
- BX_TRACE("Input:");
+ // this is a different kind of comment section, so skip over it
+ ptr += commentSize - 1;
+ }
- if (_vshader) // Only care about input semantic on vertex shaders
- {
- for (uint32_t ii = 0; ii < desc.InputParameters; ++ii)
+ if (!header)
{
- D3D11_SIGNATURE_PARAMETER_DESC spd;
- reflect->GetInputParameterDesc(ii, &spd);
- BX_TRACE("\t%2d: %s%d, vt %d, ct %d, mask %x, reg %d"
+ fprintf(stderr, "Error: Could not find constant table data\n");
+ return false;
+ }
+
+ const uint8_t* headerBytePtr = (const uint8_t*)header;
+ const char* creator = (const char*)(headerBytePtr + header->Creator);
+
+ BX_TRACE("Creator: %s 0x%08x", creator, header->Version);
+ BX_TRACE("Num constants: %d", header->Constants);
+ BX_TRACE("# cl ty RxC S By Name");
+
+ const CTInfo* ctInfoArray = (const CTInfo*)(headerBytePtr + header->ConstantInfo);
+ for (uint32_t ii = 0; ii < header->Constants; ++ii)
+ {
+ const CTInfo& ctInfo = ctInfoArray[ii];
+ const CTType& ctType = *(const CTType*)(headerBytePtr + ctInfo.TypeInfo);
+ const char* name = (const char*)(headerBytePtr + ctInfo.Name);
+
+ BX_TRACE("%3d %2d %2d [%dx%d] %d %s[%d] c%d (%d)"
, ii
- , spd.SemanticName
- , spd.SemanticIndex
- , spd.SystemValueType
- , spd.ComponentType
- , spd.Mask
- , spd.Register
+ , ctType.Class
+ , ctType.Type
+ , ctType.Rows
+ , ctType.Columns
+ , ctType.StructMembers
+ , name
+ , ctType.Elements
+ , ctInfo.RegisterIndex
+ , ctInfo.RegisterCount
);
- const RemapInputSemantic& ris = findInputSemantic(spd.SemanticName, spd.SemanticIndex);
- if (ris.m_attr != bgfx::Attrib::Count)
+ D3D11_SHADER_TYPE_DESC desc;
+ desc.Class = (D3D_SHADER_VARIABLE_CLASS)ctType.Class;
+ desc.Type = (D3D_SHADER_VARIABLE_TYPE)ctType.Type;
+ desc.Rows = ctType.Rows;
+ desc.Columns = ctType.Columns;
+
+ UniformType::Enum type = findUniformType(desc);
+ if (UniformType::Count != type)
{
- _attrs[_numAttrs] = bgfx::attribToId(ris.m_attr);
- ++_numAttrs;
+ Uniform un;
+ un.name = '$' == name[0] ? name + 1 : name;
+ un.type = isSampler(desc.Type)
+ ? UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | type)
+ : type
+ ;
+ un.num = (uint8_t)ctType.Elements;
+ un.regIndex = ctInfo.RegisterIndex;
+ un.regCount = ctInfo.RegisterCount;
+
+ _uniforms.push_back(un);
}
}
- }
- BX_TRACE("Output:");
- for (uint32_t ii = 0; ii < desc.OutputParameters; ++ii)
- {
- D3D11_SIGNATURE_PARAMETER_DESC spd;
- reflect->GetOutputParameterDesc(ii, &spd);
- BX_TRACE("\t%2d: %s%d, %d, %d", ii, spd.SemanticName, spd.SemanticIndex, spd.SystemValueType, spd.ComponentType);
+ return true;
}
- for (uint32_t ii = 0, num = bx::uint32_min(1, desc.ConstantBuffers); ii < num; ++ii)
+ bool getReflectionDataD3D11(ID3DBlob* _code, bool _vshader, UniformArray& _uniforms, uint8_t& _numAttrs, uint16_t* _attrs, uint16_t& _size, UniformNameList& unusedUniforms)
{
- ID3D11ShaderReflectionConstantBuffer* cbuffer = reflect->GetConstantBufferByIndex(ii);
- D3D11_SHADER_BUFFER_DESC bufferDesc;
- hr = cbuffer->GetDesc(&bufferDesc);
+ ID3D11ShaderReflection* reflect = NULL;
+ HRESULT hr = D3DReflect(_code->GetBufferPointer()
+ , _code->GetBufferSize()
+ , s_compiler->IID_ID3D11ShaderReflection
+ , (void**)&reflect
+ );
+ if (FAILED(hr) )
+ {
+ fprintf(stderr, "Error: D3DReflect failed 0x%08x\n", (uint32_t)hr);
+ return false;
+ }
+
+ D3D11_SHADER_DESC desc;
+ hr = reflect->GetDesc(&desc);
+ if (FAILED(hr) )
+ {
+ fprintf(stderr, "Error: ID3D11ShaderReflection::GetDesc failed 0x%08x\n", (uint32_t)hr);
+ return false;
+ }
+
+ BX_TRACE("Creator: %s 0x%08x", desc.Creator, desc.Version);
+ BX_TRACE("Num constant buffers: %d", desc.ConstantBuffers);
- _size = (uint16_t)bufferDesc.Size;
+ BX_TRACE("Input:");
- if (SUCCEEDED(hr) )
+ if (_vshader) // Only care about input semantic on vertex shaders
{
- BX_TRACE("%s, %d, vars %d, size %d"
- , bufferDesc.Name
- , bufferDesc.Type
- , bufferDesc.Variables
- , bufferDesc.Size
- );
+ for (uint32_t ii = 0; ii < desc.InputParameters; ++ii)
+ {
+ D3D11_SIGNATURE_PARAMETER_DESC spd;
+ reflect->GetInputParameterDesc(ii, &spd);
+ BX_TRACE("\t%2d: %s%d, vt %d, ct %d, mask %x, reg %d"
+ , ii
+ , spd.SemanticName
+ , spd.SemanticIndex
+ , spd.SystemValueType
+ , spd.ComponentType
+ , spd.Mask
+ , spd.Register
+ );
- for (uint32_t jj = 0; jj < bufferDesc.Variables; ++jj)
+ const RemapInputSemantic& ris = findInputSemantic(spd.SemanticName, spd.SemanticIndex);
+ if (ris.m_attr != bgfx::Attrib::Count)
+ {
+ _attrs[_numAttrs] = bgfx::attribToId(ris.m_attr);
+ ++_numAttrs;
+ }
+ }
+ }
+
+ BX_TRACE("Output:");
+ for (uint32_t ii = 0; ii < desc.OutputParameters; ++ii)
+ {
+ D3D11_SIGNATURE_PARAMETER_DESC spd;
+ reflect->GetOutputParameterDesc(ii, &spd);
+ BX_TRACE("\t%2d: %s%d, %d, %d", ii, spd.SemanticName, spd.SemanticIndex, spd.SystemValueType, spd.ComponentType);
+ }
+
+ for (uint32_t ii = 0, num = bx::uint32_min(1, desc.ConstantBuffers); ii < num; ++ii)
+ {
+ ID3D11ShaderReflectionConstantBuffer* cbuffer = reflect->GetConstantBufferByIndex(ii);
+ D3D11_SHADER_BUFFER_DESC bufferDesc;
+ hr = cbuffer->GetDesc(&bufferDesc);
+
+ _size = (uint16_t)bufferDesc.Size;
+
+ if (SUCCEEDED(hr) )
{
- ID3D11ShaderReflectionVariable* var = cbuffer->GetVariableByIndex(jj);
- ID3D11ShaderReflectionType* type = var->GetType();
- D3D11_SHADER_VARIABLE_DESC varDesc;
- hr = var->GetDesc(&varDesc);
- if (SUCCEEDED(hr) )
+ BX_TRACE("%s, %d, vars %d, size %d"
+ , bufferDesc.Name
+ , bufferDesc.Type
+ , bufferDesc.Variables
+ , bufferDesc.Size
+ );
+
+ for (uint32_t jj = 0; jj < bufferDesc.Variables; ++jj)
{
- D3D11_SHADER_TYPE_DESC constDesc;
- hr = type->GetDesc(&constDesc);
+ ID3D11ShaderReflectionVariable* var = cbuffer->GetVariableByIndex(jj);
+ ID3D11ShaderReflectionType* type = var->GetType();
+ D3D11_SHADER_VARIABLE_DESC varDesc;
+ hr = var->GetDesc(&varDesc);
if (SUCCEEDED(hr) )
{
- UniformType::Enum uniformType = findUniformType(constDesc);
-
- if (UniformType::Count != uniformType
- && 0 != (varDesc.uFlags & D3D_SVF_USED) )
+ D3D11_SHADER_TYPE_DESC constDesc;
+ hr = type->GetDesc(&constDesc);
+ if (SUCCEEDED(hr) )
{
- Uniform un;
- un.name = varDesc.Name;
- un.type = uniformType;
- un.num = constDesc.Elements;
- un.regIndex = varDesc.StartOffset;
- un.regCount = BX_ALIGN_16(varDesc.Size) / 16;
- _uniforms.push_back(un);
-
- BX_TRACE("\t%s, %d, size %d, flags 0x%08x, %d (used)"
- , varDesc.Name
- , varDesc.StartOffset
- , varDesc.Size
- , varDesc.uFlags
- , uniformType
- );
- }
- else
- {
- if (0 == (varDesc.uFlags & D3D_SVF_USED) )
+ UniformType::Enum uniformType = findUniformType(constDesc);
+
+ if (UniformType::Count != uniformType
+ && 0 != (varDesc.uFlags & D3D_SVF_USED) )
{
- unusedUniforms.push_back(varDesc.Name);
+ Uniform un;
+ un.name = varDesc.Name;
+ un.type = uniformType;
+ un.num = constDesc.Elements;
+ un.regIndex = varDesc.StartOffset;
+ un.regCount = BX_ALIGN_16(varDesc.Size) / 16;
+ _uniforms.push_back(un);
+
+ BX_TRACE("\t%s, %d, size %d, flags 0x%08x, %d (used)"
+ , varDesc.Name
+ , varDesc.StartOffset
+ , varDesc.Size
+ , varDesc.uFlags
+ , uniformType
+ );
}
+ else
+ {
+ if (0 == (varDesc.uFlags & D3D_SVF_USED) )
+ {
+ unusedUniforms.push_back(varDesc.Name);
+ }
- BX_TRACE("\t%s, unknown type", varDesc.Name);
+ BX_TRACE("\t%s, unknown type", varDesc.Name);
+ }
}
}
}
}
}
- }
-
- BX_TRACE("Bound:");
- for (uint32_t ii = 0; ii < desc.BoundResources; ++ii)
- {
- D3D11_SHADER_INPUT_BIND_DESC bindDesc;
- hr = reflect->GetResourceBindingDesc(ii, &bindDesc);
- if (SUCCEEDED(hr) )
+ BX_TRACE("Bound:");
+ for (uint32_t ii = 0; ii < desc.BoundResources; ++ii)
{
- if (D3D_SIT_SAMPLER == bindDesc.Type)
- {
- BX_TRACE("\t%s, %d, %d, %d"
- , bindDesc.Name
- , bindDesc.Type
- , bindDesc.BindPoint
- , bindDesc.BindCount
- );
+ D3D11_SHADER_INPUT_BIND_DESC bindDesc;
- const char * end = strstr(bindDesc.Name, "Sampler");
- if (NULL != end)
+ hr = reflect->GetResourceBindingDesc(ii, &bindDesc);
+ if (SUCCEEDED(hr) )
+ {
+ if (D3D_SIT_SAMPLER == bindDesc.Type)
{
- Uniform un;
- un.name.assign(bindDesc.Name, (end - bindDesc.Name) );
- un.type = UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | UniformType::Int1);
- un.num = 1;
- un.regIndex = bindDesc.BindPoint;
- un.regCount = bindDesc.BindCount;
- _uniforms.push_back(un);
+ BX_TRACE("\t%s, %d, %d, %d"
+ , bindDesc.Name
+ , bindDesc.Type
+ , bindDesc.BindPoint
+ , bindDesc.BindCount
+ );
+
+ const char * end = strstr(bindDesc.Name, "Sampler");
+ if (NULL != end)
+ {
+ Uniform un;
+ un.name.assign(bindDesc.Name, (end - bindDesc.Name) );
+ un.type = UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | UniformType::Int1);
+ un.num = 1;
+ un.regIndex = bindDesc.BindPoint;
+ un.regCount = bindDesc.BindCount;
+ _uniforms.push_back(un);
+ }
}
}
}
- }
-
- if (NULL != reflect)
- {
- reflect->Release();
- }
-
- return true;
-}
-bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
-{
- BX_TRACE("DX11");
+ if (NULL != reflect)
+ {
+ reflect->Release();
+ }
- const char* profile = _cmdLine.findOption('p', "profile");
- if (NULL == profile)
- {
- fprintf(stderr, "Shader profile must be specified.\n");
- return false;
+ return true;
}
- bool debug = _cmdLine.hasArg('\0', "debug");
-
- uint32_t flags = D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
- flags |= debug ? D3DCOMPILE_DEBUG : 0;
- flags |= _cmdLine.hasArg('\0', "avoid-flow-control") ? D3DCOMPILE_AVOID_FLOW_CONTROL : 0;
- flags |= _cmdLine.hasArg('\0', "no-preshader") ? D3DCOMPILE_NO_PRESHADER : 0;
- flags |= _cmdLine.hasArg('\0', "partial-precision") ? D3DCOMPILE_PARTIAL_PRECISION : 0;
- flags |= _cmdLine.hasArg('\0', "prefer-flow-control") ? D3DCOMPILE_PREFER_FLOW_CONTROL : 0;
- flags |= _cmdLine.hasArg('\0', "backwards-compatibility") ? D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY : 0;
+ bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
+ {
+ const char* profile = _cmdLine.findOption('p', "profile");
+ if (NULL == profile)
+ {
+ fprintf(stderr, "Error: Shader profile must be specified.\n");
+ return false;
+ }
- bool werror = _cmdLine.hasArg('\0', "Werror");
+ s_compiler = load();
- if (werror)
- {
- flags |= D3DCOMPILE_WARNINGS_ARE_ERRORS;
- }
+ bool result = false;
+ bool debug = _cmdLine.hasArg('\0', "debug");
- uint32_t optimization = 3;
- if (_cmdLine.hasArg(optimization, 'O') )
- {
- optimization = bx::uint32_min(optimization, BX_COUNTOF(s_optimizationLevelDx11)-1);
- flags |= s_optimizationLevelDx11[optimization];
- }
- else
- {
- flags |= D3DCOMPILE_SKIP_OPTIMIZATION;
- }
+ uint32_t flags = D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
+ flags |= debug ? D3DCOMPILE_DEBUG : 0;
+ flags |= _cmdLine.hasArg('\0', "avoid-flow-control") ? D3DCOMPILE_AVOID_FLOW_CONTROL : 0;
+ flags |= _cmdLine.hasArg('\0', "no-preshader") ? D3DCOMPILE_NO_PRESHADER : 0;
+ flags |= _cmdLine.hasArg('\0', "partial-precision") ? D3DCOMPILE_PARTIAL_PRECISION : 0;
+ flags |= _cmdLine.hasArg('\0', "prefer-flow-control") ? D3DCOMPILE_PREFER_FLOW_CONTROL : 0;
+ flags |= _cmdLine.hasArg('\0', "backwards-compatibility") ? D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY : 0;
- BX_TRACE("Profile: %s", profile);
- BX_TRACE("Flags: 0x%08x", flags);
+ bool werror = _cmdLine.hasArg('\0', "Werror");
- ID3DBlob* code;
- ID3DBlob* errorMsg;
+ if (werror)
+ {
+ flags |= D3DCOMPILE_WARNINGS_ARE_ERRORS;
+ }
- // Output preprocessed shader so that HLSL can be debugged via GPA
- // or PIX. Compiling through memory won't embed preprocessed shader
- // file path.
- std::string hlslfp;
+ uint32_t optimization = 3;
+ if (_cmdLine.hasArg(optimization, 'O') )
+ {
+ optimization = bx::uint32_min(optimization, BX_COUNTOF(s_optimizationLevelD3D11) - 1);
+ flags |= s_optimizationLevelD3D11[optimization];
+ }
+ else
+ {
+ flags |= D3DCOMPILE_SKIP_OPTIMIZATION;
+ }
- if (debug)
- {
- hlslfp = _cmdLine.findOption('o');
- hlslfp += ".hlsl";
- writeFile(hlslfp.c_str(), _code.c_str(), (int32_t)_code.size() );
- }
+ BX_TRACE("Profile: %s", profile);
+ BX_TRACE("Flags: 0x%08x", flags);
- HRESULT hr = D3DCompile(_code.c_str()
- , _code.size()
- , hlslfp.c_str()
- , NULL
- , NULL
- , "main"
- , profile
- , flags
- , 0
- , &code
- , &errorMsg
- );
- if (FAILED(hr)
- || (werror && NULL != errorMsg) )
- {
- const char* log = (char*)errorMsg->GetBufferPointer();
+ ID3DBlob* code;
+ ID3DBlob* errorMsg;
- int32_t line = 0;
- int32_t column = 0;
- int32_t start = 0;
- int32_t end = INT32_MAX;
+ // Output preprocessed shader so that HLSL can be debugged via GPA
+ // or PIX. Compiling through memory won't embed preprocessed shader
+ // file path.
+ std::string hlslfp;
- if (2 == sscanf(log, "(%u,%u):", &line, &column)
- && 0 != line)
+ if (debug)
{
- start = bx::uint32_imax(1, line-10);
- end = start + 20;
+ hlslfp = _cmdLine.findOption('o');
+ hlslfp += ".hlsl";
+ writeFile(hlslfp.c_str(), _code.c_str(), (int32_t)_code.size() );
}
- printCode(_code.c_str(), line, start, end);
- fprintf(stderr, "Error: 0x%08x %s\n", (uint32_t)hr, log);
- errorMsg->Release();
- return false;
- }
+ HRESULT hr = D3DCompile(_code.c_str()
+ , _code.size()
+ , hlslfp.c_str()
+ , NULL
+ , NULL
+ , "main"
+ , profile
+ , flags
+ , 0
+ , &code
+ , &errorMsg
+ );
+ if (FAILED(hr)
+ || (werror && NULL != errorMsg) )
+ {
+ const char* log = (char*)errorMsg->GetBufferPointer();
- UniformArray uniforms;
- uint8_t numAttrs = 0;
- uint16_t attrs[bgfx::Attrib::Count];
- uint16_t size = 0;
+ int32_t line = 0;
+ int32_t column = 0;
+ int32_t start = 0;
+ int32_t end = INT32_MAX;
- if (_d3d == 9)
- {
- if (!getReflectionDataDx9(code, uniforms) )
- {
+ if (2 == sscanf(log, "(%u,%u):", &line, &column)
+ && 0 != line)
+ {
+ start = bx::uint32_imax(1, line - 10);
+ end = start + 20;
+ }
+
+ printCode(_code.c_str(), line, start, end);
+ fprintf(stderr, "Error: D3DCompile failed 0x%08x %s\n", (uint32_t)hr, log);
+ errorMsg->Release();
return false;
}
- }
- else
- {
- UniformNameList unusedUniforms;
- if (!getReflectionDataDx11(code, profile[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) )
+
+ UniformArray uniforms;
+ uint8_t numAttrs = 0;
+ uint16_t attrs[bgfx::Attrib::Count];
+ uint16_t size = 0;
+
+ if (_d3d == 9)
{
- return false;
+ if (!getReflectionDataD3D9(code, uniforms) )
+ {
+ fprintf(stderr, "Error: Unable to get D3D9 reflection data.\n");
+ goto error;
+ }
}
-
- if (_firstPass
- && unusedUniforms.size() > 0)
+ else
{
- const size_t strLength = strlen("uniform");
+ UniformNameList unusedUniforms;
+ if (!getReflectionDataD3D11(code, profile[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) )
+ {
+ fprintf(stderr, "Unable to get D3D11 reflection data.\n");
+ goto error;
+ }
- // first time through, we just find unused uniforms and get rid of them
- std::string output;
- LineReader reader(_code.c_str() );
- while (!reader.isEof() )
+ if (_firstPass
+ && unusedUniforms.size() > 0)
{
- std::string line = reader.getLine();
- for (UniformNameList::iterator it = unusedUniforms.begin(), itEnd = unusedUniforms.end(); it != itEnd; ++it)
+ const size_t strLength = strlen("uniform");
+
+ // first time through, we just find unused uniforms and get rid of them
+ std::string output;
+ LineReader reader(_code.c_str() );
+ while (!reader.isEof() )
{
- size_t index = line.find("uniform ");
- if (index == std::string::npos)
+ std::string line = reader.getLine();
+ for (UniformNameList::iterator it = unusedUniforms.begin(), itEnd = unusedUniforms.end(); it != itEnd; ++it)
{
- continue;
- }
+ size_t index = line.find("uniform ");
+ if (index == std::string::npos)
+ {
+ continue;
+ }
- // matching lines like: uniform u_name;
- // we want to replace "uniform" with "static" so that it's no longer
- // included in the uniform blob that the application must upload
- // we can't just remove them, because unused functions might still reference
- // them and cause a compile error when they're gone
- if (!!bx::findIdentifierMatch(line.c_str(), it->c_str() ) )
- {
- line = line.replace(index, strLength, "static");
- unusedUniforms.erase(it);
- break;
+ // matching lines like: uniform u_name;
+ // we want to replace "uniform" with "static" so that it's no longer
+ // included in the uniform blob that the application must upload
+ // we can't just remove them, because unused functions might still reference
+ // them and cause a compile error when they're gone
+ if (!!bx::findIdentifierMatch(line.c_str(), it->c_str() ) )
+ {
+ line = line.replace(index, strLength, "static");
+ unusedUniforms.erase(it);
+ break;
+ }
}
+
+ output += line;
}
- output += line;
+ // recompile with the unused uniforms converted to statics
+ return compileHLSLShader(_cmdLine, _d3d, output.c_str(), _writer, false);
}
-
- // recompile with the unused uniforms converted to statics
- return compileHLSLShader(_cmdLine, _d3d, output.c_str(), _writer, false);
}
- }
- uint16_t count = (uint16_t)uniforms.size();
- bx::write(_writer, count);
+ {
+ uint16_t count = (uint16_t)uniforms.size();
+ bx::write(_writer, count);
- uint32_t fragmentBit = profile[0] == 'p' ? BGFX_UNIFORM_FRAGMENTBIT : 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);
- uint8_t type = un.type|fragmentBit;
- bx::write(_writer, type);
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
-
- BX_TRACE("%s, %s, %d, %d, %d"
- , un.name.c_str()
- , getUniformTypeName(un.type)
- , un.num
- , un.regIndex
- , un.regCount
- );
- }
+ uint32_t fragmentBit = profile[0] == 'p' ? BGFX_UNIFORM_FRAGMENTBIT : 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);
+ uint8_t type = un.type | fragmentBit;
+ bx::write(_writer, type);
+ bx::write(_writer, un.num);
+ bx::write(_writer, un.regIndex);
+ bx::write(_writer, un.regCount);
+
+ BX_TRACE("%s, %s, %d, %d, %d"
+ , un.name.c_str()
+ , getUniformTypeName(un.type)
+ , un.num
+ , un.regIndex
+ , un.regCount
+ );
+ }
+ }
- {
- ID3DBlob* stripped;
- hr = D3DStripShader(code->GetBufferPointer()
- , code->GetBufferSize()
- , D3DCOMPILER_STRIP_REFLECTION_DATA
- | D3DCOMPILER_STRIP_TEST_BLOBS
- , &stripped
- );
+ {
+ ID3DBlob* stripped;
+ hr = D3DStripShader(code->GetBufferPointer()
+ , code->GetBufferSize()
+ , D3DCOMPILER_STRIP_REFLECTION_DATA
+ | D3DCOMPILER_STRIP_TEST_BLOBS
+ , &stripped
+ );
+
+ if (SUCCEEDED(hr) )
+ {
+ code->Release();
+ code = stripped;
+ }
+ }
- if (SUCCEEDED(hr) )
{
- code->Release();
- code = stripped;
+ uint16_t shaderSize = (uint16_t)code->GetBufferSize();
+ bx::write(_writer, shaderSize);
+ bx::write(_writer, code->GetBufferPointer(), shaderSize);
+ uint8_t nul = 0;
+ bx::write(_writer, nul);
}
- }
- uint16_t shaderSize = (uint16_t)code->GetBufferSize();
- bx::write(_writer, shaderSize);
- bx::write(_writer, code->GetBufferPointer(), shaderSize);
- uint8_t nul = 0;
- bx::write(_writer, nul);
+ if (_d3d > 9)
+ {
+ bx::write(_writer, numAttrs);
+ bx::write(_writer, attrs, numAttrs*sizeof(uint16_t) );
- if (_d3d > 9)
- {
- bx::write(_writer, numAttrs);
- bx::write(_writer, attrs, numAttrs*sizeof(uint16_t) );
+ bx::write(_writer, size);
+ }
- bx::write(_writer, size);
- }
+ if (_cmdLine.hasArg('\0', "disasm") )
+ {
+ ID3DBlob* disasm;
+ D3DDisassemble(code->GetBufferPointer()
+ , code->GetBufferSize()
+ , 0
+ , NULL
+ , &disasm
+ );
- if (_cmdLine.hasArg('\0', "disasm") )
- {
- ID3DBlob* disasm;
- D3DDisassemble(code->GetBufferPointer()
- , code->GetBufferSize()
- , 0
- , NULL
- , &disasm
- );
+ if (NULL != disasm)
+ {
+ std::string disasmfp = _cmdLine.findOption('o');
+ disasmfp += ".disasm";
- if (NULL != disasm)
- {
- std::string disasmfp = _cmdLine.findOption('o');
- disasmfp += ".disasm";
+ writeFile(disasmfp.c_str(), disasm->GetBufferPointer(), (uint32_t)disasm->GetBufferSize() );
+ disasm->Release();
+ }
+ }
- writeFile(disasmfp.c_str(), disasm->GetBufferPointer(), (uint32_t)disasm->GetBufferSize() );
- disasm->Release();
+ if (NULL != errorMsg)
+ {
+ errorMsg->Release();
}
- }
- if (NULL != errorMsg)
- {
- errorMsg->Release();
- }
+ result = true;
- code->Release();
+ error:
+ code->Release();
+ unload();
+ return result;
+ }
- return true;
-}
+} // namespace bgfx
#else
-bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
+namespace bgfx
{
- BX_UNUSED(_cmdLine, _d3d, _code, _writer, _firstPass);
- fprintf(stderr, "HLSL compiler is not supported on this platform.\n");
- return false;
-}
+
+ bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
+ {
+ BX_UNUSED(_cmdLine, _d3d, _code, _writer, _firstPass);
+ fprintf(stderr, "HLSL compiler is not supported on this platform.\n");
+ return false;
+ }
+
+} // namespace bgfx
#endif // SHADERC_CONFIG_HLSL
diff --git a/3rdparty/bgfx/tools/texturec/texturec.cpp b/3rdparty/bgfx/tools/texturec/texturec.cpp
index 7c66cdd310c..81bccfeb6f6 100644
--- a/3rdparty/bgfx/tools/texturec/texturec.cpp
+++ b/3rdparty/bgfx/tools/texturec/texturec.cpp
@@ -13,9 +13,11 @@
#include "image.h"
#include <libsquish/squish.h>
#include <etc1/etc1.h>
+#include <etc2/ProcessRGB.hpp>
#include <nvtt/nvtt.h>
#include <pvrtc/PvrTcEncoder.h>
#include <tinyexr/tinyexr.h>
+#include <edtaa3/edtaa3func.h>
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.c>
@@ -54,7 +56,7 @@ namespace bgfx
::free(mem);
}
- void imageEncodeFromRgba8(uint8_t* _dst, const uint8_t* _src, uint32_t _width, uint32_t _height, uint8_t _format)
+ bool imageEncodeFromRgba8(void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint8_t _format)
{
TextureFormat::Enum format = TextureFormat::Enum(_format);
@@ -65,32 +67,52 @@ namespace bgfx
case TextureFormat::BC3:
case TextureFormat::BC4:
case TextureFormat::BC5:
- squish::CompressImage(_src, _width, _height, _dst
+ squish::CompressImage( (const uint8_t*)_src, _width, _height, _dst
, format == TextureFormat::BC2 ? squish::kDxt3
: format == TextureFormat::BC3 ? squish::kDxt5
: format == TextureFormat::BC4 ? squish::kBc4
: format == TextureFormat::BC5 ? squish::kBc5
: squish::kDxt1
);
- break;
+ return true;
case TextureFormat::BC6H:
- nvtt::compressBC6H(_src, _width, _height, 4, _dst);
- break;
+ nvtt::compressBC6H( (const uint8_t*)_src, _width, _height, 4, _dst);
+ return true;
case TextureFormat::BC7:
- nvtt::compressBC7(_src, _width, _height, 4, _dst);
- break;
+ nvtt::compressBC7( (const uint8_t*)_src, _width, _height, 4, _dst);
+ return true;
case TextureFormat::ETC1:
- etc1_encode_image(_src, _width, _height, 4, _width*4, _dst);
- break;
+ etc1_encode_image( (const uint8_t*)_src, _width, _height, 4, _width*4, (uint8_t*)_dst);
+ return true;
case TextureFormat::ETC2:
- case TextureFormat::ETC2A:
- case TextureFormat::ETC2A1:
- case TextureFormat::PTC12:
- break;
+ {
+ const uint32_t blockWidth = (_width +3)/4;
+ const uint32_t blockHeight = (_height+3)/4;
+ const uint32_t pitch = _width*4;
+ const uint8_t* src = (const uint8_t*)_src;
+ uint64_t* dst = (uint64_t*)_dst;
+ for (uint32_t yy = 0; yy < blockHeight; ++yy)
+ {
+ for (uint32_t xx = 0; xx < blockWidth; ++xx)
+ {
+ uint8_t block[4*4*4];
+ const uint8_t* ptr = &src[(yy*pitch+xx*4)*4];
+
+ for (uint32_t ii = 0; ii < 16; ++ii)
+ { // BGRx
+ memcpy(&block[ii*4], &ptr[(ii%4)*pitch + (ii&~3)], 4);
+ bx::xchg(block[ii*4+0], block[ii*4+2]);
+ }
+
+ *dst++ = ProcessRGB_ETC2(block);
+ }
+ }
+ }
+ return true;
case TextureFormat::PTC14:
{
@@ -98,14 +120,11 @@ namespace bgfx
RgbBitmap bmp;
bmp.width = _width;
bmp.height = _height;
- bmp.data = const_cast<uint8_t*>(_src);
+ bmp.data = (uint8_t*)const_cast<void*>(_src);
PvrTcEncoder::EncodeRgb4Bpp(_dst, bmp);
bmp.data = NULL;
}
- break;
-
- case TextureFormat::PTC12A:
- break;
+ return true;
case TextureFormat::PTC14A:
{
@@ -113,27 +132,186 @@ namespace bgfx
RgbaBitmap bmp;
bmp.width = _width;
bmp.height = _height;
- bmp.data = const_cast<uint8_t*>(_src);
+ bmp.data = (uint8_t*)const_cast<void*>(_src);
PvrTcEncoder::EncodeRgba4Bpp(_dst, bmp);
bmp.data = NULL;
}
- break;
-
- case TextureFormat::PTC22:
- case TextureFormat::PTC24:
- break;
+ return true;
case TextureFormat::BGRA8:
imageSwizzleBgra8(_width, _height, _width*4, _src, _dst);
- break;
+ return true;
case TextureFormat::RGBA8:
memcpy(_dst, _src, _width*_height*4);
- break;
+ return true;
default:
- break;
+ return imageConvert(_dst, format, _src, TextureFormat::RGBA8, _width, _height);
+ }
+
+ return false;
+ }
+
+ bool imageEncodeFromRgba32f(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint8_t _format)
+ {
+ TextureFormat::Enum format = TextureFormat::Enum(_format);
+
+ const uint8_t* src = (const uint8_t*)_src;
+
+ switch (format)
+ {
+ case TextureFormat::RGBA8:
+ {
+ uint8_t* dst = (uint8_t*)_dst;
+ for (uint32_t yy = 0; yy < _height; ++yy)
+ {
+ for (uint32_t xx = 0; xx < _width; ++xx)
+ {
+ const uint32_t offset = yy*_width + xx;
+ const float* input = (const float*)&src[offset * 16];
+ uint8_t* output = &dst[offset * 4];
+ output[0] = uint8_t(input[0]*255.0f + 0.5f);
+ output[1] = uint8_t(input[1]*255.0f + 0.5f);
+ output[2] = uint8_t(input[2]*255.0f + 0.5f);
+ output[3] = uint8_t(input[3]*255.0f + 0.5f);
+ }
+ }
+ }
+ return true;
+
+ case TextureFormat::BC5:
+ {
+ uint8_t* temp = (uint8_t*)BX_ALLOC(_allocator, _width*_height*4);
+ for (uint32_t yy = 0; yy < _height; ++yy)
+ {
+ for (uint32_t xx = 0; xx < _width; ++xx)
+ {
+ const uint32_t offset = yy*_width + xx;
+ const float* input = (const float*)&src[offset * 16];
+ uint8_t* output = &temp[offset * 4];
+ output[0] = uint8_t(input[0]*255.0f + 0.5f);
+ output[1] = uint8_t(input[1]*255.0f + 0.5f);
+ output[2] = uint8_t(input[2]*255.0f + 0.5f);
+ output[3] = uint8_t(input[3]*255.0f + 0.5f);
+ }
+ }
+
+ imageEncodeFromRgba8(_dst, temp, _width, _height, _format);
+ BX_FREE(_allocator, temp);
+ }
+ return true;
+
+ default:
+ return imageConvert(_dst, format, _src, TextureFormat::RGBA32F, _width, _height);
+ }
+
+ return false;
+ }
+
+ void imageRgba32f11to01(void* _dst, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
+
+ for (uint32_t yy = 0; yy < _height; ++yy)
+ {
+ for (uint32_t xx = 0; xx < _width; ++xx)
+ {
+ const uint32_t offset = yy*_pitch + xx * 16;
+ const float* input = (const float*)&src[offset];
+ float* output = (float*)&dst[offset];
+ output[0] = input[0]*0.5f + 0.5f;
+ output[1] = input[1]*0.5f + 0.5f;
+ output[2] = input[2]*0.5f + 0.5f;
+ output[3] = input[3]*0.5f + 0.5f;
+ }
+ }
+ }
+
+ static void edtaa3(bx::AllocatorI* _allocator, double* _dst, uint32_t _width, uint32_t _height, double* _src)
+ {
+ const uint32_t numPixels = _width*_height;
+
+ short* xdist = (short *)BX_ALLOC(_allocator, numPixels*sizeof(short) );
+ short* ydist = (short *)BX_ALLOC(_allocator, numPixels*sizeof(short) );
+ double* gx = (double*)BX_ALLOC(_allocator, numPixels*sizeof(double) );
+ double* gy = (double*)BX_ALLOC(_allocator, numPixels*sizeof(double) );
+
+ ::computegradient(_src, _width, _height, gx, gy);
+ ::edtaa3(_src, gx, gy, _width, _height, xdist, ydist, _dst);
+
+ for (uint32_t ii = 0; ii < numPixels; ++ii)
+ {
+ if (_dst[ii] < 0.0)
+ {
+ _dst[ii] = 0.0;
+ }
}
+
+ BX_FREE(_allocator, xdist);
+ BX_FREE(_allocator, ydist);
+ BX_FREE(_allocator, gx);
+ BX_FREE(_allocator, gy);
+ }
+
+ inline double min(double _a, double _b)
+ {
+ return _a > _b ? _b : _a;
+ }
+
+ inline double max(double _a, double _b)
+ {
+ return _a > _b ? _a : _b;
+ }
+
+ inline double clamp(double _val, double _min, double _max)
+ {
+ return max(min(_val, _max), _min);
+ }
+
+ void imageMakeDist(bx::AllocatorI* _allocator, void* _dst, uint32_t _width, uint32_t _height, uint32_t _pitch, float _edge, const void* _src)
+ {
+ const uint32_t numPixels = _width*_height;
+
+ double* imgIn = (double*)BX_ALLOC(_allocator, numPixels*sizeof(double) );
+ double* outside = (double*)BX_ALLOC(_allocator, numPixels*sizeof(double) );
+ double* inside = (double*)BX_ALLOC(_allocator, numPixels*sizeof(double) );
+
+ for (uint32_t yy = 0; yy < _height; ++yy)
+ {
+ const uint8_t* src = (const uint8_t*)_src + yy*_pitch;
+ double* dst = &imgIn[yy*_width];
+ for (uint32_t xx = 0; xx < _width; ++xx)
+ {
+ dst[xx] = double(src[xx])/255.0;
+ }
+ }
+
+ edtaa3(_allocator, outside, _width, _height, imgIn);
+
+ for (uint32_t ii = 0; ii < numPixels; ++ii)
+ {
+ imgIn[ii] = 1.0 - imgIn[ii];
+ }
+
+ edtaa3(_allocator, inside, _width, _height, imgIn);
+
+ BX_FREE(_allocator, imgIn);
+
+ uint8_t* dst = (uint8_t*)_dst;
+
+ double edgeOffset = _edge*0.5;
+ double invEdge = 1.0/_edge;
+
+ for (uint32_t ii = 0; ii < numPixels; ++ii)
+ {
+ double dist = clamp( ( (outside[ii] - inside[ii])+edgeOffset) * invEdge, 0.0, 1.0);
+ dst[ii] = 255-uint8_t(dist * 255.0);
+ }
+
+ BX_FREE(_allocator, inside);
+ BX_FREE(_allocator, outside);
}
} // namespace bgfx
@@ -168,6 +346,8 @@ void help(const char* _error = NULL)
" -o <file path> Output file path (file will be written in KTX format).\n"
" -t <format> Output format type (BC1/2/3/4/5, ETC1, PVR14, etc.).\n"
" -m, --mips Generate mip-maps.\n"
+ " -n, --normalmap Input texture is normal map.\n"
+ " --sdf <edge> Compute SDF texture.\n"
"\n"
"For additional information, see https://github.com/bkaradzic/bgfx\n"
@@ -198,14 +378,23 @@ int main(int _argc, const char* _argv[])
return EXIT_FAILURE;
}
+ bool sdf = false;
+ double edge = 16.0;
+ const char* edgeOpt = cmdLine.findOption("sdf");
+ if (NULL != edgeOpt)
+ {
+ sdf = true;
+ edge = atof(edgeOpt);
+ }
+ BX_UNUSED(sdf, edge);
+
bx::CrtFileReader reader;
- if (0 != bx::open(&reader, inputFileName) )
+ if (!bx::open(&reader, inputFileName) )
{
help("Failed to open input file.");
return EXIT_FAILURE;
}
- const bool mips = cmdLine.hasArg('m', "mips");
const char* type = cmdLine.findOption('t');
bgfx::TextureFormat::Enum format = bgfx::TextureFormat::BGRA8;
@@ -220,6 +409,9 @@ int main(int _argc, const char* _argv[])
}
}
+ const bool mips = cmdLine.hasArg('m', "mips");
+ const bool normalMap = cmdLine.hasArg('n', "normalmap");
+
uint32_t size = (uint32_t)bx::getSize(&reader);
const bgfx::Memory* mem = bgfx::alloc(size);
bx::read(&reader, mem->data, mem->size);
@@ -271,46 +463,99 @@ int main(int _argc, const char* _argv[])
ImageMip mip;
if (imageGetRawData(imageContainer, 0, 0, mem->data, mem->size, mip) )
{
- uint32_t size = imageGetSize(TextureFormat::RGBA8, mip.m_width, mip.m_height);
- uint8_t* rgba = (uint8_t*)BX_ALLOC(&allocator, size);
-
- imageDecodeToRgba8(rgba
- , mip.m_data
- , mip.m_width
- , mip.m_height
- , mip.m_width*mip.m_bpp/8
- , mip.m_format
- );
-
uint8_t numMips = mips
? imageGetNumMips(format, mip.m_width, mip.m_height)
: 1
;
- imageContainer.m_size = imageGetSize(format, mip.m_width, mip.m_height, 0, false, numMips);
- imageContainer.m_format = format;
- output = alloc(imageContainer.m_size);
- imageEncodeFromRgba8(output->data, rgba, mip.m_width, mip.m_height, format);
+ void* temp = NULL;
+
+ if (normalMap)
+ {
+ uint32_t size = imageGetSize(TextureFormat::RGBA32F, mip.m_width, mip.m_height);
+ temp = BX_ALLOC(&allocator, size);
+ float* rgba = (float*)temp;
+ float* rgbaDst = (float*)BX_ALLOC(&allocator, size);
+
+ imageDecodeToRgba32f(&allocator
+ , rgba
+ , mip.m_data
+ , mip.m_width
+ , mip.m_height
+ , mip.m_width*mip.m_bpp/8
+ , mip.m_format
+ );
+
+ if (TextureFormat::BC5 != mip.m_format)
+ {
+ for (uint32_t yy = 0; yy < mip.m_height; ++yy)
+ {
+ for (uint32_t xx = 0; xx < mip.m_width; ++xx)
+ {
+ const uint32_t offset = (yy*mip.m_width + xx) * 4;
+ float* inout = &rgba[offset];
+ inout[0] = inout[0] * 2.0f/255.0f - 1.0f;
+ inout[1] = inout[1] * 2.0f/255.0f - 1.0f;
+ inout[2] = inout[2] * 2.0f/255.0f - 1.0f;
+ inout[3] = inout[3] * 2.0f/255.0f - 1.0f;
+ }
+ }
+ }
+
+ output = imageAlloc(imageContainer, format, mip.m_width, mip.m_height, 0, false, mips);
+
+ imageRgba32f11to01(rgbaDst, mip.m_width, mip.m_height, mip.m_width*16, rgba);
+ imageEncodeFromRgba32f(&allocator, output->data, rgbaDst, mip.m_width, mip.m_height, format);
- for (uint8_t lod = 1; lod < numMips; ++lod)
+ for (uint8_t lod = 1; lod < numMips; ++lod)
+ {
+ imageRgba32fDownsample2x2NormalMap(mip.m_width, mip.m_height, mip.m_width*16, rgba, rgba);
+ imageRgba32f11to01(rgbaDst, mip.m_width, mip.m_height, mip.m_width*16, rgba);
+
+ ImageMip dstMip;
+ imageGetRawData(imageContainer, 0, lod, output->data, output->size, dstMip);
+ uint8_t* data = const_cast<uint8_t*>(dstMip.m_data);
+ imageEncodeFromRgba32f(&allocator, data, rgbaDst, dstMip.m_width, dstMip.m_height, format);
+ }
+
+ BX_FREE(&allocator, rgbaDst);
+ }
+ else
{
- ImageMip mip1;
- imageGetRawData(imageContainer, 0, lod, output->data, output->size, mip1);
- uint8_t* data = const_cast<uint8_t*>(mip1.m_data);
-
- uint32_t width = bx::uint32_max(1, mip.m_width >>lod);
- uint32_t height = bx::uint32_max(1, mip.m_height>>lod);
- imageRgba8Downsample2x2(width, height, width*4, rgba, rgba);
- imageEncodeFromRgba8(data, rgba, mip.m_width, mip.m_height, format);
+ uint32_t size = imageGetSize(TextureFormat::RGBA8, mip.m_width, mip.m_height);
+ temp = BX_ALLOC(&allocator, size);
+ uint8_t* rgba = (uint8_t*)temp;
+
+ imageDecodeToRgba8(rgba
+ , mip.m_data
+ , mip.m_width
+ , mip.m_height
+ , mip.m_width*mip.m_bpp/8
+ , mip.m_format
+ );
+
+ output = imageAlloc(imageContainer, format, mip.m_width, mip.m_height, 0, false, mips);
+
+ imageEncodeFromRgba8(output->data, rgba, mip.m_width, mip.m_height, format);
+
+ for (uint8_t lod = 1; lod < numMips; ++lod)
+ {
+ imageRgba8Downsample2x2(mip.m_width, mip.m_height, mip.m_width*4, rgba, rgba);
+
+ ImageMip dstMip;
+ imageGetRawData(imageContainer, 0, lod, output->data, output->size, dstMip);
+ uint8_t* data = const_cast<uint8_t*>(dstMip.m_data);
+ imageEncodeFromRgba8(data, rgba, dstMip.m_width, dstMip.m_height, format);
+ }
}
- BX_FREE(&allocator, rgba);
+ BX_FREE(&allocator, temp);
}
if (NULL != output)
{
bx::CrtFileWriter writer;
- if (0 == bx::open(&writer, outputFileName) )
+ if (bx::open(&writer, outputFileName) )
{
if (NULL != bx::stristr(outputFileName, ".ktx") )
{
@@ -319,8 +564,13 @@ int main(int _argc, const char* _argv[])
bx::close(&writer);
}
+ else
+ {
+ help("Failed to open output file.");
+ return EXIT_FAILURE;
+ }
- release(output);
+ imageFree(output);
}
}
diff --git a/3rdparty/bx/.appveyor.yml b/3rdparty/bx/.appveyor.yml
new file mode 100644
index 00000000000..286a3c9cc3b
--- /dev/null
+++ b/3rdparty/bx/.appveyor.yml
@@ -0,0 +1,21 @@
+shallow_clone: true
+
+os:
+ - Visual Studio 2015
+
+environment:
+ matrix:
+ - TOOLSET: vs2010
+ - TOOLSET: vs2012
+ - TOOLSET: vs2013
+ - TOOLSET: vs2015
+
+configuration:
+ - Debug
+ - Release
+
+install:
+ tools\bin\windows\genie %TOOLSET%
+
+build:
+ project: .build/projects/$(TOOLSET)/bx.sln
diff --git a/3rdparty/bx/.travis.yml b/3rdparty/bx/.travis.yml
new file mode 100644
index 00000000000..7b8e2d62283
--- /dev/null
+++ b/3rdparty/bx/.travis.yml
@@ -0,0 +1,20 @@
+language: cpp
+matrix:
+ include:
+ - compiler: gcc
+ os: linux
+ - compiler: clang
+ os: osx
+
+script:
+ make test
+
+branches:
+ only:
+ - master
+
+notifications:
+ email: false
+
+osx_image:
+ xcode61
diff --git a/3rdparty/bx/README.md b/3rdparty/bx/README.md
index c864c84fbab..88cb1bf55ac 100644
--- a/3rdparty/bx/README.md
+++ b/3rdparty/bx/README.md
@@ -3,6 +3,9 @@ bx
Base library.
+[![Build Status](https://travis-ci.org/bkaradzic/bx.svg?branch=master)](https://travis-ci.org/bkaradzic/bx)
+[![Build status](https://ci.appveyor.com/api/projects/status/edras3mltmoy31g5?svg=true)](https://ci.appveyor.com/project/bkaradzic/bx)
+
Contact
-------
diff --git a/3rdparty/bx/include/bx/bx.h b/3rdparty/bx/include/bx/bx.h
index 7ada4b2b970..80e9b765e10 100644
--- a/3rdparty/bx/include/bx/bx.h
+++ b/3rdparty/bx/include/bx/bx.h
@@ -8,6 +8,7 @@
#include <stdint.h> // uint32_t
#include <stdlib.h> // size_t
+#include <string.h> // memcpy
#include "config.h"
#include "macros.h"
@@ -52,6 +53,32 @@ namespace bx
return 0 == (un.addr & (_align-1) );
}
+ /// Scatter/gather memcpy.
+ inline void memCopy(void* _dst, const void* _src, uint32_t _size, uint32_t _num, uint32_t _srcPitch, uint32_t _dstPitch)
+ {
+ const uint8_t* src = (const uint8_t*)_src;
+ uint8_t* dst = (uint8_t*)_dst;
+
+ for (uint32_t ii = 0; ii < _num; ++ii)
+ {
+ memcpy(dst, src, _size);
+ src += _srcPitch;
+ dst += _dstPitch;
+ }
+ }
+
+ ///
+ inline void gather(void* _dst, const void* _src, uint32_t _size, uint32_t _num, uint32_t _srcPitch)
+ {
+ memCopy(_dst, _src, _size, _num, _srcPitch, _size);
+ }
+
+ ///
+ inline void scatter(void* _dst, const void* _src, uint32_t _size, uint32_t _num, uint32_t _dstPitch)
+ {
+ memCopy(_dst, _src, _size, _num, _size, _dstPitch);
+ }
+
} // namespace bx
// Annoying C++0x stuff..
diff --git a/3rdparty/bx/include/bx/config.h b/3rdparty/bx/include/bx/config.h
index 3837193e19a..6b8cfe45a7f 100644
--- a/3rdparty/bx/include/bx/config.h
+++ b/3rdparty/bx/include/bx/config.h
@@ -30,6 +30,7 @@
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_QNX \
|| BX_PLATFORM_RPI \
+ || BX_PLATFORM_STEAMLINK \
|| BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
? 1 : 0)
diff --git a/3rdparty/bx/include/bx/error.h b/3rdparty/bx/include/bx/error.h
new file mode 100644
index 00000000000..d98a111f5af
--- /dev/null
+++ b/3rdparty/bx/include/bx/error.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2010-2016 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ */
+
+#ifndef BX_ERROR_H_HEADER_GUARD
+#define BX_ERROR_H_HEADER_GUARD
+
+#include "bx.h"
+
+#define BX_ERROR_SET(_ptr, _result, _msg) \
+ BX_MACRO_BLOCK_BEGIN \
+ BX_TRACE("Error %d: %s", _result.code, "" _msg); \
+ _ptr->setError(_result, "" _msg); \
+ BX_MACRO_BLOCK_END
+
+#define BX_ERROR_USE_TEMP_WHEN_NULL(_ptr) \
+ const bx::Error tmpError; /* It should not be used directly! */ \
+ _ptr = NULL == _ptr ? const_cast<bx::Error*>(&tmpError) : _ptr
+
+#define BX_ERROR_SCOPE(_ptr) \
+ BX_ERROR_USE_TEMP_WHEN_NULL(_ptr); \
+ bx::ErrorScope bxErrorScope(const_cast<bx::Error*>(&tmpError) )
+
+#define BX_ERROR_RESULT(_err, _code) \
+ BX_STATIC_ASSERT(_code != 0, "ErrorCode 0 is reserved!"); \
+ static const bx::ErrorResult _err = { _code }
+
+namespace bx
+{
+ ///
+ struct ErrorResult
+ {
+ uint32_t code;
+ };
+
+ ///
+ class Error
+ {
+ BX_CLASS(Error
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
+ Error()
+ : m_code(0)
+ {
+ }
+
+ void setError(ErrorResult _errorResult, const char* _msg)
+ {
+ BX_CHECK(0 != _errorResult.code, "Invalid ErrorResult passed to setError!");
+
+ if (!isOk() )
+ {
+ return;
+ }
+
+ m_code = _errorResult.code;
+ m_msg = _msg;
+ }
+
+ bool isOk() const
+ {
+ return 0 == m_code;
+ }
+
+ ErrorResult get() const
+ {
+ ErrorResult result = { m_code };
+ return result;
+ }
+
+ bool operator==(ErrorResult _rhs) const
+ {
+ return _rhs.code == m_code;
+ }
+
+ private:
+ const char* m_msg;
+ uint32_t m_code;
+ };
+
+ ///
+ class ErrorScope
+ {
+ BX_CLASS(ErrorScope
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
+ ErrorScope(Error* _err)
+ : m_err(_err)
+ {
+ BX_CHECK(NULL != _err, "_err can't be NULL");
+ }
+
+ ~ErrorScope()
+ {
+ BX_CHECK(m_err->isOk(), "Error: %d", m_err->get().code);
+ }
+
+ private:
+ Error* m_err;
+ };
+
+} // namespace bx
+
+#endif // BX_ERROR_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/fpumath.h b/3rdparty/bx/include/bx/fpumath.h
index 0763f5bcb5f..b76da2f9a31 100644
--- a/3rdparty/bx/include/bx/fpumath.h
+++ b/3rdparty/bx/include/bx/fpumath.h
@@ -29,9 +29,19 @@ namespace bx
return _rad * 180.0f / pi;
}
+ inline float ffloor(float _f)
+ {
+ return floorf(_f);
+ }
+
+ inline float fceil(float _f)
+ {
+ return ceilf(_f);
+ }
+
inline float fround(float _f)
{
- return floorf(_f + 0.5f);
+ return ffloor(_f + 0.5f);
}
inline float fmin(float _a, float _b)
@@ -705,14 +715,14 @@ namespace bx
mtxProjRh(_result, _fovy, _aspect, _near, _far, _oglNdc);
}
- inline void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f)
+ inline void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f, bool _oglNdc = false)
{
const float aa = 2.0f/(_right - _left);
const float bb = 2.0f/(_top - _bottom);
- const float cc = 1.0f/(_far - _near);
+ const float cc = (_oglNdc ? 2.0f : 1.0f) / (_far - _near);
const float dd = (_left + _right)/(_left - _right);
const float ee = (_top + _bottom)/(_bottom - _top);
- const float ff = _near / (_near - _far);
+ const float ff = _oglNdc ? (_near + _far)/(_near - _far) : _near/(_near - _far);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = aa;
diff --git a/3rdparty/bx/include/bx/handlealloc.h b/3rdparty/bx/include/bx/handlealloc.h
index d947256a9e2..7b10209ab2d 100644
--- a/3rdparty/bx/include/bx/handlealloc.h
+++ b/3rdparty/bx/include/bx/handlealloc.h
@@ -253,7 +253,7 @@ namespace bx
}
private:
- void insertBefore(int16_t _before, uint16_t _handle)
+ void insertBefore(uint16_t _before, uint16_t _handle)
{
Link& curr = m_links[_handle];
curr.m_next = _before;
diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h
index 50fca7f0fbe..074ec0e513c 100644
--- a/3rdparty/bx/include/bx/os.h
+++ b/3rdparty/bx/include/bx/os.h
@@ -20,16 +20,17 @@
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
- || BX_PLATFORM_RPI
-
+ || BX_PLATFORM_RPI \
+ || BX_PLATFORM_STEAMLINK
# include <sched.h> // sched_yield
# if BX_PLATFORM_BSD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
- || BX_PLATFORM_PS4
+ || BX_PLATFORM_PS4 \
+ || BX_PLATFORM_STEAMLINK
# include <pthread.h> // mach_port_t
-# endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL
+# endif // BX_PLATFORM_*
# if BX_PLATFORM_NACL
# include <sys/nacl_syscalls.h> // nanosleep
@@ -42,7 +43,9 @@
# if BX_PLATFORM_ANDROID
# include <malloc.h> // mallinfo
-# elif BX_PLATFORM_LINUX || BX_PLATFORM_RPI
+# elif BX_PLATFORM_LINUX \
+ || BX_PLATFORM_RPI \
+ || BX_PLATFORM_STEAMLINK
# include <unistd.h> // syscall
# include <sys/syscall.h>
# elif BX_PLATFORM_OSX
@@ -99,7 +102,7 @@ namespace bx
{
#if BX_PLATFORM_WINDOWS
return ::GetCurrentThreadId();
-#elif BX_PLATFORM_LINUX || BX_PLATFORM_RPI
+#elif BX_PLATFORM_LINUX || BX_PLATFORM_RPI || BX_PLATFORM_STEAMLINK
return (pid_t)::syscall(SYS_gettid);
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h
index c41ae0d11be..3f245d5dff9 100644
--- a/3rdparty/bx/include/bx/platform.h
+++ b/3rdparty/bx/include/bx/platform.h
@@ -22,6 +22,7 @@
#define BX_PLATFORM_PS4 0
#define BX_PLATFORM_QNX 0
#define BX_PLATFORM_RPI 0
+#define BX_PLATFORM_STEAMLINK 0
#define BX_PLATFORM_WINDOWS 0
#define BX_PLATFORM_WINRT 0
#define BX_PLATFORM_XBOX360 0
@@ -152,20 +153,24 @@
# undef BX_PLATFORM_WINRT
# define BX_PLATFORM_WINRT 1
# endif
-#elif defined(__VCCOREVER__)
-// RaspberryPi compiler defines __linux__
-# undef BX_PLATFORM_RPI
-# define BX_PLATFORM_RPI 1
-#elif defined(__native_client__)
-// NaCl compiler defines __linux__
-# include <ppapi/c/pp_macros.h>
-# undef BX_PLATFORM_NACL
-# define BX_PLATFORM_NACL PPAPI_RELEASE
#elif defined(__ANDROID__)
// Android compiler defines __linux__
# include <android/api-level.h>
# undef BX_PLATFORM_ANDROID
# define BX_PLATFORM_ANDROID __ANDROID_API__
+#elif defined(__native_client__)
+// NaCl compiler defines __linux__
+# include <ppapi/c/pp_macros.h>
+# undef BX_PLATFORM_NACL
+# define BX_PLATFORM_NACL PPAPI_RELEASE
+#elif defined(__STEAMLINK__)
+// SteamLink compiler defines __linux__
+# undef BX_PLATFORM_STEAMLINK
+# define BX_PLATFORM_STEAMLINK 1
+#elif defined(__VCCOREVER__)
+// RaspberryPi compiler defines __linux__
+# undef BX_PLATFORM_RPI
+# define BX_PLATFORM_RPI 1
#elif defined(__linux__)
# undef BX_PLATFORM_LINUX
# define BX_PLATFORM_LINUX 1
@@ -204,6 +209,7 @@
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_QNX \
+ || BX_PLATFORM_STEAMLINK \
|| BX_PLATFORM_PS4 \
|| BX_PLATFORM_RPI \
)
@@ -223,15 +229,15 @@
BX_STRINGIZE(__clang_minor__) "." \
BX_STRINGIZE(__clang_patchlevel__)
#elif BX_COMPILER_MSVC
-# if BX_COMPILER_MSVC >= 1900
+# if BX_COMPILER_MSVC >= 1900 // Visual Studio 2015
# define BX_COMPILER_NAME "MSVC 14.0"
-# elif BX_COMPILER_MSVC >= 1800
+# elif BX_COMPILER_MSVC >= 1800 // Visual Studio 2013
# define BX_COMPILER_NAME "MSVC 12.0"
-# elif BX_COMPILER_MSVC >= 1700
+# elif BX_COMPILER_MSVC >= 1700 // Visual Studio 2012
# define BX_COMPILER_NAME "MSVC 11.0"
-# elif BX_COMPILER_MSVC >= 1600
+# elif BX_COMPILER_MSVC >= 1600 // Visual Studio 2010
# define BX_COMPILER_NAME "MSVC 10.0"
-# elif BX_COMPILER_MSVC >= 1500
+# elif BX_COMPILER_MSVC >= 1500 // Visual Studio 2008
# define BX_COMPILER_NAME "MSVC 9.0"
# else
# define BX_COMPILER_NAME "MSVC"
@@ -263,6 +269,8 @@
# define BX_PLATFORM_NAME "QNX"
#elif BX_PLATFORM_RPI
# define BX_PLATFORM_NAME "RaspberryPi"
+#elif BX_PLATFORM_STEAMLINK
+# define BX_PLATFORM_NAME "SteamLink"
#elif BX_PLATFORM_WINDOWS
# define BX_PLATFORM_NAME "Windows"
#elif BX_PLATFORM_WINRT
diff --git a/3rdparty/bx/include/bx/readerwriter.h b/3rdparty/bx/include/bx/readerwriter.h
index c673eed388a..ef8c810a870 100644
--- a/3rdparty/bx/include/bx/readerwriter.h
+++ b/3rdparty/bx/include/bx/readerwriter.h
@@ -12,6 +12,7 @@
#include "bx.h"
#include "allocator.h"
+#include "error.h"
#include "uint32_t.h"
#if BX_COMPILER_MSVC_COMPATIBLE
@@ -22,6 +23,10 @@
# define ftello64 ftello
#endif // BX_
+BX_ERROR_RESULT(BX_ERROR_READERWRITER_OPEN, BX_MAKEFOURCC('R', 'W', 0, 1) );
+BX_ERROR_RESULT(BX_ERROR_READERWRITER_READ, BX_MAKEFOURCC('R', 'W', 0, 2) );
+BX_ERROR_RESULT(BX_ERROR_READERWRITER_WRITE, BX_MAKEFOURCC('R', 'W', 0, 3) );
+
namespace bx
{
struct Whence
@@ -37,7 +42,7 @@ namespace bx
struct BX_NO_VTABLE ReaderI
{
virtual ~ReaderI() = 0;
- virtual int32_t read(void* _data, int32_t _size) = 0;
+ virtual int32_t read(void* _data, int32_t _size, Error* _err) = 0;
};
inline ReaderI::~ReaderI()
@@ -47,7 +52,7 @@ namespace bx
struct BX_NO_VTABLE WriterI
{
virtual ~WriterI() = 0;
- virtual int32_t write(const void* _data, int32_t _size) = 0;
+ virtual int32_t write(const void* _data, int32_t _size, Error* _err) = 0;
};
inline WriterI::~WriterI()
@@ -65,40 +70,46 @@ namespace bx
}
/// Read data.
- inline int32_t read(ReaderI* _reader, void* _data, int32_t _size)
+ inline int32_t read(ReaderI* _reader, void* _data, int32_t _size, Error* _err = NULL)
{
- return _reader->read(_data, _size);
+ BX_ERROR_SCOPE(_err);
+ return _reader->read(_data, _size, _err);
}
/// Write value.
template<typename Ty>
- inline int32_t read(ReaderI* _reader, Ty& _value)
+ inline int32_t read(ReaderI* _reader, Ty& _value, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
- return _reader->read(&_value, sizeof(Ty) );
+ return _reader->read(&_value, sizeof(Ty), _err);
}
/// Read value and converts it to host endianess. _fromLittleEndian specifies
/// underlying stream endianess.
template<typename Ty>
- inline int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian)
+ inline int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
Ty value;
- int32_t result = _reader->read(&value, sizeof(Ty) );
+ int32_t result = _reader->read(&value, sizeof(Ty), _err);
_value = toHostEndian(value, _fromLittleEndian);
return result;
}
/// Write data.
- inline int32_t write(WriterI* _writer, const void* _data, int32_t _size)
+ inline int32_t write(WriterI* _writer, const void* _data, int32_t _size, Error* _err = NULL)
{
- return _writer->write(_data, _size);
+ BX_ERROR_SCOPE(_err);
+ return _writer->write(_data, _size, _err);
}
/// Write repeat the same value.
- inline int32_t writeRep(WriterI* _writer, uint8_t _byte, int32_t _size)
+ inline int32_t writeRep(WriterI* _writer, uint8_t _byte, int32_t _size, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
+
const uint32_t tmp0 = uint32_sels(64 - _size, 64, _size);
const uint32_t tmp1 = uint32_sels(256 - _size, 256, tmp0);
const uint32_t blockSize = uint32_sels(1024 - _size, 1024, tmp1);
@@ -108,7 +119,7 @@ namespace bx
int32_t size = 0;
while (0 < _size)
{
- int32_t bytes = write(_writer, temp, uint32_min(blockSize, _size) );
+ int32_t bytes = write(_writer, temp, uint32_min(blockSize, _size), _err);
size += bytes;
_size -= bytes;
}
@@ -118,29 +129,32 @@ namespace bx
/// Write value.
template<typename Ty>
- inline int32_t write(WriterI* _writer, const Ty& _value)
+ inline int32_t write(WriterI* _writer, const Ty& _value, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
- return _writer->write(&_value, sizeof(Ty) );
+ return _writer->write(&_value, sizeof(Ty), _err);
}
/// Write value as little endian.
template<typename Ty>
- inline int32_t writeLE(WriterI* _writer, const Ty& _value)
+ inline int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
Ty value = toLittleEndian(_value);
- int32_t result = _writer->write(&value, sizeof(Ty) );
+ int32_t result = _writer->write(&value, sizeof(Ty), _err);
return result;
}
/// Write value as big endian.
template<typename Ty>
- inline int32_t writeBE(WriterI* _writer, const Ty& _value)
+ inline int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err = NULL)
{
+ BX_ERROR_SCOPE(_err);
BX_STATIC_ASSERT(BX_TYPE_IS_POD(Ty) );
Ty value = toBigEndian(_value);
- int32_t result = _writer->write(&value, sizeof(Ty) );
+ int32_t result = _writer->write(&value, sizeof(Ty), _err);
return result;
}
@@ -198,34 +212,36 @@ namespace bx
struct BX_NO_VTABLE FileReaderI : public ReaderSeekerI
{
- virtual int32_t open(const char* _filePath) = 0;
- virtual int32_t close() = 0;
+ virtual bool open(const char* _filePath, Error* _err) = 0;
+ virtual void close() = 0;
};
struct BX_NO_VTABLE FileWriterI : public WriterSeekerI
{
- virtual int32_t open(const char* _filePath, bool _append = false) = 0;
- virtual int32_t close() = 0;
+ virtual bool open(const char* _filePath, bool _append, Error* _err) = 0;
+ virtual void close() = 0;
};
- inline int32_t open(FileReaderI* _reader, const char* _filePath)
+ inline bool open(FileReaderI* _reader, const char* _filePath, Error* _err = NULL)
{
- return _reader->open(_filePath);
+ BX_ERROR_USE_TEMP_WHEN_NULL(_err);
+ return _reader->open(_filePath, _err);
}
- inline int32_t close(FileReaderI* _reader)
+ inline void close(FileReaderI* _reader)
{
- return _reader->close();
+ _reader->close();
}
- inline int32_t open(FileWriterI* _writer, const char* _filePath, bool _append = false)
+ inline bool open(FileWriterI* _writer, const char* _filePath, bool _append = false, Error* _err = NULL)
{
- return _writer->open(_filePath, _append);
+ BX_ERROR_USE_TEMP_WHEN_NULL(_err);
+ return _writer->open(_filePath, _append, _err);
}
- inline int32_t close(FileWriterI* _writer)
+ inline void close(FileWriterI* _writer)
{
- return _writer->close();
+ _writer->close();
}
struct BX_NO_VTABLE MemoryBlockI
@@ -332,8 +348,10 @@ namespace bx
return m_pos;
}
- virtual int32_t write(const void* /*_data*/, int32_t _size) BX_OVERRIDE
+ virtual int32_t write(const void* /*_data*/, int32_t _size, Error* _err) BX_OVERRIDE
{
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
int32_t morecore = int32_t(m_pos - m_top) + _size;
if (0 < morecore)
@@ -344,6 +362,10 @@ namespace bx
int64_t reminder = m_top-m_pos;
int32_t size = uint32_min(_size, int32_t(reminder > INT32_MAX ? INT32_MAX : reminder) );
m_pos += size;
+ if (size != _size)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_WRITE, "SizerWriter: write truncated.");
+ }
return size;
}
@@ -386,12 +408,18 @@ namespace bx
return m_pos;
}
- virtual int32_t read(void* _data, int32_t _size) BX_OVERRIDE
+ virtual int32_t read(void* _data, int32_t _size, Error* _err) BX_OVERRIDE
{
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
int64_t reminder = m_top-m_pos;
int32_t size = uint32_min(_size, int32_t(reminder > INT32_MAX ? INT32_MAX : reminder) );
memcpy(_data, &m_data[m_pos], size);
m_pos += size;
+ if (size != _size)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_READ, "MemoryReader: read truncated.");
+ }
return size;
}
@@ -452,8 +480,10 @@ namespace bx
return m_pos;
}
- virtual int32_t write(const void* _data, int32_t _size) BX_OVERRIDE
+ virtual int32_t write(const void* _data, int32_t _size, Error* _err) BX_OVERRIDE
{
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
int32_t morecore = int32_t(m_pos - m_size) + _size;
if (0 < morecore)
@@ -468,6 +498,10 @@ namespace bx
memcpy(&m_data[m_pos], _data, size);
m_pos += size;
m_top = int64_max(m_top, m_pos);
+ if (size != _size)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_WRITE, "MemoryWriter: write truncated.");
+ }
return size;
}
@@ -509,16 +543,23 @@ namespace bx
{
}
- virtual int32_t open(const char* _filePath) BX_OVERRIDE
+ virtual bool open(const char* _filePath, Error* _err) BX_OVERRIDE
{
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
m_file = fopen(_filePath, "rb");
- return NULL == m_file;
+ if (NULL == m_file)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_OPEN, "CrtFileReader: Failed to open file.");
+ return false;
+ }
+
+ return true;
}
- virtual int32_t close() BX_OVERRIDE
+ virtual void close() BX_OVERRIDE
{
fclose(m_file);
- return 0;
}
virtual int64_t seek(int64_t _offset = 0, Whence::Enum _whence = Whence::Current) BX_OVERRIDE
@@ -527,9 +568,18 @@ namespace bx
return ftello64(m_file);
}
- virtual int32_t read(void* _data, int32_t _size) BX_OVERRIDE
+ virtual int32_t read(void* _data, int32_t _size, Error* _err) BX_OVERRIDE
{
- return (int32_t)fread(_data, 1, _size, m_file);
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
+ int32_t size = (int32_t)fread(_data, 1, _size, m_file);
+ if (size != _size)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_READ, "CrtFileReader: read failed.");
+ return size >= 0 ? size : 0;
+ }
+
+ return size;
}
private:
@@ -548,24 +598,22 @@ namespace bx
{
}
- virtual int32_t open(const char* _filePath, bool _append = false) BX_OVERRIDE
+ virtual bool open(const char* _filePath, bool _append, Error* _err) BX_OVERRIDE
{
- if (_append)
- {
- m_file = fopen(_filePath, "ab");
- }
- else
+ m_file = fopen(_filePath, _append ? "ab" : "wb");
+
+ if (NULL == m_file)
{
- m_file = fopen(_filePath, "wb");
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_OPEN, "CrtFileWriter: Failed to open file.");
+ return false;
}
- return NULL == m_file;
+ return true;
}
- virtual int32_t close() BX_OVERRIDE
+ virtual void close() BX_OVERRIDE
{
fclose(m_file);
- return 0;
}
virtual int64_t seek(int64_t _offset = 0, Whence::Enum _whence = Whence::Current) BX_OVERRIDE
@@ -574,9 +622,18 @@ namespace bx
return ftello64(m_file);
}
- virtual int32_t write(const void* _data, int32_t _size) BX_OVERRIDE
+ virtual int32_t write(const void* _data, int32_t _size, Error* _err) BX_OVERRIDE
{
- return (int32_t)fwrite(_data, 1, _size, m_file);
+ BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
+
+ int32_t size = (int32_t)fwrite(_data, 1, _size, m_file);
+ if (size != _size)
+ {
+ BX_ERROR_SET(_err, BX_ERROR_READERWRITER_WRITE, "CrtFileWriter: write failed.");
+ return size >= 0 ? size : 0;
+ }
+
+ return size;
}
private:
diff --git a/3rdparty/bx/makefile b/3rdparty/bx/makefile
index 5f3455bdbff..685479b05d8 100644
--- a/3rdparty/bx/makefile
+++ b/3rdparty/bx/makefile
@@ -220,3 +220,8 @@ tools/bin/$(OS)/bin2c$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/bin2cRelease$(EXE)
$(SILENT) cp $(<) $(@)
tools: tools/bin/$(OS)/bin2c$(EXE)
+
+.build/$(BUILD_OUTPUT_DIR)/bin/bx.testRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
+ $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) bx.test config=$(BUILD_TOOLS_CONFIG)
+
+test: .build/$(BUILD_OUTPUT_DIR)/bin/bx.testRelease$(EXE)
diff --git a/3rdparty/bx/scripts/genie.lua b/3rdparty/bx/scripts/genie.lua
index 2399a70ce3d..580e3d66157 100644
--- a/3rdparty/bx/scripts/genie.lua
+++ b/3rdparty/bx/scripts/genie.lua
@@ -58,17 +58,18 @@ project "bx.test"
path.join(BX_DIR, "tests/**.H"),
}
- configuration { "vs*" }
+ configuration { "vs* or mingw*" }
+ links {
+ "psapi",
+ }
configuration { "android*" }
- kind "ConsoleApp"
targetextension ".so"
linkoptions {
"-shared",
}
configuration { "nacl or nacl-arm" }
- kind "ConsoleApp"
targetextension ".nexe"
links {
"ppapi",
@@ -76,7 +77,6 @@ project "bx.test"
}
configuration { "pnacl" }
- kind "ConsoleApp"
targetextension ".pexe"
links {
"ppapi",
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 4b616c24c2a..ad3a3e647e1 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -13,29 +13,30 @@ function toolchain(_buildDir, _libDir)
value = "GCC",
description = "Choose GCC flavor",
allowed = {
- { "android-arm", "Android - ARM" },
- { "android-mips", "Android - MIPS" },
- { "android-x86", "Android - x86" },
- { "asmjs", "Emscripten/asm.js" },
- { "freebsd", "FreeBSD" },
- { "linux-gcc", "Linux (GCC compiler)" },
- { "linux-gcc-5", "Linux (GCC-5 compiler)" },
- { "linux-clang", "Linux (Clang compiler)" },
- { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
- { "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
- { "ios-arm", "iOS - ARM" },
- { "ios-simulator", "iOS - Simulator" },
- { "tvos-arm64", "tvOS - ARM64" },
- { "tvos-simulator", "tvOS - Simulator" },
- { "mingw-gcc", "MinGW" },
- { "mingw-clang", "MinGW (clang compiler)" },
- { "nacl", "Native Client" },
- { "nacl-arm", "Native Client - ARM" },
- { "osx", "OSX" },
- { "pnacl", "Native Client - PNaCl" },
- { "ps4", "PS4" },
- { "qnx-arm", "QNX/Blackberry - ARM" },
- { "rpi", "RaspberryPi" },
+ { "android-arm", "Android - ARM" },
+ { "android-mips", "Android - MIPS" },
+ { "android-x86", "Android - x86" },
+ { "asmjs", "Emscripten/asm.js" },
+ { "freebsd", "FreeBSD" },
+ { "linux-gcc", "Linux (GCC compiler)" },
+ { "linux-gcc-5", "Linux (GCC-5 compiler)" },
+ { "linux-clang", "Linux (Clang compiler)" },
+ { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
+ { "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
+ { "linux-steamlink", "Steam Link" },
+ { "ios-arm", "iOS - ARM" },
+ { "ios-simulator", "iOS - Simulator" },
+ { "tvos-arm64", "tvOS - ARM64" },
+ { "tvos-simulator", "tvOS - Simulator" },
+ { "mingw-gcc", "MinGW" },
+ { "mingw-clang", "MinGW (clang compiler)" },
+ { "nacl", "Native Client" },
+ { "nacl-arm", "Native Client - ARM" },
+ { "osx", "OSX" },
+ { "pnacl", "Native Client - PNaCl" },
+ { "ps4", "PS4" },
+ { "qnx-arm", "QNX/Blackberry - ARM" },
+ { "rpi", "RaspberryPi" },
},
}
@@ -86,6 +87,11 @@ function toolchain(_buildDir, _libDir)
description = "Set tvOS target version (default: 9.0).",
}
+ newoption {
+ trigger = "with-dynamic-runtime",
+ description = "Dynamically link with the runtime rather than statically",
+ }
+
-- Avoid error when invoking genie --help.
if (_ACTION == nil) then return false end
@@ -157,7 +163,7 @@ function toolchain(_buildDir, _libDir)
elseif "asmjs" == _OPTIONS["gcc"] then
if not os.getenv("EMSCRIPTEN") then
- print("Set EMSCRIPTEN enviroment variables.")
+ print("Set EMSCRIPTEN enviroment variable.")
end
premake.gcc.cc = "$(EMSCRIPTEN)/emcc"
@@ -214,6 +220,16 @@ function toolchain(_buildDir, _libDir)
elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
+ elseif "linux-steamlink" == _OPTIONS["gcc"] then
+ if not os.getenv("MARVELL_SDK_PATH") then
+ print("Set MARVELL_SDK_PATH enviroment variable.")
+ end
+
+ premake.gcc.cc = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-gcc"
+ premake.gcc.cxx = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-g++"
+ premake.gcc.ar = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-ar"
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-steamlink"))
+
elseif "mingw-gcc" == _OPTIONS["gcc"] then
premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
@@ -231,7 +247,7 @@ function toolchain(_buildDir, _libDir)
elseif "nacl" == _OPTIONS["gcc"] then
if not os.getenv("NACL_SDK_ROOT") then
- print("Set NACL_SDK_ROOT enviroment variables.")
+ print("Set NACL_SDK_ROOT enviroment variable.")
end
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-"
@@ -249,7 +265,7 @@ function toolchain(_buildDir, _libDir)
elseif "nacl-arm" == _OPTIONS["gcc"] then
if not os.getenv("NACL_SDK_ROOT") then
- print("Set NACL_SDK_ROOT enviroment variables.")
+ print("Set NACL_SDK_ROOT enviroment variable.")
end
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-"
@@ -277,7 +293,7 @@ function toolchain(_buildDir, _libDir)
elseif "pnacl" == _OPTIONS["gcc"] then
if not os.getenv("NACL_SDK_ROOT") then
- print("Set NACL_SDK_ROOT enviroment variables.")
+ print("Set NACL_SDK_ROOT enviroment variable.")
end
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_pnacl/bin/pnacl-"
@@ -295,7 +311,7 @@ function toolchain(_buildDir, _libDir)
elseif "ps4" == _OPTIONS["gcc"] then
if not os.getenv("PS4_SDK_ROOT") then
- print("Set PS4_SDK_ROOT enviroment variables.")
+ print("Set PS4_SDK_ROOT enviroment variable.")
end
ps4Toolchain = "$(PS4_SDK_ROOT)/host_tools/bin/orbis-"
@@ -308,7 +324,7 @@ function toolchain(_buildDir, _libDir)
elseif "qnx-arm" == _OPTIONS["gcc"] then
if not os.getenv("QNX_HOST") then
- print("Set QNX_HOST enviroment variables.")
+ print("Set QNX_HOST enviroment variable.")
end
premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc"
@@ -376,8 +392,11 @@ function toolchain(_buildDir, _libDir)
end
end
+ if not _OPTIONS["with-dynamic-runtime"] then
+ flags { "StaticRuntime" }
+ end
+
flags {
- "StaticRuntime",
"NoPCH",
"NativeWChar",
"NoRTTI",
@@ -686,6 +705,30 @@ function toolchain(_buildDir, _libDir)
"-Wl,-z,now",
}
+ configuration { "linux-steamlink" }
+ targetdir (path.join(_buildDir, "steamlink/bin"))
+ objdir (path.join(_buildDir, "steamlink/obj"))
+ libdirs { path.join(_libDir, "lib/steamlink") }
+ includedirs { path.join(bxDir, "include/compat/linux") }
+ defines {
+ "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
+ }
+ buildoptions {
+ "-std=c++0x",
+ "-Wfatal-errors",
+ "-Wunused-value",
+ "-Wundef",
+ "-pthread",
+ "-marm",
+ "-mfloat-abi=hard",
+ "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
+ }
+ linkoptions {
+ "-static-libgcc",
+ "-static-libstdc++",
+ "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
+ }
+
configuration { "android-arm" }
targetdir (path.join(_buildDir, "android-arm/bin"))
objdir (path.join(_buildDir, "android-arm/obj"))
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index f7df2742735..f79dbd8456f 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index d22c9e96473..c3a323a0b1e 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index cb0d3e7d3df..7e62285f703 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/bin2c/bin2c.cpp b/3rdparty/bx/tools/bin2c/bin2c.cpp
index afdcaa65cdc..bdb92a4c04f 100644
--- a/3rdparty/bx/tools/bin2c/bin2c.cpp
+++ b/3rdparty/bx/tools/bin2c/bin2c.cpp
@@ -23,7 +23,7 @@ public:
{
}
- virtual int32_t write(const void* _data, int32_t _size) BX_OVERRIDE
+ virtual int32_t write(const void* _data, int32_t _size, bx::Error* /*_err*/ = NULL) BX_OVERRIDE
{
const char* data = (const char*)_data;
m_buffer.insert(m_buffer.end(), data, data+_size);
@@ -148,14 +148,14 @@ int main(int _argc, const char* _argv[])
size_t size = 0;
bx::CrtFileReader fr;
- if (0 == bx::open(&fr, filePath) )
+ if (bx::open(&fr, filePath) )
{
size = (size_t)bx::getSize(&fr);
data = malloc(size);
bx::read(&fr, data, size);
bx::CrtFileWriter fw;
- if (0 == bx::open(&fw, outFilePath) )
+ if (bx::open(&fw, outFilePath) )
{
Bin2cWriter writer(&fw, name);
bx::write(&writer, data, size);