summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples')
-rw-r--r--3rdparty/bgfx/examples/01-cubes/cubes.cpp4
-rw-r--r--3rdparty/bgfx/examples/01-cubes/makefile3
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/makefile2
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/metaballs.cpp11
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/makefile3
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/raymarch.cpp269
-rw-r--r--3rdparty/bgfx/examples/04-mesh/makefile3
-rw-r--r--3rdparty/bgfx/examples/04-mesh/mesh.cpp211
-rw-r--r--3rdparty/bgfx/examples/05-instancing/instancing.cpp287
-rw-r--r--3rdparty/bgfx/examples/05-instancing/makefile3
-rw-r--r--3rdparty/bgfx/examples/06-bump/bump.cpp4
-rw-r--r--3rdparty/bgfx/examples/06-bump/makefile3
-rw-r--r--3rdparty/bgfx/examples/07-callback/makefile3
-rw-r--r--3rdparty/bgfx/examples/08-update/makefile3
-rw-r--r--3rdparty/bgfx/examples/08-update/update.cpp6
-rw-r--r--3rdparty/bgfx/examples/09-hdr/hdr.cpp4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/makefile3
-rw-r--r--3rdparty/bgfx/examples/12-lod/lod.cpp4
-rw-r--r--3rdparty/bgfx/examples/12-lod/makefile3
-rw-r--r--3rdparty/bgfx/examples/13-stencil/makefile3
-rw-r--r--3rdparty/bgfx/examples/13-stencil/stencil.cpp13
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/makefile16
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp4
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/makefile3
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_main.sh6
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/makefile14
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp4
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/drawstress.cpp4
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/makefile2
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc143
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc19
-rw-r--r--3rdparty/bgfx/examples/18-ibl/ibl.cpp748
-rw-r--r--3rdparty/bgfx/examples/18-ibl/makefile3
-rw-r--r--3rdparty/bgfx/examples/18-ibl/screenshot.pngbin223941 -> 167265 bytes
-rw-r--r--3rdparty/bgfx/examples/18-ibl/uniforms.sh28
-rw-r--r--3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc8
-rw-r--r--3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc16
-rw-r--r--3rdparty/bgfx/examples/19-oit/makefile3
-rw-r--r--3rdparty/bgfx/examples/19-oit/oit.cpp570
-rw-r--r--3rdparty/bgfx/examples/20-nanovg/nanovg.cpp129
-rw-r--r--3rdparty/bgfx/examples/21-deferred/deferred.cpp4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/makefile2
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/makefile3
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/makefile3
-rw-r--r--3rdparty/bgfx/examples/25-c99/helloworld.c2
-rw-r--r--3rdparty/bgfx/examples/26-occlusion/occlusion.cpp4
-rw-r--r--3rdparty/bgfx/examples/27-terrain/makefile3
-rw-r--r--3rdparty/bgfx/examples/27-terrain/terrain.cpp15
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc78
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc26
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/makefile18
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/screenshot.pngbin0 -> 127897 bytes
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/uniforms.sh12
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/varying.def.sc7
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc21
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc19
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/wireframe.cpp566
-rw-r--r--3rdparty/bgfx/examples/assets/meshes/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.cpp44
-rw-r--r--3rdparty/bgfx/examples/common/bounds.cpp30
-rw-r--r--3rdparty/bgfx/examples/common/bounds.h3
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp1490
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/debugdraw.h117
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h73
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc19
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h168
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc35
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h70
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc13
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h110
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc18
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/makefile9
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/varying.def.sc8
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h107
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc13
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h195
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc16
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h127
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc15
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h148
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc16
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_noop.cpp (renamed from 3rdparty/bgfx/examples/common/entry/entry_qnx.cpp)4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h5
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp4
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.cpp7
-rw-r--r--3rdparty/bgfx/examples/common/font/makefile2
-rw-r--r--3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp4
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h77
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp5
-rw-r--r--3rdparty/bgfx/examples/common/imgui/makefile2
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/makefile2
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp1
-rw-r--r--3rdparty/bgfx/examples/common/shaderlib.sh16
-rw-r--r--3rdparty/bgfx/examples/makefile24
-rw-r--r--3rdparty/bgfx/examples/runtime/meshes/bunny.binbin974323 -> 2588410 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/meshes/hollowcube.binbin24144 -> 40281 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/meshes/orb.binbin1494272 -> 2485418 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.binbin2688 -> 3378 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.binbin831 -> 1366 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.binbin6534 -> 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.binbin6422 -> 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.binbin6070 -> 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.binbin5958 -> 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.binbin40071 -> 40071 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear.binbin10850 -> 10850 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin35715 -> 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.binbin3717 -> 3717 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_csm.binbin7206 -> 7206 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear.binbin3689 -> 3689 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin7094 -> 7094 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin5347 -> 5347 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lighting_vsm_omni.binbin5375 -> 5375 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_mesh.binbin0 -> 1555 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_wireframe.binbin0 -> 887 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.binbin991 -> 915 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.binbin674 -> 717 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_mesh.binbin0 -> 1017 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_wireframe.binbin0 -> 759 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.binbin1661 -> 1963 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.binbin560 -> 1023 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.binbin2730 -> 2730 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.binbin4511 -> 4511 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.binbin2726 -> 2726 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.binbin4475 -> 4475 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.binbin3776 -> 3776 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.binbin3780 -> 3780 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.binbin2690 -> 2690 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.binbin4379 -> 4379 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.binbin2686 -> 2686 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.binbin4423 -> 4423 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.binbin3748 -> 3748 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.binbin3732 -> 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.binbin7965 -> 7965 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.binbin8669 -> 8669 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.binbin2810 -> 2810 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.binbin4895 -> 4895 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.binbin2794 -> 2794 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin4831 -> 4831 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin3876 -> 3876 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.binbin3892 -> 3892 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.binbin0 -> 1020 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.binbin0 -> 568 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.binbin676 -> 632 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.binbin447 -> 486 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.binbin0 -> 668 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.binbin0 -> 544 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.binbin1167 -> 1332 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.binbin3319 -> 3490 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.binbin2627 -> 2798 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.binbin2008 -> 3507 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.binbin594 -> 1855 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.binbin371 -> 373 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.binbin318 -> 441 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm.binbin4207 -> 4213 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_csm.binbin10204 -> 10222 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear.binbin4251 -> 4257 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_csm.binbin10424 -> 10442 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_linear_omni.binbin7581 -> 7587 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_esm_omni.binbin7535 -> 7541 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard.binbin4079 -> 4085 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_csm.binbin9660 -> 9678 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear.binbin4111 -> 4117 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_csm.binbin9796 -> 9814 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_linear_omni.binbin7442 -> 7448 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_hard_omni.binbin7408 -> 7414 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf.binbin15670 -> 15736 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_csm.binbin63214 -> 63472 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear.binbin15721 -> 15787 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin63660 -> 63918 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin19262 -> 19317 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_pcf_omni.binbin19207 -> 19262 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm.binbin4633 -> 4635 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_csm.binbin12150 -> 12152 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear.binbin4677 -> 4679 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin12370 -> 12372 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin8009 -> 8011 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lighting_vsm_omni.binbin7963 -> 7965 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.binbin1708 -> 1746 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.binbin300 -> 302 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.binbin252 -> 254 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.binbin417 -> 421 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.binbin1708 -> 1746 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.binbin76 -> 165 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.binbin99 -> 173 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.binbin8588 -> 8652 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.binbin76 -> 165 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.binbin398 -> 400 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lighting.binbin2164 -> 2240 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lighting.binbin2486 -> 2562 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.binbin375 -> 519 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_mesh.binbin0 -> 1521 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_wireframe.binbin0 -> 759 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.binbin681 -> 671 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.binbin474 -> 633 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_mesh.binbin0 -> 745 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_wireframe.binbin0 -> 557 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.binbin1340 -> 1676 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.binbin3492 -> 3834 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.binbin2800 -> 3142 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.binbin1855 -> 3255 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.binbin511 -> 1708 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.binbin353 -> 355 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.binbin300 -> 413 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm.binbin3970 -> 3976 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_csm.binbin9822 -> 9840 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear.binbin4014 -> 4020 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_csm.binbin10042 -> 10060 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_linear_omni.binbin7225 -> 7231 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_esm_omni.binbin7179 -> 7185 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard.binbin3848 -> 3854 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_csm.binbin9302 -> 9320 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear.binbin3880 -> 3886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_csm.binbin9438 -> 9456 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_linear_omni.binbin7092 -> 7098 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_hard_omni.binbin7058 -> 7064 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf.binbin15057 -> 15123 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_csm.binbin61375 -> 61633 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear.binbin15102 -> 15168 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin61797 -> 62055 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin18518 -> 18573 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_pcf_omni.binbin18469 -> 18524 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm.binbin4371 -> 4373 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_csm.binbin11668 -> 11670 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear.binbin4415 -> 4417 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin11888 -> 11890 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin7628 -> 7630 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lighting_vsm_omni.binbin7582 -> 7584 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.binbin1581 -> 1619 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.binbin288 -> 290 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.binbin240 -> 242 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.binbin352 -> 356 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.binbin1581 -> 1619 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.binbin76 -> 157 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.binbin99 -> 165 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.binbin8222 -> 8286 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.binbin76 -> 157 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.binbin380 -> 382 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lighting.binbin2050 -> 2120 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lighting.binbin2308 -> 2378 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.binbin307 -> 438 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_mesh.binbin0 -> 1479 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_wireframe.binbin0 -> 707 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.binbin627 -> 623 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.binbin432 -> 591 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_mesh.binbin0 -> 685 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_wireframe.binbin0 -> 515 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.binbin2838 -> 4135 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.binbin1086 -> 2320 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.binbin750 -> 751 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.binbin933 -> 933 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.binbin683 -> 795 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.binbin933 -> 933 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.binbin4597 -> 4600 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.binbin11097 -> 11106 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.binbin4641 -> 4644 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.binbin11317 -> 11326 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.binbin7861 -> 7864 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.binbin7815 -> 7818 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.binbin4425 -> 4428 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.binbin10377 -> 10386 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.binbin4457 -> 4460 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.binbin10513 -> 10522 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.binbin7678 -> 7681 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.binbin7644 -> 7647 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.binbin16606 -> 16639 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.binbin66411 -> 66540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.binbin16555 -> 16588 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin66449 -> 66578 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin19991 -> 20011 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.binbin19940 -> 19960 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.binbin5037 -> 5038 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.binbin13099 -> 13100 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.binbin5081 -> 5082 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin13319 -> 13320 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin8303 -> 8304 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.binbin8257 -> 8258 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.binbin1045 -> 1045 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.binbin2840 -> 2859 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.binbin3934 -> 3934 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.binbin623 -> 624 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.binbin566 -> 567 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.binbin598 -> 598 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.binbin815 -> 817 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.binbin790 -> 790 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.binbin2840 -> 2859 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.binbin3934 -> 3934 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.binbin396 -> 477 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.binbin426 -> 492 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.binbin9729 -> 9729 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.binbin9605 -> 9637 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.binbin396 -> 477 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.binbin700 -> 701 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.binbin2345 -> 2415 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.binbin2745 -> 2815 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.binbin0 -> 541 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.binbin1846 -> 1855 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.binbin737 -> 868 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.binbin0 -> 1861 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.binbin0 -> 1099 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.binbin979 -> 975 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.binbin781 -> 962 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.binbin0 -> 721 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.binbin0 -> 1037 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.binbin0 -> 1058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.binbin0 -> 858 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/bolonga_irr.ddsbin0 -> 786580 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/bolonga_lod.ddsbin0 -> 4194436 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/ennis_irr.ddsbin393344 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/ennis_lod.ddsbin8388728 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/grace_irr.ddsbin393344 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/grace_lod.ddsbin8388728 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/kyoto_irr.ddsbin0 -> 786580 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/kyoto_lod.ddsbin0 -> 4194436 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/pisa_irr.ddsbin393344 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/pisa_lod.ddsbin8388728 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/uffizi_irr.ddsbin393344 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/uffizi_lod.ddsbin8388728 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/wells_irr.ddsbin393344 -> 0 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/wells_lod.ddsbin8388728 -> 0 bytes
336 files changed, 5216 insertions, 1137 deletions
diff --git a/3rdparty/bgfx/examples/01-cubes/cubes.cpp b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
index de74b89e6d0..bf88eb3f7f0 100644
--- a/3rdparty/bgfx/examples/01-cubes/cubes.cpp
+++ b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
@@ -55,7 +55,7 @@ static const uint16_t s_cubeIndices[36] =
6, 3, 7,
};
-class Cubes : public entry::AppI
+class ExampleCubes : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -218,4 +218,4 @@ class Cubes : public entry::AppI
int64_t m_timeOffset;
};
-ENTRY_IMPLEMENT_MAIN(Cubes);
+ENTRY_IMPLEMENT_MAIN(ExampleCubes);
diff --git a/3rdparty/bgfx/examples/01-cubes/makefile b/3rdparty/bgfx/examples/01-cubes/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/01-cubes/makefile
+++ b/3rdparty/bgfx/examples/01-cubes/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/02-metaballs/makefile b/3rdparty/bgfx/examples/02-metaballs/makefile
index 2d351e1d215..818fe30cbd7 100644
--- a/3rdparty/bgfx/examples/02-metaballs/makefile
+++ b/3rdparty/bgfx/examples/02-metaballs/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
index be919f56538..bedf55497eb 100644
--- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
+++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
@@ -462,16 +462,16 @@ uint32_t triangulate(uint8_t* _result, uint32_t _stride, const float* __restrict
#define DIMS 32
-class Metaballs : public entry::AppI
+class ExampleMetaballs : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
Args args(_argc, _argv);
- m_width = 1280;
+ m_width = 1280;
m_height = 720;
- m_debug = BGFX_DEBUG_TEXT;
- m_reset = BGFX_RESET_VSYNC;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
bgfx::init(args.m_type, args.m_pciId);
bgfx::reset(m_width, m_height, m_reset);
@@ -778,7 +778,6 @@ class Metaballs : public entry::AppI
Grid* m_grid;
int64_t m_timeOffset;
-
};
-ENTRY_IMPLEMENT_MAIN(Metaballs);
+ENTRY_IMPLEMENT_MAIN(ExampleMetaballs);
diff --git a/3rdparty/bgfx/examples/03-raymarch/makefile b/3rdparty/bgfx/examples/03-raymarch/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/03-raymarch/makefile
+++ b/3rdparty/bgfx/examples/03-raymarch/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
index df07fc7ea42..60a4664546e 100644
--- a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
+++ b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
@@ -102,138 +102,163 @@ void renderScreenSpaceQuad(uint32_t _view, bgfx::ProgramHandle _program, float _
}
}
-int _main_(int _argc, char** _argv)
+class ExampleRaymarch : public entry::AppI
{
- Args args(_argc, _argv);
-
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
-
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(width, height, reset);
-
- // Enable debug text.
- bgfx::setDebug(debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- // Setup root path for binary shaders. Shader binaries are different
- // for each renderer.
- switch (bgfx::getRendererType() )
+ void init(int _argc, char** _argv) BX_OVERRIDE
{
- default:
- break;
-
- case bgfx::RendererType::OpenGL:
- case bgfx::RendererType::OpenGLES:
- s_oglNdc = true;
- break;
+ Args args(_argc, _argv);
+
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
+
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Setup root path for binary shaders. Shader binaries are different
+ // for each renderer.
+ switch (bgfx::getRendererType() )
+ {
+ default:
+ break;
+
+ case bgfx::RendererType::OpenGL:
+ case bgfx::RendererType::OpenGLES:
+ s_oglNdc = true;
+ break;
+ }
+
+ // Create vertex stream declaration.
+ PosColorTexCoord0Vertex::init();
+
+ u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ u_lightDirTime = bgfx::createUniform("u_lightDirTime", bgfx::UniformType::Vec4);
+
+ // Create program from shaders.
+ m_program = loadProgram("vs_raymarching", "fs_raymarching");
+
+ m_timeOffset = bx::getHPCounter();
}
- // Create vertex stream declaration.
- PosColorTexCoord0Vertex::init();
+ int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ bgfx::destroyProgram(m_program);
- bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
- bgfx::UniformHandle u_lightDirTime = bgfx::createUniform("u_lightDirTime", bgfx::UniformType::Vec4);
+ bgfx::destroyUniform(u_mtx);
+ bgfx::destroyUniform(u_lightDirTime);
- // Create program from shaders.
- bgfx::ProgramHandle raymarching = loadProgram("vs_raymarching", "fs_raymarching");
+ // Shutdown bgfx.
+ bgfx::shutdown();
- int64_t timeOffset = bx::getHPCounter();
+ return 0;
+ }
- while (!entry::processEvents(width, height, debug, reset) )
+ bool update() BX_OVERRIDE
{
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
-
- // Set view 1 default viewport.
- bgfx::setViewRect(1, 0, 0, width, height);
-
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to viewZ 0.
- bgfx::touch(0);
-
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/03-raymarch");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Updating shader uniforms.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -15.0f };
-
- float view[16];
- float proj[16];
- bx::mtxLookAt(view, eye, at);
- mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
-
- // Set view and projection matrix for view 1.
- bgfx::setViewTransform(0, view, proj);
-
- float ortho[16];
- bx::mtxOrtho(ortho, 0.0f, 1280.0f, 720.0f, 0.0f, 0.0f, 100.0f);
-
- // Set view and projection matrix for view 0.
- bgfx::setViewTransform(1, NULL, ortho);
-
- float time = (float)( (bx::getHPCounter()-timeOffset)/double(bx::getHPFrequency() ) );
-
- float vp[16];
- bx::mtxMul(vp, view, proj);
-
- float mtx[16];
- bx::mtxRotateXY(mtx
- , time
- , time*0.37f
- );
-
- float mtxInv[16];
- bx::mtxInverse(mtxInv, mtx);
- float lightDirModel[4] = { -0.4f, -0.5f, -1.0f, 0.0f };
- float lightDirModelN[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
- bx::vec3Norm(lightDirModelN, lightDirModel);
- float lightDirTime[4];
- bx::vec4MulMtx(lightDirTime, lightDirModelN, mtxInv);
- lightDirTime[3] = time;
- bgfx::setUniform(u_lightDirTime, lightDirTime);
-
- float mvp[16];
- bx::mtxMul(mvp, mtx, vp);
-
- float invMvp[16];
- bx::mtxInverse(invMvp, mvp);
- bgfx::setUniform(u_mtx, invMvp);
-
- renderScreenSpaceQuad(1, raymarching, 0.0f, 0.0f, 1280.0f, 720.0f);
-
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
+ {
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+
+ // Set view 1 default viewport.
+ bgfx::setViewRect(1, 0, 0, m_width, m_height);
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to viewZ 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/03-raymarch");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Updating shader uniforms.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -15.0f };
+
+ float view[16];
+ float proj[16];
+ bx::mtxLookAt(view, eye, at);
+ mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+
+ // Set view and projection matrix for view 1.
+ bgfx::setViewTransform(0, view, proj);
+
+ float ortho[16];
+ bx::mtxOrtho(ortho, 0.0f, 1280.0f, 720.0f, 0.0f, 0.0f, 100.0f);
+
+ // Set view and projection matrix for view 0.
+ bgfx::setViewTransform(1, NULL, ortho);
+
+ float time = (float)( (bx::getHPCounter()-m_timeOffset)/double(bx::getHPFrequency() ) );
+
+ float vp[16];
+ bx::mtxMul(vp, view, proj);
+
+ float mtx[16];
+ bx::mtxRotateXY(mtx
+ , time
+ , time*0.37f
+ );
+
+ float mtxInv[16];
+ bx::mtxInverse(mtxInv, mtx);
+ float lightDirModel[4] = { -0.4f, -0.5f, -1.0f, 0.0f };
+ float lightDirModelN[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+ bx::vec3Norm(lightDirModelN, lightDirModel);
+ float lightDirTime[4];
+ bx::vec4MulMtx(lightDirTime, lightDirModelN, mtxInv);
+ lightDirTime[3] = time;
+ bgfx::setUniform(u_lightDirTime, lightDirTime);
+
+ float mvp[16];
+ bx::mtxMul(mvp, mtx, vp);
+
+ float invMvp[16];
+ bx::mtxInverse(invMvp, mvp);
+ bgfx::setUniform(u_mtx, invMvp);
+
+ renderScreenSpaceQuad(1, m_program, 0.0f, 0.0f, 1280.0f, 720.0f);
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
}
- // Cleanup.
- bgfx::destroyProgram(raymarching);
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- bgfx::destroyUniform(u_mtx);
- bgfx::destroyUniform(u_lightDirTime);
-
- // Shutdown bgfx.
- bgfx::shutdown();
+ int64_t m_timeOffset;
+ bgfx::UniformHandle u_mtx;
+ bgfx::UniformHandle u_lightDirTime;
+ bgfx::ProgramHandle m_program;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(ExampleRaymarch);
diff --git a/3rdparty/bgfx/examples/04-mesh/makefile b/3rdparty/bgfx/examples/04-mesh/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/04-mesh/makefile
+++ b/3rdparty/bgfx/examples/04-mesh/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/04-mesh/mesh.cpp b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
index 854cf1a23a3..bfe61df6a3f 100644
--- a/3rdparty/bgfx/examples/04-mesh/mesh.cpp
+++ b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
@@ -6,118 +6,143 @@
#include "common.h"
#include "bgfx_utils.h"
-int _main_(int _argc, char** _argv)
+class ExampleMesh : public entry::AppI
{
- Args args(_argc, _argv);
-
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ void init(int _argc, char** _argv) BX_OVERRIDE
+ {
+ Args args(_argc, _argv);
+
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(width, height, reset);
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
+ u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
- // Create program from shaders.
- bgfx::ProgramHandle program = loadProgram("vs_mesh", "fs_mesh");
+ // Create program from shaders.
+ m_program = loadProgram("vs_mesh", "fs_mesh");
- Mesh* mesh = meshLoad("meshes/bunny.bin");
+ m_mesh = meshLoad("meshes/bunny.bin");
- int64_t timeOffset = bx::getHPCounter();
+ m_timeOffset = bx::getHPCounter();
+ }
- while (!entry::processEvents(width, height, debug, reset) )
+ int shutdown() BX_OVERRIDE
{
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
-
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::touch(0);
-
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
- float time = (float)( (bx::getHPCounter()-timeOffset)/double(bx::getHPFrequency() ) );
- bgfx::setUniform(u_time, &time);
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/04-mesh");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Loading meshes.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- float at[3] = { 0.0f, 1.0f, 0.0f };
- float eye[3] = { 0.0f, 1.0f, -2.5f };
-
- // Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
- {
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
+ meshUnload(m_mesh);
- float proj[16];
- bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
+ // Cleanup.
+ bgfx::destroyProgram(m_program);
- bgfx::setViewTransform(0, view, proj);
+ bgfx::destroyUniform(u_time);
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
- }
- else
- {
- float view[16];
- bx::mtxLookAt(view, eye, at);
+ // Shutdown bgfx.
+ bgfx::shutdown();
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ return 0;
+ }
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
+ {
// Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+ float time = (float)( (bx::getHPCounter()-m_timeOffset)/double(bx::getHPFrequency() ) );
+ bgfx::setUniform(u_time, &time);
+
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/04-mesh");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Loading meshes.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ float at[3] = { 0.0f, 1.0f, 0.0f };
+ float eye[3] = { 0.0f, 1.0f, -2.5f };
+
+ // Set view and projection matrix for view 0.
+ const bgfx::HMD* hmd = bgfx::getHMD();
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ {
+ float view[16];
+ bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
+
+ float proj[16];
+ bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
+
+ bgfx::setViewTransform(0, view, proj);
+
+ // Set view 0 default viewport.
+ //
+ // Use HMD's width/height since HMD's internal frame buffer size
+ // might be much larger than window size.
+ bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ }
+ else
+ {
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
+
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ }
+
+ float mtx[16];
+ bx::mtxRotateXY(mtx
+ , 0.0f
+ , time*0.37f
+ );
+
+ meshSubmit(m_mesh, 0, m_program, mtx);
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
}
- float mtx[16];
- bx::mtxRotateXY(mtx
- , 0.0f
- , time*0.37f
- );
-
- meshSubmit(mesh, 0, program, mtx);
-
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- meshUnload(mesh);
-
- // Cleanup.
- bgfx::destroyProgram(program);
-
- bgfx::destroyUniform(u_time);
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- // Shutdown bgfx.
- bgfx::shutdown();
+ int64_t m_timeOffset;
+ Mesh* m_mesh;
+ bgfx::ProgramHandle m_program;
+ bgfx::UniformHandle u_time;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(ExampleMesh);
diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
index f0a62ea1039..6e854b20785 100644
--- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp
+++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
@@ -55,171 +55,196 @@ static const uint16_t s_cubeIndices[36] =
6, 3, 7,
};
-int _main_(int _argc, char** _argv)
+class ExampleInstancing : public entry::AppI
{
- Args args(_argc, _argv);
+ void init(int _argc, char** _argv) BX_OVERRIDE
+ {
+ Args args(_argc, _argv);
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(width, height, reset);
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
- // Get renderer capabilities info.
- const bgfx::Caps* caps = bgfx::getCaps();
+ // Create vertex stream declaration.
+ PosColorVertex::init();
- // Create vertex stream declaration.
- PosColorVertex::init();
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosColorVertex::ms_decl
+ );
- const bgfx::Memory* mem;
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(
+ bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) )
+ );
- // Create static vertex buffer.
- mem = bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) );
- bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(mem, PosColorVertex::ms_decl);
+ // Create program from shaders.
+ m_program = loadProgram("vs_instancing", "fs_instancing");
- // Create static index buffer.
- mem = bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) );
- bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(mem);
+ m_timeOffset = bx::getHPCounter();
+ }
- // Create program from shaders.
- bgfx::ProgramHandle program = loadProgram("vs_instancing", "fs_instancing");
+ int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ bgfx::destroyProgram(m_program);
- int64_t timeOffset = bx::getHPCounter();
+ // Shutdown bgfx.
+ bgfx::shutdown();
- while (!entry::processEvents(width, height, debug, reset) )
+ return 0;
+ }
+
+ bool update() BX_OVERRIDE
{
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
-
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::touch(0);
-
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
- float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) );
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/05-instancing");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Geometry instancing.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- // Check if instancing is supported.
- if (0 == (BGFX_CAPS_INSTANCING & caps->supported) )
- {
- // When instancing is not supported by GPU, implement alternative
- // code path that doesn't use instancing.
- bool blink = uint32_t(time*3.0f)&1;
- bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " Instancing is not supported by GPU. ");
- }
- else
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
{
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -35.0f };
-
- // Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+ float time = (float)( (now - m_timeOffset)/double(bx::getHPFrequency() ) );
+
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/05-instancing");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Geometry instancing.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ // Get renderer capabilities info.
+ const bgfx::Caps* caps = bgfx::getCaps();
+
+ // Check if instancing is supported.
+ if (0 == (BGFX_CAPS_INSTANCING & caps->supported) )
{
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-
- float proj[16];
- bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
-
- bgfx::setViewTransform(0, view, proj);
-
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ // When instancing is not supported by GPU, implement alternative
+ // code path that doesn't use instancing.
+ bool blink = uint32_t(time*3.0f)&1;
+ bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " Instancing is not supported by GPU. ");
}
else
{
- float view[16];
- bx::mtxLookAt(view, eye, at);
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -35.0f };
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ // Set view and projection matrix for view 0.
+ const bgfx::HMD* hmd = bgfx::getHMD();
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ {
+ float view[16];
+ bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
- }
+ float proj[16];
+ bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
- const uint16_t instanceStride = 80;
- const bgfx::InstanceDataBuffer* idb = bgfx::allocInstanceDataBuffer(121, instanceStride);
- if (NULL != idb)
- {
- uint8_t* data = idb->data;
+ bgfx::setViewTransform(0, view, proj);
+
+ // Set view 0 default viewport.
+ //
+ // Use HMD's width/height since HMD's internal frame buffer size
+ // might be much larger than window size.
+ bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ }
+ else
+ {
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
+
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ }
- // Write instance data for 11x11 cubes.
- for (uint32_t yy = 0, numInstances = 0; yy < 11 && numInstances < idb->num; ++yy)
+ const uint16_t instanceStride = 80;
+ const bgfx::InstanceDataBuffer* idb = bgfx::allocInstanceDataBuffer(121, instanceStride);
+ if (NULL != idb)
{
- for (uint32_t xx = 0; xx < 11 && numInstances < idb->num; ++xx, ++numInstances)
+ uint8_t* data = idb->data;
+
+ // Write instance data for 11x11 cubes.
+ for (uint32_t yy = 0, numInstances = 0; yy < 11 && numInstances < idb->num; ++yy)
{
- float* mtx = (float*)data;
- bx::mtxRotateXY(mtx, time + xx*0.21f, time + yy*0.37f);
- mtx[12] = -15.0f + float(xx)*3.0f;
- mtx[13] = -15.0f + float(yy)*3.0f;
- mtx[14] = 0.0f;
-
- float* color = (float*)&data[64];
- color[0] = sinf(time+float(xx)/11.0f)*0.5f+0.5f;
- color[1] = cosf(time+float(yy)/11.0f)*0.5f+0.5f;
- color[2] = sinf(time*3.0f)*0.5f+0.5f;
- color[3] = 1.0f;
-
- data += instanceStride;
+ for (uint32_t xx = 0; xx < 11 && numInstances < idb->num; ++xx, ++numInstances)
+ {
+ float* mtx = (float*)data;
+ bx::mtxRotateXY(mtx, time + xx*0.21f, time + yy*0.37f);
+ mtx[12] = -15.0f + float(xx)*3.0f;
+ mtx[13] = -15.0f + float(yy)*3.0f;
+ mtx[14] = 0.0f;
+
+ float* color = (float*)&data[64];
+ color[0] = sinf(time+float(xx)/11.0f)*0.5f+0.5f;
+ color[1] = cosf(time+float(yy)/11.0f)*0.5f+0.5f;
+ color[2] = sinf(time*3.0f)*0.5f+0.5f;
+ color[3] = 1.0f;
+
+ data += instanceStride;
+ }
}
- }
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
- // Set instance data buffer.
- bgfx::setInstanceDataBuffer(idb);
+ // Set instance data buffer.
+ bgfx::setInstanceDataBuffer(idb);
- // Set render states.
- bgfx::setState(BGFX_STATE_DEFAULT);
+ // Set render states.
+ bgfx::setState(BGFX_STATE_DEFAULT);
- // Submit primitive for rendering to view 0.
- bgfx::submit(0, program);
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
+ }
}
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+ return true;
}
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- // Cleanup.
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
- bgfx::destroyProgram(program);
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+ bgfx::ProgramHandle m_program;
- // Shutdown bgfx.
- bgfx::shutdown();
+ int64_t m_timeOffset;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(ExampleInstancing);
diff --git a/3rdparty/bgfx/examples/05-instancing/makefile b/3rdparty/bgfx/examples/05-instancing/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/05-instancing/makefile
+++ b/3rdparty/bgfx/examples/05-instancing/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/06-bump/bump.cpp b/3rdparty/bgfx/examples/06-bump/bump.cpp
index 2956caddf64..bc5f9e74b7e 100644
--- a/3rdparty/bgfx/examples/06-bump/bump.cpp
+++ b/3rdparty/bgfx/examples/06-bump/bump.cpp
@@ -103,7 +103,7 @@ static const uint16_t s_cubeIndices[36] =
21, 23, 22,
};
-class Bump : public entry::AppI
+class ExampleBump : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -387,4 +387,4 @@ class Bump : public entry::AppI
int64_t m_timeOffset;
};
-ENTRY_IMPLEMENT_MAIN(Bump);
+ENTRY_IMPLEMENT_MAIN(ExampleBump);
diff --git a/3rdparty/bgfx/examples/06-bump/makefile b/3rdparty/bgfx/examples/06-bump/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/06-bump/makefile
+++ b/3rdparty/bgfx/examples/06-bump/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/07-callback/makefile b/3rdparty/bgfx/examples/07-callback/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/07-callback/makefile
+++ b/3rdparty/bgfx/examples/07-callback/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/08-update/makefile b/3rdparty/bgfx/examples/08-update/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/08-update/makefile
+++ b/3rdparty/bgfx/examples/08-update/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp
index 8a5d851ba7c..baa54c17e20 100644
--- a/3rdparty/bgfx/examples/08-update/update.cpp
+++ b/3rdparty/bgfx/examples/08-update/update.cpp
@@ -115,10 +115,10 @@ static void updateTextureCubeRectBgra8(bgfx::TextureHandle _handle, uint8_t _sid
static const uint32_t m_textureside = 512;
static const uint32_t m_texture2dSize = 256;
-class Update : public entry::AppI
+class ExampleUpdate : public entry::AppI
{
public:
- Update()
+ ExampleUpdate()
: m_cube(m_textureside)
{
}
@@ -575,4 +575,4 @@ public:
};
-ENTRY_IMPLEMENT_MAIN(Update);
+ENTRY_IMPLEMENT_MAIN(ExampleUpdate);
diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
index 047fb0aa565..bee42aed2bf 100644
--- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp
+++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
@@ -139,7 +139,7 @@ inline float square(float _x)
return _x*_x;
}
-class HDR : public entry::AppI
+class ExampleHDR : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -561,4 +561,4 @@ class HDR : public entry::AppI
float m_time;
};
-ENTRY_IMPLEMENT_MAIN(HDR);
+ENTRY_IMPLEMENT_MAIN(ExampleHDR);
diff --git a/3rdparty/bgfx/examples/09-hdr/makefile b/3rdparty/bgfx/examples/09-hdr/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/09-hdr/makefile
+++ b/3rdparty/bgfx/examples/09-hdr/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/12-lod/lod.cpp b/3rdparty/bgfx/examples/12-lod/lod.cpp
index e133872494f..ef37d254c11 100644
--- a/3rdparty/bgfx/examples/12-lod/lod.cpp
+++ b/3rdparty/bgfx/examples/12-lod/lod.cpp
@@ -23,7 +23,7 @@ static const KnightPos knightTour[8*4] =
{7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3},
};
-class Lod : public entry::AppI
+class ExampleLod : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -316,4 +316,4 @@ class Lod : public entry::AppI
bool m_transitions;
};
-ENTRY_IMPLEMENT_MAIN(Lod);
+ENTRY_IMPLEMENT_MAIN(ExampleLod);
diff --git a/3rdparty/bgfx/examples/12-lod/makefile b/3rdparty/bgfx/examples/12-lod/makefile
index 536534d372e..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/12-lod/makefile
+++ b/3rdparty/bgfx/examples/12-lod/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2013 Milos Tosic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/13-stencil/makefile b/3rdparty/bgfx/examples/13-stencil/makefile
index 420d008a7f2..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/13-stencil/makefile
+++ b/3rdparty/bgfx/examples/13-stencil/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2013-2014 Dario Manesku. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
index 773bdda0b08..53d484e2137 100644
--- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp
+++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
@@ -9,7 +9,7 @@
#include "common.h"
#include "bgfx_utils.h"
-#include <bx/readerwriter.h>
+#include <bx/crtimpl.h>
#include "camera.h"
#include "imgui/imgui.h"
@@ -646,13 +646,12 @@ struct Group
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
}
struct Mesh
{
- void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexDecl _decl
- , const uint16_t* _indices, uint32_t _numIndices)
+ void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
{
Group group;
const bgfx::Memory* mem;
@@ -666,12 +665,6 @@ struct Mesh
mem = bgfx::makeRef(_indices, size);
group.m_ibh = bgfx::createIndexBuffer(mem);
- //TODO:
- // group.m_sphere = ...
- // group.m_aabb = ...
- // group.m_obb = ...
- // group.m_prims = ...
-
m_groups.push_back(group);
}
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/makefile b/3rdparty/bgfx/examples/14-shadowvolumes/makefile
index f101bb91427..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/makefile
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2013-2014 Dario Manesku. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -9,22 +9,10 @@ BUILD_DIR=../../.build
include $(BGFX_DIR)/scripts/shader.mk
-GEOMETRY_SRC= \
- bunny_patched \
- bunny_decimated \
- platform \
- cube
-
-GEOMETRY_BIN=$(addprefix $(RUNTIME_DIR)/meshes/, $(addsuffix .bin, $(basename $(GEOMETRY_SRC))))
-
-geometry: $(GEOMETRY_BIN)
-
-$(RUNTIME_DIR)/meshes/%.bin : %.obj
- $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1
-
rebuild:
@make -s --no-print-directory TARGET=0 clean all
@make -s --no-print-directory TARGET=1 clean all
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
index 4084359ba35..fbdc8804b02 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
@@ -21,11 +21,11 @@ using namespace std::tr1;
#include <bgfx/bgfx.h>
#include <bx/timer.h>
-#include <bx/readerwriter.h>
#include <bx/allocator.h>
#include <bx/hash.h>
#include <bx/float4_t.h>
#include <bx/fpumath.h>
+#include <bx/crtimpl.h>
#include "entry/entry.h"
#include "camera.h"
#include "imgui/imgui.h"
@@ -989,7 +989,7 @@ typedef std::vector<Group> GroupArray;
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
}
struct Mesh
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile b/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
index 420d008a7f2..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2013-2014 Dario Manesku. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_main.sh b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_main.sh
index acadba377b0..1b2b6be31a8 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_main.sh
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_main.sh
@@ -182,9 +182,9 @@
Shader shader = evalShader(lc.x, lc.y);
//Fog.
- const vec3 fogColor = vec3_splat(0.0);
- const float fogDensity = 0.0035;
- const float LOG2 = 1.442695;
+ vec3 fogColor = vec3_splat(0.0);
+ float fogDensity = 0.0035;
+ float LOG2 = 1.442695;
float z = length(v);
float fogFactor = clamp(1.0/exp2(fogDensity*fogDensity*z*z*LOG2), 0.0, 1.0);
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/makefile b/3rdparty/bgfx/examples/16-shadowmaps/makefile
index 547cea69a89..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/makefile
+++ b/3rdparty/bgfx/examples/16-shadowmaps/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2013-2014 Dario Manesku. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -9,20 +9,10 @@ BUILD_DIR=../../.build
include $(BGFX_DIR)/scripts/shader.mk
-GEOMETRY_SRC= \
- tree \
- hollowcube
-
-GEOMETRY_BIN=$(addprefix $(RUNTIME_DIR)/meshes/, $(addsuffix .bin, $(basename $(GEOMETRY_SRC))))
-
-geometry: $(GEOMETRY_BIN)
-
-$(RUNTIME_DIR)/meshes/%.bin : %.obj
- $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1
-
rebuild:
@make -s --no-print-directory TARGET=0 clean all
@make -s --no-print-directory TARGET=1 clean all
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
index 1e8ddaee339..3296496b018 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
+++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
@@ -12,8 +12,8 @@
#include <bgfx/bgfx.h>
#include <bx/timer.h>
-#include <bx/readerwriter.h>
#include <bx/fpumath.h>
+#include <bx/crtimpl.h>
#include "entry/entry.h"
#include "camera.h"
#include "imgui/imgui.h"
@@ -856,7 +856,7 @@ struct Group
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
}
struct Mesh
diff --git a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
index 258c00b5197..2e933c1cb9d 100644
--- a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
+++ b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
@@ -70,7 +70,7 @@ static const int64_t highwm = 1000000/65;
static const int64_t lowwm = 1000000/57;
#endif // BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_NACL
-class DrawStress : public entry::AppI
+class ExampleDrawStress : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -350,4 +350,4 @@ class DrawStress : public entry::AppI
bgfx::IndexBufferHandle m_ibh;
};
-ENTRY_IMPLEMENT_MAIN(DrawStress);
+ENTRY_IMPLEMENT_MAIN(ExampleDrawStress);
diff --git a/3rdparty/bgfx/examples/17-drawstress/makefile b/3rdparty/bgfx/examples/17-drawstress/makefile
index 2d351e1d215..818fe30cbd7 100644
--- a/3rdparty/bgfx/examples/17-drawstress/makefile
+++ b/3rdparty/bgfx/examples/17-drawstress/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
index 3ac5278f44f..28aa831331f 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
@@ -1,77 +1,110 @@
$input v_view, v_normal
/*
- * Copyright 2014 Dario Manesku. All rights reserved.
+ * Copyright 2014-2016 Dario Manesku. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
-
-uniform vec4 u_params;
-uniform mat4 u_mtx;
-uniform vec4 u_flags;
-uniform vec4 u_rgbDiff;
-uniform vec4 u_rgbSpec;
+#include "uniforms.sh"
SAMPLERCUBE(s_texCube, 0);
SAMPLERCUBE(s_texCubeIrr, 1);
-#define u_glossiness u_params.x
-#define u_exposure u_params.y
-#define u_diffspec u_params.z
-
-#define u_doDiffuse u_flags.x
-#define u_doSpecular u_flags.y
-#define u_doDiffuseIbl u_flags.z
-#define u_doSpecularIbl u_flags.w
-
-vec3 fresnel(vec3 _cspec, float _dot)
+vec3 calcFresnel(vec3 _cspec, float _dot)
{
- return _cspec + (1.0 - _cspec) * pow(1.0 - _dot, 5);
+ return _cspec + (1.0 - _cspec)*pow(1.0 - _dot, 5.0);
}
-void main()
+vec3 calcLambert(vec3 _cdiff, float _ndotl)
{
- vec3 light = vec3(0.0, 0.0, -1.0);
- vec3 clight = vec3(1.0, 1.0, 1.0);
-
- vec3 v = v_view;
- vec3 n = normalize(v_normal);
- vec3 l = normalize(light);
- vec3 h = normalize(v + l);
-
- float ndotl = clamp(dot(n, l), 0.0, 1.0); //diff
- float ndoth = clamp(dot(n, h), 0.0, 1.0); //spec
- float vdoth = clamp(dot(v, h), 0.0, 1.0); //spec fresnel
- float ndotv = clamp(dot(n, v), 0.0, 1.0); //env spec fresnel
-
- vec3 r = 2.0*ndotv*n - v; // reflect(v, n);
-
- vec3 cubeR = normalize(mul(u_mtx, vec4(r, 0.0)).xyz);
- vec3 cubeN = normalize(mul(u_mtx, vec4(n, 0.0)).xyz);
-
- float mipLevel = min((1.0 - u_glossiness)*11.0 + 1.0, 8.0);
- vec3 cenv = textureCubeLod(s_texCube, cubeR, mipLevel).xyz;
-
- vec3 kd = u_rgbDiff.xyz;
- vec3 ks = u_rgbSpec.xyz;
-
- vec3 cs = ks * u_diffspec;
- vec3 cd = kd * (1.0 - cs);
-
- vec3 diff = cd;
- float pwr = exp2(u_glossiness * 11.0 + 1.0);
- vec3 spec = cs * pow(ndoth, pwr) * ( (pwr + 8.0)/8.0) * fresnel(cs, vdoth);
+ return _cdiff*_ndotl;
+}
- vec3 ambspec = fresnel(cs, ndotv) * cenv;
- vec3 ambdiff = cd * textureCube(s_texCubeIrr, cubeN).xyz;
+vec3 calcBlinn(vec3 _cspec, float _ndoth, float _ndotl, float _specPwr)
+{
+ float norm = (_specPwr+8.0)*0.125;
+ float brdf = pow(_ndoth, _specPwr)*_ndotl*norm;
+ return _cspec*brdf;
+}
- vec3 lc = ( diff * u_doDiffuse + spec * u_doSpecular ) * ndotl * clight;
- vec3 ec = (ambdiff * u_doDiffuseIbl + ambspec * u_doSpecularIbl);
+float specPwr(float _gloss)
+{
+ return exp2(10.0*_gloss+2.0);
+}
- vec3 color = lc + ec;
+void main()
+{
+ // Light.
+ vec3 ld = normalize(u_lightDir);
+ vec3 clight = u_lightCol;
+
+ // Input.
+ vec3 nn = normalize(v_normal);
+ vec3 vv = normalize(v_view);
+ vec3 hh = normalize(vv + ld);
+
+ float ndotv = clamp(dot(nn, vv), 0.0, 1.0);
+ float ndotl = clamp(dot(nn, ld), 0.0, 1.0);
+ float ndoth = clamp(dot(nn, hh), 0.0, 1.0);
+ float hdotv = clamp(dot(hh, vv), 0.0, 1.0);
+
+ // Material params.
+ vec3 albedo = u_rgbDiff.xyz;
+ float reflectivity = u_reflectivity;
+ float gloss = u_glossiness;
+
+ // Reflection.
+ vec3 refl;
+ if (0.0 == u_metalOrSpec) // Metalness workflow.
+ {
+ refl = mix(vec3_splat(0.04), albedo, reflectivity);
+ }
+ else // Specular workflow.
+ {
+ refl = u_rgbSpec.xyz * vec3_splat(reflectivity);
+ }
+ vec3 dirF0 = calcFresnel(refl, hdotv);
+ vec3 envF0 = calcFresnel(refl, ndotv);
+
+ // Direct lighting.
+ vec3 dirSpec = dirF0;
+ vec3 dirDiff = albedo * 1.0-dirF0;
+
+ vec3 lambert = u_doDiffuse * calcLambert(dirDiff, ndotl);
+ vec3 blinn = u_doSpecular * calcBlinn(dirSpec, ndoth, ndotl, specPwr(gloss));
+ vec3 direct = (lambert + blinn)*clight;
+
+ // Indirect lighting.
+ vec3 envSpec = envF0;
+ vec3 envDiff = albedo * 1.0-envF0;
+
+ // Note: Environment textures are filtered with cmft: https://github.com/dariomanesku/cmft
+ // Params used:
+ // --excludeBase true //!< First level mip is not filtered.
+ // --mipCount 7 //!< 7 mip levels are used in total, [256x256 .. 4x4]. Lower res mip maps should be avoided.
+ // --glossScale 10 //!< Spec power scale. See: specPwr().
+ // --glossBias 2 //!< Spec power bias. See: specPwr().
+ // --edgeFixup warp //!< This must be used on DirectX9. When fileted with 'warp', fixCubeLookup() should be used.
+ float mip = 1.0 + 5.0*(1.0 - gloss); // Use mip levels [1..6] for radiance.
+
+ mat4 mtx;
+ mtx[0] = u_mtx0;
+ mtx[1] = u_mtx1;
+ mtx[2] = u_mtx2;
+ mtx[3] = u_mtx3;
+ vec3 vr = 2.0*ndotv*nn - vv; // Same as: -reflect(vv, nn);
+ vec3 cubeR = normalize(instMul(mtx, vec4(vr, 0.0)).xyz);
+ vec3 cubeN = normalize(instMul(mtx, vec4(nn, 0.0)).xyz);
+ cubeR = fixCubeLookup(cubeR, mip, 256.0);
+
+ vec3 radiance = u_doDiffuseIbl * envSpec * toLinear(textureCubeLod(s_texCube, cubeR, mip).xyz);
+ vec3 irradiance = u_doSpecularIbl * envDiff * toLinear(textureCube(s_texCubeIrr, cubeN).xyz);
+ vec3 indirect = radiance + irradiance;
+
+ // Color.
+ vec3 color = direct + indirect;
color = color * exp2(u_exposure);
-
gl_FragColor.xyz = toFilmic(color);
gl_FragColor.w = 1.0;
}
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
index 790fc0144fc..d895037b26a 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
@@ -1,22 +1,31 @@
$input v_dir
/*
- * Copyright 2014 Dario Manesku. All rights reserved.
+ * Copyright 2014-2016 Dario Manesku. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
+#include "uniforms.sh"
SAMPLERCUBE(s_texCube, 0);
-
-uniform vec4 u_params;
-#define u_exposure u_params.y
+SAMPLERCUBE(s_texCubeIrr, 1);
void main()
{
vec3 dir = normalize(v_dir);
- vec4 color = textureCubeLod(s_texCube, dir, 0.0);
+ vec4 color;
+ if (u_bgType == 7.0)
+ {
+ color = toLinear(textureCube(s_texCubeIrr, dir));
+ }
+ else
+ {
+ float lod = u_bgType;
+ dir = fixCubeLookup(dir, lod, 256.0);
+ color = toLinear(textureCubeLod(s_texCube, dir, lod));
+ }
color *= exp2(u_exposure);
gl_FragColor = toFilmic(color);
diff --git a/3rdparty/bgfx/examples/18-ibl/ibl.cpp b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
index 51a194730e4..a0cf6268d9c 100644
--- a/3rdparty/bgfx/examples/18-ibl/ibl.cpp
+++ b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 Dario Manesku. All rights reserved.
+ * Copyright 2014-2016 Dario Manesku. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -18,86 +18,51 @@ static float s_texelHalf = 0.0f;
struct Uniforms
{
- void init()
- {
- m_time = 0.0f;
- bx::mtxIdentity(m_mtx);
-
- u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
- u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
- u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Vec4);
- u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Vec4);
- u_rgbDiff = bgfx::createUniform("u_rgbDiff", bgfx::UniformType::Vec4);
- u_rgbSpec = bgfx::createUniform("u_rgbSpec", bgfx::UniformType::Vec4);
- }
+ enum { NumVec4 = 12 };
- // Call this once per frame.
- void submitPerFrameUniforms()
+ void init()
{
- bgfx::setUniform(u_mtx, m_mtx);
- bgfx::setUniform(u_flags, m_flags);
- bgfx::setUniform(u_camPos, m_camPosTime);
- bgfx::setUniform(u_rgbDiff, m_rgbDiff);
- bgfx::setUniform(u_rgbSpec, m_rgbSpec);
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, NumVec4);
}
- // Call this before each draw call.
- void submitPerDrawUniforms()
+ void submit()
{
- bgfx::setUniform(u_params, m_params);
+ bgfx::setUniform(u_params, m_params, NumVec4);
}
void destroy()
{
- bgfx::destroyUniform(u_rgbSpec);
- bgfx::destroyUniform(u_rgbDiff);
- bgfx::destroyUniform(u_camPos);
- bgfx::destroyUniform(u_flags);
bgfx::destroyUniform(u_params);
- bgfx::destroyUniform(u_mtx);
}
union
{
struct
{
- float m_glossiness;
- float m_exposure;
- float m_diffspec;
- float m_time;
- };
-
- float m_params[4];
- };
-
- union
- {
- struct
- {
- float m_diffuse;
- float m_specular;
- float m_diffuseIbl;
- float m_specularIbl;
+ union
+ {
+ float m_mtx[16];
+ /* 0*/ struct { float m_mtx0[4]; };
+ /* 1*/ struct { float m_mtx1[4]; };
+ /* 2*/ struct { float m_mtx2[4]; };
+ /* 3*/ struct { float m_mtx3[4]; };
+ };
+ /* 4*/ struct { float m_glossiness, m_reflectivity, m_exposure, m_bgType; };
+ /* 5*/ struct { float m_metalOrSpec, m_unused5[3]; };
+ /* 6*/ struct { float m_doDiffuse, m_doSpecular, m_doDiffuseIbl, m_doSpecularIbl; };
+ /* 7*/ struct { float m_cameraPos[3], m_unused7[1]; };
+ /* 8*/ struct { float m_rgbDiff[4]; };
+ /* 9*/ struct { float m_rgbSpec[4]; };
+ /*10*/ struct { float m_lightDir[3], m_unused10[1]; };
+ /*11*/ struct { float m_lightCol[3], m_unused11[1]; };
};
- float m_flags[4];
+ float m_params[NumVec4*4];
};
- float m_mtx[16];
- float m_camPosTime[4];
- float m_rgbDiff[4];
- float m_rgbSpec[4];
-
- bgfx::UniformHandle u_mtx;
bgfx::UniformHandle u_params;
- bgfx::UniformHandle u_flags;
- bgfx::UniformHandle u_camPos;
- bgfx::UniformHandle u_rgbDiff;
- bgfx::UniformHandle u_rgbSpec;
};
-static Uniforms s_uniforms;
-
struct PosColorTexCoord0Vertex
{
float m_x;
@@ -181,11 +146,8 @@ struct LightProbe
{
enum Enum
{
- Wells,
- Uffizi,
- Pisa,
- Ennis,
- Grace,
+ Bolonga,
+ Kyoto,
Count
};
@@ -213,6 +175,253 @@ struct LightProbe
bgfx::TextureHandle m_texIrr;
};
+struct Camera
+{
+ Camera()
+ {
+ reset();
+ }
+
+ void reset()
+ {
+ m_target.curr[0] = 0.0f;
+ m_target.curr[1] = 0.0f;
+ m_target.curr[2] = 0.0f;
+ m_target.dest[0] = 0.0f;
+ m_target.dest[1] = 0.0f;
+ m_target.dest[2] = 0.0f;
+
+ m_pos.curr[0] = 0.0f;
+ m_pos.curr[1] = 0.0f;
+ m_pos.curr[2] = -3.0f;
+ m_pos.dest[0] = 0.0f;
+ m_pos.dest[1] = 0.0f;
+ m_pos.dest[2] = -3.0f;
+
+ m_orbit[0] = 0.0f;
+ m_orbit[1] = 0.0f;
+ }
+
+ void mtxLookAt(float* _outViewMtx)
+ {
+ bx::mtxLookAt(_outViewMtx, m_pos.curr, m_target.curr);
+ }
+
+ void orbit(float _dx, float _dy)
+ {
+ m_orbit[0] += _dx;
+ m_orbit[1] += _dy;
+ }
+
+ void dolly(float _dz)
+ {
+ const float cnear = 1.0f;
+ const float cfar = 10.0f;
+
+ const float toTarget[3] =
+ {
+ m_target.dest[0] - m_pos.dest[0],
+ m_target.dest[1] - m_pos.dest[1],
+ m_target.dest[2] - m_pos.dest[2],
+ };
+ const float toTargetLen = bx::vec3Length(toTarget);
+ const float invToTargetLen = 1.0f/(toTargetLen+FLT_MIN);
+ const float toTargetNorm[3] =
+ {
+ toTarget[0]*invToTargetLen,
+ toTarget[1]*invToTargetLen,
+ toTarget[2]*invToTargetLen,
+ };
+
+ float delta = toTargetLen*_dz;
+ float newLen = toTargetLen + delta;
+ if ( (cnear < newLen || _dz < 0.0f)
+ && (newLen < cfar || _dz > 0.0f) )
+ {
+ m_pos.dest[0] += toTargetNorm[0]*delta;
+ m_pos.dest[1] += toTargetNorm[1]*delta;
+ m_pos.dest[2] += toTargetNorm[2]*delta;
+ }
+ }
+
+ void consumeOrbit(float _amount)
+ {
+ float consume[2];
+ consume[0] = m_orbit[0]*_amount;
+ consume[1] = m_orbit[1]*_amount;
+ m_orbit[0] -= consume[0];
+ m_orbit[1] -= consume[1];
+
+ const float toPos[3] =
+ {
+ m_pos.curr[0] - m_target.curr[0],
+ m_pos.curr[1] - m_target.curr[1],
+ m_pos.curr[2] - m_target.curr[2],
+ };
+ const float toPosLen = bx::vec3Length(toPos);
+ const float invToPosLen = 1.0f/(toPosLen+FLT_MIN);
+ const float toPosNorm[3] =
+ {
+ toPos[0]*invToPosLen,
+ toPos[1]*invToPosLen,
+ toPos[2]*invToPosLen,
+ };
+
+ float ll[2];
+ latLongFromVec(ll[0], ll[1], toPosNorm);
+ ll[0] += consume[0];
+ ll[1] -= consume[1];
+ ll[1] = bx::fclamp(ll[1], 0.02f, 0.98f);
+
+ float tmp[3];
+ vecFromLatLong(tmp, ll[0], ll[1]);
+
+ float diff[3];
+ diff[0] = (tmp[0]-toPosNorm[0])*toPosLen;
+ diff[1] = (tmp[1]-toPosNorm[1])*toPosLen;
+ diff[2] = (tmp[2]-toPosNorm[2])*toPosLen;
+
+ m_pos.curr[0] += diff[0];
+ m_pos.curr[1] += diff[1];
+ m_pos.curr[2] += diff[2];
+ m_pos.dest[0] += diff[0];
+ m_pos.dest[1] += diff[1];
+ m_pos.dest[2] += diff[2];
+ }
+
+ void update(float _dt)
+ {
+ const float amount = bx::fmin(_dt/0.12f, 1.0f);
+
+ consumeOrbit(amount);
+
+ m_target.curr[0] = bx::flerp(m_target.curr[0], m_target.dest[0], amount);
+ m_target.curr[1] = bx::flerp(m_target.curr[1], m_target.dest[1], amount);
+ m_target.curr[2] = bx::flerp(m_target.curr[2], m_target.dest[2], amount);
+ m_pos.curr[0] = bx::flerp(m_pos.curr[0], m_pos.dest[0], amount);
+ m_pos.curr[1] = bx::flerp(m_pos.curr[1], m_pos.dest[1], amount);
+ m_pos.curr[2] = bx::flerp(m_pos.curr[2], m_pos.dest[2], amount);
+ }
+
+ void envViewMtx(float* _mtx)
+ {
+ const float toTarget[3] =
+ {
+ m_target.curr[0] - m_pos.curr[0],
+ m_target.curr[1] - m_pos.curr[1],
+ m_target.curr[2] - m_pos.curr[2],
+ };
+
+ const float toTargetLen = bx::vec3Length(toTarget);
+ const float invToTargetLen = 1.0f/(toTargetLen+FLT_MIN);
+ const float toTargetNorm[3] =
+ {
+ toTarget[0]*invToTargetLen,
+ toTarget[1]*invToTargetLen,
+ toTarget[2]*invToTargetLen,
+ };
+
+ float tmp[3];
+ const float fakeUp[3] = { 0.0f, 1.0f, 0.0f };
+
+ float right[3];
+ bx::vec3Cross(tmp, fakeUp, toTargetNorm);
+ bx::vec3Norm(right, tmp);
+
+ float up[3];
+ bx::vec3Cross(tmp, toTargetNorm, right);
+ bx::vec3Norm(up, tmp);
+
+ _mtx[ 0] = right[0];
+ _mtx[ 1] = right[1];
+ _mtx[ 2] = right[2];
+ _mtx[ 3] = 0.0f;
+ _mtx[ 4] = up[0];
+ _mtx[ 5] = up[1];
+ _mtx[ 6] = up[2];
+ _mtx[ 7] = 0.0f;
+ _mtx[ 8] = toTargetNorm[0];
+ _mtx[ 9] = toTargetNorm[1];
+ _mtx[10] = toTargetNorm[2];
+ _mtx[11] = 0.0f;
+ _mtx[12] = 0.0f;
+ _mtx[13] = 0.0f;
+ _mtx[14] = 0.0f;
+ _mtx[15] = 1.0f;
+ }
+
+ static inline void vecFromLatLong(float _vec[3], float _u, float _v)
+ {
+ const float phi = _u * 2.0f*bx::pi;
+ const float theta = _v * bx::pi;
+
+ const float st = bx::fsin(theta);
+ const float sp = bx::fsin(phi);
+ const float ct = bx::fcos(theta);
+ const float cp = bx::fcos(phi);
+
+ _vec[0] = -st*sp;
+ _vec[1] = ct;
+ _vec[2] = -st*cp;
+ }
+
+ static inline void latLongFromVec(float& _u, float& _v, const float _vec[3])
+ {
+ const float phi = atan2f(_vec[0], _vec[2]);
+ const float theta = acosf(_vec[1]);
+
+ _u = (bx::pi + phi)*bx::invPi*0.5f;
+ _v = theta*bx::invPi;
+ }
+
+ struct Interp3f
+ {
+ float curr[3];
+ float dest[3];
+ };
+
+ Interp3f m_target;
+ Interp3f m_pos;
+ float m_orbit[2];
+};
+
+struct Mouse
+{
+ Mouse()
+ : m_dx(0.0f)
+ , m_dy(0.0f)
+ , m_prevMx(0.0f)
+ , m_prevMy(0.0f)
+ , m_scroll(0)
+ , m_scrollPrev(0)
+ {
+ }
+
+ void update(float _mx, float _my, int32_t _mz, uint32_t _width, uint32_t _height)
+ {
+ const float widthf = float(int32_t(_width));
+ const float heightf = float(int32_t(_height));
+
+ // Delta movement.
+ m_dx = float(_mx - m_prevMx)/widthf;
+ m_dy = float(_my - m_prevMy)/heightf;
+
+ m_prevMx = _mx;
+ m_prevMy = _my;
+
+ // Scroll.
+ m_scroll = _mz - m_scrollPrev;
+ m_scrollPrev = _mz;
+ }
+
+ float m_dx; // Screen space.
+ float m_dy;
+ float m_prevMx;
+ float m_prevMy;
+ int32_t m_scroll;
+ int32_t m_scrollPrev;
+};
+
int _main_(int _argc, char** _argv)
{
Args args(_argc, _argv);
@@ -220,7 +429,10 @@ int _main_(int _argc, char** _argv)
uint32_t width = 1280;
uint32_t height = 720;
uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ uint32_t reset = 0
+ | BGFX_RESET_VSYNC
+ | BGFX_RESET_MSAA_X16
+ ;
bgfx::init(args.m_type, args.m_pciId);
bgfx::reset(width, height, reset);
@@ -240,18 +452,16 @@ int _main_(int _argc, char** _argv)
imguiCreate();
// Uniforms.
- s_uniforms.init();
+ Uniforms uniforms;
+ uniforms.init();
// Vertex declarations.
PosColorTexCoord0Vertex::init();
LightProbe lightProbes[LightProbe::Count];
- lightProbes[LightProbe::Wells ].load("wells");
- lightProbes[LightProbe::Uffizi].load("uffizi");
- lightProbes[LightProbe::Pisa ].load("pisa");
- lightProbes[LightProbe::Ennis ].load("ennis");
- lightProbes[LightProbe::Grace ].load("grace");
- LightProbe::Enum currentLightProbe = LightProbe::Wells;
+ lightProbes[LightProbe::Bolonga].load("bolonga");
+ lightProbes[LightProbe::Kyoto ].load("kyoto");
+ LightProbe::Enum currentLightProbe = LightProbe::Bolonga;
bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
@@ -266,43 +476,73 @@ int _main_(int _argc, char** _argv)
Mesh* meshBunny;
meshBunny = meshLoad("meshes/bunny.bin");
+ Mesh* meshOrb;
+ meshOrb = meshLoad("meshes/orb.bin");
+
+ Camera camera;
+ Mouse mouse;
+
struct Settings
{
- float m_speed;
+ Settings()
+ {
+ m_envRotCurr = 0.0f;
+ m_envRotDest = 0.0f;
+ m_lightDir[0] = -0.8f;
+ m_lightDir[1] = 0.2f;
+ m_lightDir[2] = -0.5f;
+ m_lightCol[0] = 1.0f;
+ m_lightCol[1] = 1.0f;
+ m_lightCol[2] = 1.0f;
+ m_glossiness = 0.7f;
+ m_exposure = 0.0f;
+ m_bgType = 3.0f;
+ m_radianceSlider = 2.0f;
+ m_reflectivity = 0.85f;
+ m_rgbDiff[0] = 1.0f;
+ m_rgbDiff[1] = 1.0f;
+ m_rgbDiff[2] = 1.0f;
+ m_rgbSpec[0] = 1.0f;
+ m_rgbSpec[1] = 1.0f;
+ m_rgbSpec[2] = 1.0f;
+ m_lod = 0.0f;
+ m_doDiffuse = false;
+ m_doSpecular = false;
+ m_doDiffuseIbl = true;
+ m_doSpecularIbl = true;
+ m_showLightColorWheel = true;
+ m_showDiffColorWheel = true;
+ m_showSpecColorWheel = true;
+ m_metalOrSpec = 0;
+ m_meshSelection = 0;
+ m_crossCubemapPreview = ImguiCubemap::Latlong;
+ }
+
+ float m_envRotCurr;
+ float m_envRotDest;
+ float m_lightDir[3];
+ float m_lightCol[3];
float m_glossiness;
float m_exposure;
- float m_diffspec;
+ float m_radianceSlider;
+ float m_bgType;
+ float m_reflectivity;
float m_rgbDiff[3];
float m_rgbSpec[3];
- bool m_diffuse;
- bool m_specular;
- bool m_diffuseIbl;
- bool m_specularIbl;
+ float m_lod;
+ bool m_doDiffuse;
+ bool m_doSpecular;
+ bool m_doDiffuseIbl;
+ bool m_doSpecularIbl;
+ bool m_showLightColorWheel;
bool m_showDiffColorWheel;
bool m_showSpecColorWheel;
+ uint8_t m_metalOrSpec;
+ uint8_t m_meshSelection;
ImguiCubemap::Enum m_crossCubemapPreview;
};
Settings settings;
- settings.m_speed = 0.37f;
- settings.m_glossiness = 1.0f;
- settings.m_exposure = 0.0f;
- settings.m_diffspec = 0.65f;
- settings.m_rgbDiff[0] = 0.2f;
- settings.m_rgbDiff[1] = 0.2f;
- settings.m_rgbDiff[2] = 0.2f;
- settings.m_rgbSpec[0] = 1.0f;
- settings.m_rgbSpec[1] = 1.0f;
- settings.m_rgbSpec[2] = 1.0f;
- settings.m_diffuse = true;
- settings.m_specular = true;
- settings.m_diffuseIbl = true;
- settings.m_specularIbl = true;
- settings.m_showDiffColorWheel = true;
- settings.m_showSpecColorWheel = false;
- settings.m_crossCubemapPreview = ImguiCubemap::Cross;
-
- float time = 0.0f;
int32_t leftScrollArea = 0;
@@ -320,127 +560,114 @@ int _main_(int _argc, char** _argv)
);
static int32_t rightScrollArea = 0;
- imguiBeginScrollArea("Settings", width - 256 - 10, 10, 256, 540, &rightScrollArea);
-
- imguiLabel("Shade:");
- imguiSeparator();
- imguiBool("Diffuse", settings.m_diffuse);
- imguiBool("Specular", settings.m_specular);
- imguiBool("IBL Diffuse", settings.m_diffuseIbl);
- imguiBool("IBL Specular", settings.m_specularIbl);
-
- imguiSeparatorLine();
- imguiSlider("Speed", settings.m_speed, 0.0f, 1.0f, 0.01f);
- imguiSeparatorLine();
-
- imguiSeparator();
- imguiSlider("Exposure", settings.m_exposure, -8.0f, 8.0f, 0.01f);
- imguiSeparator();
-
- imguiLabel("Environment:");
- currentLightProbe = LightProbe::Enum(imguiChoose(currentLightProbe
- , "Wells"
- , "Uffizi"
- , "Pisa"
- , "Ennis"
- , "Grace"
+ imguiBeginScrollArea("", width - 256 - 10, 10, 256, 700, &rightScrollArea);
+
+ imguiLabel("Environment light:");
+ imguiIndent();
+ imguiBool("IBL Diffuse", settings.m_doDiffuseIbl);
+ imguiBool("IBL Specular", settings.m_doSpecularIbl);
+ currentLightProbe = LightProbe::Enum(imguiTabs(currentLightProbe, true, ImguiAlign::LeftIndented, 16, 2, 2
+ , "Bolonga"
+ , "Kyoto"
) );
- static float lod = 0.0f;
- if (imguiCube(lightProbes[currentLightProbe].m_tex, lod, settings.m_crossCubemapPreview, true) )
+ if (imguiCube(lightProbes[currentLightProbe].m_tex, settings.m_lod, settings.m_crossCubemapPreview, true) )
{
settings.m_crossCubemapPreview = ImguiCubemap::Enum( (settings.m_crossCubemapPreview+1) % ImguiCubemap::Count);
}
- imguiSlider("Texture LOD", lod, 0.0f, 10.1f, 0.1f);
-
- imguiEndScrollArea();
-
- imguiBeginScrollArea("Settings", 10, 70, 256, 576, &leftScrollArea);
-
- imguiLabel("Material properties:");
- imguiSeparator();
- imguiSlider("Diffuse - Specular", settings.m_diffspec, 0.0f, 1.0f, 0.01f);
- imguiSlider("Glossiness" , settings.m_glossiness, 0.0f, 1.0f, 0.01f);
- imguiSeparator();
-
- imguiColorWheel("Diffuse color:", &settings.m_rgbDiff[0], settings.m_showDiffColorWheel);
- imguiSeparator();
- imguiColorWheel("Specular color:", &settings.m_rgbSpec[0], settings.m_showSpecColorWheel);
-
- imguiSeparator();
- imguiLabel("Predefined materials:");
- imguiSeparator();
-
- if (imguiButton("Gold") )
+ imguiSlider("Texture LOD", settings.m_lod, 0.0f, 10.1f, 0.1f);
+ imguiUnindent();
+
+ imguiSeparator(8);
+ imguiLabel("Directional light:");
+ imguiIndent();
+ imguiBool("Diffuse", settings.m_doDiffuse);
+ imguiBool("Specular", settings.m_doSpecular);
+ const bool doDirectLighting = settings.m_doDiffuse || settings.m_doSpecular;
+ imguiSlider("Light direction X", settings.m_lightDir[0], -1.0f, 1.0f, 0.1f, doDirectLighting);
+ imguiSlider("Light direction Y", settings.m_lightDir[1], -1.0f, 1.0f, 0.1f, doDirectLighting);
+ imguiSlider("Light direction Z", settings.m_lightDir[2], -1.0f, 1.0f, 0.1f, doDirectLighting);
+ imguiColorWheel("Color:", settings.m_lightCol, settings.m_showLightColorWheel, 0.6f, doDirectLighting);
+ imguiUnindent();
+
+ imguiSeparator(8);
+ imguiLabel("Background:");
+ imguiIndent();
{
- settings.m_glossiness = 0.8f;
- settings.m_diffspec = 1.0f;
-
- settings.m_rgbDiff[0] = 0.0f;
- settings.m_rgbDiff[1] = 0.0f;
- settings.m_rgbDiff[2] = 0.0f;
-
- settings.m_rgbSpec[0] = 1.0f;
- settings.m_rgbSpec[1] = 0.86f;
- settings.m_rgbSpec[2] = 0.58f;
+ int32_t selection;
+ if (0.0f == settings.m_bgType) { selection = 0; }
+ else if (7.0f == settings.m_bgType) { selection = 2; }
+ else { selection = 1; }
+ selection = imguiTabs(selection, true, ImguiAlign::LeftIndented, 16, 2, 3
+ , "Skybox"
+ , "Radiance"
+ , "Irradiance"
+ );
+ if (0 == selection) { settings.m_bgType = 0.0f; }
+ else if (2 == selection) { settings.m_bgType = 7.0f; }
+ else { settings.m_bgType = settings.m_radianceSlider; }
+ const bool isRadiance = (selection == 1);
+ imguiSlider("Mip level", settings.m_radianceSlider, 1.0f, 6.0f, 0.1f, isRadiance);
}
+ imguiUnindent();
- if (imguiButton("Copper") )
- {
- settings.m_glossiness = 0.67f;
- settings.m_diffspec = 1.0f;
+ imguiSeparator(8);
+ imguiLabel("Post processing:");
+ imguiIndent();
+ imguiSlider("Exposure", settings.m_exposure, -4.0f, 4.0f, 0.1f);
+ imguiUnindent();
- settings.m_rgbDiff[0] = 0.0f;
- settings.m_rgbDiff[1] = 0.0f;
- settings.m_rgbDiff[2] = 0.0f;
-
- settings.m_rgbSpec[0] = 0.98f;
- settings.m_rgbSpec[1] = 0.82f;
- settings.m_rgbSpec[2] = 0.76f;
- }
+ imguiSeparator();
- if (imguiButton("Titanium") )
- {
- settings.m_glossiness = 0.57f;
- settings.m_diffspec = 1.0f;
+ imguiEndScrollArea();
- settings.m_rgbDiff[0] = 0.0f;
- settings.m_rgbDiff[1] = 0.0f;
- settings.m_rgbDiff[2] = 0.0f;
+ imguiBeginScrollArea("", 10, 70, 256, 636, &leftScrollArea);
- settings.m_rgbSpec[0] = 0.76f;
- settings.m_rgbSpec[1] = 0.73f;
- settings.m_rgbSpec[2] = 0.71f;
- }
+ imguiLabel("Mesh:");
+ imguiIndent();
+ settings.m_meshSelection = imguiChoose(settings.m_meshSelection, "Bunny", "Orbs");
+ imguiUnindent();
- if (imguiButton("Steel") )
+ const bool isBunny = (0 == settings.m_meshSelection);
+ if (!isBunny)
{
- settings.m_glossiness = 0.82f;
- settings.m_diffspec = 1.0f;
-
- settings.m_rgbDiff[0] = 0.0f;
- settings.m_rgbDiff[1] = 0.0f;
- settings.m_rgbDiff[2] = 0.0f;
-
- settings.m_rgbSpec[0] = 0.77f;
- settings.m_rgbSpec[1] = 0.78f;
- settings.m_rgbSpec[2] = 0.77f;
+ settings.m_metalOrSpec = 0;
}
+ imguiSeparator(4);
+ imguiLabel("Workflow:");
+ imguiIndent();
+ if (imguiCheck("Metalness", 0 == settings.m_metalOrSpec, isBunny) ) { settings.m_metalOrSpec = 0; }
+ if (imguiCheck("Specular", 1 == settings.m_metalOrSpec, isBunny) ) { settings.m_metalOrSpec = 1; }
+ imguiUnindent();
+
+ imguiSeparator(4);
+ imguiLabel("Material:");
+ imguiIndent();
+ imguiSlider("Glossiness", settings.m_glossiness, 0.0f, 1.0f, 0.01f, isBunny);
+ imguiSlider(0 == settings.m_metalOrSpec ? "Metalness" : "Diffuse - Specular", settings.m_reflectivity, 0.0f, 1.0f, 0.01f, isBunny);
+ imguiUnindent();
+
+ imguiColorWheel("Diffuse:", &settings.m_rgbDiff[0], settings.m_showDiffColorWheel, 0.7f);
+ imguiSeparator();
+ imguiColorWheel("Specular:", &settings.m_rgbSpec[0], settings.m_showSpecColorWheel, 0.7f, (1 == settings.m_metalOrSpec) && isBunny);
+
imguiEndScrollArea();
imguiEndFrame();
- s_uniforms.m_glossiness = settings.m_glossiness;
- s_uniforms.m_exposure = settings.m_exposure;
- s_uniforms.m_diffspec = settings.m_diffspec;
- s_uniforms.m_flags[0] = float(settings.m_diffuse);
- s_uniforms.m_flags[1] = float(settings.m_specular);
- s_uniforms.m_flags[2] = float(settings.m_diffuseIbl);
- s_uniforms.m_flags[3] = float(settings.m_specularIbl);
- memcpy(s_uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float) );
- memcpy(s_uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float) );
-
- s_uniforms.submitPerFrameUniforms();
+ uniforms.m_glossiness = settings.m_glossiness;
+ uniforms.m_reflectivity = settings.m_reflectivity;
+ uniforms.m_exposure = settings.m_exposure;
+ uniforms.m_bgType = settings.m_bgType;
+ uniforms.m_metalOrSpec = float(settings.m_metalOrSpec);
+ uniforms.m_doDiffuse = float(settings.m_doDiffuse);
+ uniforms.m_doSpecular = float(settings.m_doSpecular);
+ uniforms.m_doDiffuseIbl = float(settings.m_doDiffuseIbl);
+ uniforms.m_doSpecularIbl = float(settings.m_doSpecularIbl);
+ memcpy(uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float) );
+ memcpy(uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float) );
+ memcpy(uniforms.m_lightDir, settings.m_lightDir, 3*sizeof(float) );
+ memcpy(uniforms.m_lightCol, settings.m_lightCol, 3*sizeof(float) );
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -448,9 +675,7 @@ int _main_(int _argc, char** _argv)
last = now;
const double freq = double(bx::getHPFrequency() );
const double toMs = 1000.0/freq;
-
- time += (float)(frameTime*settings.m_speed/freq);
- s_uniforms.m_camPosTime[3] = time;
+ const float deltaTimeSec = float(double(frameTime)/freq);
// Use debug font to print information about this example.
bgfx::dbgTextClear();
@@ -458,53 +683,111 @@ int _main_(int _argc, char** _argv)
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Image-based lighting.");
bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -3.0f };
-
- bx::mtxRotateXY(s_uniforms.m_mtx
- , 0.0f
- , time
- );
+ // Camera.
+ const bool mouseOverGui = imguiMouseOverArea();
+ mouse.update(float(mouseState.m_mx), float(mouseState.m_my), mouseState.m_mz, width, height);
+ if (!mouseOverGui)
+ {
+ if (mouseState.m_buttons[entry::MouseButton::Left])
+ {
+ camera.orbit(mouse.m_dx, mouse.m_dy);
+ }
+ else if (mouseState.m_buttons[entry::MouseButton::Right])
+ {
+ camera.dolly(mouse.m_dx + mouse.m_dy);
+ }
+ else if (mouseState.m_buttons[entry::MouseButton::Middle])
+ {
+ settings.m_envRotDest += mouse.m_dx*2.0f;
+ }
+ else if (0 != mouse.m_scroll)
+ {
+ camera.dolly(float(mouse.m_scroll)*0.05f);
+ }
+ }
+ camera.update(deltaTimeSec);
+ memcpy(uniforms.m_cameraPos, camera.m_pos.curr, 3*sizeof(float) );
+ // View Transform 0.
float view[16];
float proj[16];
-
bx::mtxIdentity(view);
bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
bgfx::setViewTransform(0, view, proj);
- bx::mtxLookAt(view, eye, at);
- memcpy(s_uniforms.m_camPosTime, eye, 3*sizeof(float) );
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
+ // View Transform 1.
+ camera.mtxLookAt(view);
+ bx::mtxProj(proj, 45.0f, float(width)/float(height), 0.1f, 100.0f);
bgfx::setViewTransform(1, view, proj);
+ // View rect.
bgfx::setViewRect(0, 0, 0, width, height);
bgfx::setViewRect(1, 0, 0, width, height);
- // View 0.
+ // Env rotation.
+ const float amount = bx::fmin(deltaTimeSec/0.12f, 1.0f);
+ settings.m_envRotCurr = bx::flerp(settings.m_envRotCurr, settings.m_envRotDest, amount);
+
+ // Env mtx.
+ float mtxEnvView[16];
+ camera.envViewMtx(mtxEnvView);
+ float mtxEnvRot[16];
+ bx::mtxRotateY(mtxEnvRot, settings.m_envRotCurr);
+ bx::mtxMul(uniforms.m_mtx, mtxEnvView, mtxEnvRot);
+
+ // Submit view 0.
bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
+ bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad( (float)width, (float)height, true);
- s_uniforms.submitPerDrawUniforms();
+ uniforms.submit();
bgfx::submit(0, programSky);
- // View 1.
- float mtx[16];
- bx::mtxSRT(mtx
- , 1.0f
- , 1.0f
- , 1.0f
- , 0.0f
- , bx::pi+time
- , 0.0f
- , 0.0f
- , -1.0f
- , 0.0f
- );
-
- bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
- bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
- meshSubmit(meshBunny, 1, programMesh, mtx);
+ // Submit view 1.
+ if (0 == settings.m_meshSelection)
+ {
+ // Submit bunny.
+ float mtx[16];
+ bx::mtxSRT(mtx, 1.0f, 1.0f, 1.0f, 0.0f, bx::pi, 0.0f, 0.0f, -0.80f, 0.0f);
+ bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
+ bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
+ meshSubmit(meshBunny, 1, programMesh, mtx);
+ }
+ else
+ {
+ // Submit orbs.
+ for (float yy = 0, yend = 5.0f; yy < yend; yy+=1.0f)
+ {
+ for (float xx = 0, xend = 5.0f; xx < xend; xx+=1.0f)
+ {
+ const float scale = 1.2f;
+ const float spacing = 2.2f;
+ const float yAdj = -0.8f;
+
+ float mtx[16];
+ bx::mtxSRT(mtx
+ , scale/xend
+ , scale/xend
+ , scale/xend
+ , 0.0f
+ , 0.0f
+ , 0.0f
+ , 0.0f + (xx/xend)*spacing - (1.0f + (scale-1.0f)*0.5f - 1.0f/xend)
+ , yAdj/yend + (yy/yend)*spacing - (1.0f + (scale-1.0f)*0.5f - 1.0f/yend)
+ , 0.0f
+ );
+
+ uniforms.m_glossiness = xx*(1.0f/xend);
+ uniforms.m_reflectivity = (yend-yy)*(1.0f/yend);
+ uniforms.m_metalOrSpec = 0.0f;
+ uniforms.submit();
+
+ bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
+ bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
+ meshSubmit(meshOrb, 1, programMesh, mtx);
+ }
+ }
+ }
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
@@ -512,6 +795,7 @@ int _main_(int _argc, char** _argv)
}
meshUnload(meshBunny);
+ meshUnload(meshOrb);
// Cleanup.
bgfx::destroyProgram(programMesh);
@@ -530,7 +814,7 @@ int _main_(int _argc, char** _argv)
lightProbes[ii].destroy();
}
- s_uniforms.destroy();
+ uniforms.destroy();
imguiDestroy();
diff --git a/3rdparty/bgfx/examples/18-ibl/makefile b/3rdparty/bgfx/examples/18-ibl/makefile
index 65275428bce..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/18-ibl/makefile
+++ b/3rdparty/bgfx/examples/18-ibl/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2014 Dario Manesku. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/18-ibl/screenshot.png b/3rdparty/bgfx/examples/18-ibl/screenshot.png
index fca0996c376..9cb3c375df2 100644
--- a/3rdparty/bgfx/examples/18-ibl/screenshot.png
+++ b/3rdparty/bgfx/examples/18-ibl/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/18-ibl/uniforms.sh b/3rdparty/bgfx/examples/18-ibl/uniforms.sh
new file mode 100644
index 00000000000..61354fc87cb
--- /dev/null
+++ b/3rdparty/bgfx/examples/18-ibl/uniforms.sh
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+uniform vec4 u_params[12];
+#define u_mtx0 u_params[0]
+#define u_mtx1 u_params[1]
+#define u_mtx2 u_params[2]
+#define u_mtx3 u_params[3]
+#define u_glossiness u_params[4].x
+#define u_reflectivity u_params[4].y
+#define u_exposure u_params[4].z
+#define u_bgType u_params[4].w
+#define u_metalOrSpec u_params[5].x
+#define u_unused u_params[5].yzw
+#define u_doDiffuse u_params[6].x
+#define u_doSpecular u_params[6].y
+#define u_doDiffuseIbl u_params[6].z
+#define u_doSpecularIbl u_params[6].w
+#define u_camPos u_params[7].xyz
+#define u_unused7 u_params[7].w
+#define u_rgbDiff u_params[8]
+#define u_rgbSpec u_params[9]
+#define u_lightDir u_params[10].xyz
+#define u_unused10 u_params[10].w
+#define u_lightCol u_params[11].xyz
+#define u_unused11 u_params[11].w
diff --git a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
index 7671fb74dfa..ad88136285c 100644
--- a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
@@ -2,19 +2,19 @@ $input a_position, a_normal
$output v_view, v_normal
/*
- * Copyright 2014 Dario Manesku. All rights reserved.
+ * Copyright 2014-2016 Dario Manesku. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
-
-uniform vec4 u_camPos;
+#include "uniforms.sh"
void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+ v_view = u_camPos - mul(u_model[0], vec4(a_position, 1.0)).xyz;
+
vec3 normal = a_normal * 2.0 - 1.0;
v_normal = mul(u_model[0], vec4(normal, 0.0) ).xyz;
- v_view = normalize(u_camPos.xyz - mul(u_model[0], vec4(a_position, 1.0)).xyz);
}
diff --git a/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc b/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
index 1c15b18e25e..b83fdd19e25 100644
--- a/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
+++ b/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
@@ -2,11 +2,12 @@ $input a_position, a_texcoord0
$output v_dir
/*
- * Copyright 2014 Dario Manesku. All rights reserved.
+ * Copyright 2014-2016 Dario Manesku. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
+#include "uniforms.sh"
uniform mat4 u_mtx;
@@ -14,6 +15,15 @@ void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
- vec2 tex = 2.0 * a_texcoord0 - 1.0;
- v_dir = mul(u_mtx, vec4(tex, 1.0, 0.0) ).xyz;
+ float fov = 45.0;
+ float height = tan(fov*0.5);
+ float aspect = height*(4.0/3.0);
+ vec2 tex = (2.0*a_texcoord0-1.0) * vec2(aspect, height);
+
+ mat4 mtx;
+ mtx[0] = u_mtx0;
+ mtx[1] = u_mtx1;
+ mtx[2] = u_mtx2;
+ mtx[3] = u_mtx3;
+ v_dir = instMul(mtx, vec4(tex, 1.0, 0.0) ).xyz;
}
diff --git a/3rdparty/bgfx/examples/19-oit/makefile b/3rdparty/bgfx/examples/19-oit/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/19-oit/makefile
+++ b/3rdparty/bgfx/examples/19-oit/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/19-oit/oit.cpp b/3rdparty/bgfx/examples/19-oit/oit.cpp
index 66baed03cd1..b9bbd041934 100644
--- a/3rdparty/bgfx/examples/19-oit/oit.cpp
+++ b/3rdparty/bgfx/examples/19-oit/oit.cpp
@@ -146,322 +146,370 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBott
}
}
-int _main_(int _argc, char** _argv)
+class ExampleOIT : public entry::AppI
{
- Args args(_argc, _argv);
+ void init(int _argc, char** _argv) BX_OVERRIDE
+ {
+ Args args(_argc, _argv);
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(width, height, reset);
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
- // Create vertex stream declaration.
- PosColorVertex::init();
- PosColorTexCoord0Vertex::init();
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // Create vertex stream declaration.
+ PosColorVertex::init();
+ PosColorTexCoord0Vertex::init();
- // Get renderer capabilities info.
- const bgfx::Caps* caps = bgfx::getCaps();
+ // Get renderer capabilities info.
+ const bgfx::Caps* caps = bgfx::getCaps();
- // Setup root path for binary shaders. Shader binaries are different
- // for each renderer.
- switch (caps->rendererType)
- {
- default:
- break;
+ // Setup root path for binary shaders. Shader binaries are different
+ // for each renderer.
+ switch (caps->rendererType)
+ {
+ default:
+ break;
- case bgfx::RendererType::OpenGL:
- case bgfx::RendererType::OpenGLES:
- s_flipV = true;
- break;
- }
+ case bgfx::RendererType::OpenGL:
+ case bgfx::RendererType::OpenGLES:
+ s_flipV = true;
+ break;
+ }
- // Imgui.
- imguiCreate();
+ // Imgui.
+ imguiCreate();
- const bgfx::Memory* mem;
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosColorVertex::ms_decl
+ );
- // Create static vertex buffer.
- mem = bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) );
- bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(mem, PosColorVertex::ms_decl);
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
- // Create static index buffer.
- mem = bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) );
- bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(mem);
+ // Create texture sampler uniforms.
+ s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Int1);
+ s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Int1);
+ u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
- // Create texture sampler uniforms.
- bgfx::UniformHandle s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Int1);
- bgfx::UniformHandle s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Int1);
- bgfx::UniformHandle u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
+ m_blend = loadProgram("vs_oit", "fs_oit" );
+ m_wbSeparatePass = loadProgram("vs_oit", "fs_oit_wb_separate" );
+ m_wbSeparateBlit = loadProgram("vs_oit_blit", "fs_oit_wb_separate_blit" );
+ m_wbPass = loadProgram("vs_oit", "fs_oit_wb" );
+ m_wbBlit = loadProgram("vs_oit_blit", "fs_oit_wb_blit" );
- bgfx::ProgramHandle blend = loadProgram("vs_oit", "fs_oit" );
- bgfx::ProgramHandle wbSeparatePass = loadProgram("vs_oit", "fs_oit_wb_separate" );
- bgfx::ProgramHandle wbSeparateBlit = loadProgram("vs_oit_blit", "fs_oit_wb_separate_blit" );
- bgfx::ProgramHandle wbPass = loadProgram("vs_oit", "fs_oit_wb" );
- bgfx::ProgramHandle wbBlit = loadProgram("vs_oit_blit", "fs_oit_wb_blit" );
+ m_fbtextures[0].idx = bgfx::invalidHandle;
+ m_fbtextures[1].idx = bgfx::invalidHandle;
+ m_fbh.idx = bgfx::invalidHandle;
- bgfx::TextureHandle fbtextures[2] = { BGFX_INVALID_HANDLE, BGFX_INVALID_HANDLE };
- bgfx::FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
+ m_mode = 1;
+ m_scrollArea = 0;
+ m_frontToBack = true;
+ m_fadeInOut = false;
- int64_t timeOffset = bx::getHPCounter();
+ m_oldWidth = 0;
+ m_oldHeight = 0;
+ m_oldReset = m_reset;
- uint32_t mode = 1;
- int32_t scrollArea = 0;
- bool frontToBack = true;
- bool fadeInOut = false;
+ m_timeOffset = bx::getHPCounter();
+ }
- uint32_t oldWidth = 0;
- uint32_t oldHeight = 0;
- uint32_t oldReset = reset;
+ int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ imguiDestroy();
+
+ bgfx::destroyFrameBuffer(m_fbh);
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ bgfx::destroyProgram(m_blend);
+ bgfx::destroyProgram(m_wbSeparatePass);
+ bgfx::destroyProgram(m_wbSeparateBlit);
+ bgfx::destroyProgram(m_wbPass);
+ bgfx::destroyProgram(m_wbBlit);
+ bgfx::destroyUniform(s_texColor0);
+ bgfx::destroyUniform(s_texColor1);
+ bgfx::destroyUniform(u_color);
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
- entry::MouseState mouseState;
- while (!entry::processEvents(width, height, debug, reset, &mouseState) )
+ bool update() BX_OVERRIDE
{
- if (oldWidth != width
- || oldHeight != height
- || oldReset != reset
- || !bgfx::isValid(fbh) )
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
{
- // Recreate variable size render targets when resolution changes.
- oldWidth = width;
- oldHeight = height;
- oldReset = reset;
-
- if (bgfx::isValid(fbh) )
+ if (m_oldWidth != m_width
+ || m_oldHeight != m_height
+ || m_oldReset != m_reset
+ || !bgfx::isValid(m_fbh) )
{
- bgfx::destroyFrameBuffer(fbh);
- }
+ // Recreate variable size render targets when resolution changes.
+ m_oldWidth = m_width;
+ m_oldHeight = m_height;
+ m_oldReset = m_reset;
- fbtextures[0] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::RGBA16F, BGFX_TEXTURE_RT);
- fbtextures[1] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::R16F, BGFX_TEXTURE_RT);
- fbh = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
- }
+ if (bgfx::isValid(m_fbh) )
+ {
+ bgfx::destroyFrameBuffer(m_fbh);
+ }
- imguiBeginFrame(mouseState.m_mx
- , mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
- , mouseState.m_mz
- , width
- , height
- );
+ m_fbtextures[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::RGBA16F, BGFX_TEXTURE_RT);
+ m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::R16F, BGFX_TEXTURE_RT);
+ m_fbh = bgfx::createFrameBuffer(BX_COUNTOF(m_fbtextures), m_fbtextures, true);
+ }
- imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, height / 3, &scrollArea);
- imguiSeparatorLine();
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , m_width
+ , m_height
+ );
- imguiLabel("Blend mode:");
+ imguiBeginScrollArea("Settings", m_width - m_width / 4 - 10, 10, m_width / 4, m_height / 3, &m_scrollArea);
+ imguiSeparatorLine();
- mode = imguiChoose(mode
- , "None"
- , "Separate"
- , "MRT Independent"
- );
+ imguiLabel("Blend mode:");
- imguiSeparatorLine();
+ m_mode = imguiChoose(m_mode
+ , "None"
+ , "Separate"
+ , "MRT Independent"
+ );
- if (imguiCheck("Front to back", frontToBack) )
- {
- frontToBack ^= true;
- }
+ imguiSeparatorLine();
- if (imguiCheck("Fade in/out", fadeInOut) )
- {
- fadeInOut ^= true;
- }
+ if (imguiCheck("Front to back", m_frontToBack) )
+ {
+ m_frontToBack ^= true;
+ }
- imguiEndScrollArea();
- imguiEndFrame();
+ if (imguiCheck("Fade in/out", m_fadeInOut) )
+ {
+ m_fadeInOut ^= true;
+ }
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
- bgfx::setViewRect(1, 0, 0, width, height);
+ imguiEndScrollArea();
+ imguiEndFrame();
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ bgfx::setViewRect(1, 0, 0, m_width, m_height);
- float time = (float)( (now-timeOffset)/freq);
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- // Reference:
- // Weighted, Blended Order-Independent Transparency
- // http://jcgt.org/published/0002/02/09/
- // http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/19-oit");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Weighted, Blended Order Independent Transparency.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+ float time = (float)( (now-m_timeOffset)/freq);
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -7.0f };
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ // Reference:
+ // Weighted, Blended Order-Independent Transparency
+ // http://jcgt.org/published/0002/02/09/
+ // http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/19-oit");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Weighted, Blended Order Independent Transparency.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
- float view[16];
- float proj[16];
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -7.0f };
- // Set view and projection matrix for view 0.
- bx::mtxLookAt(view, eye, at);
- mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
+ float view[16];
+ float proj[16];
- bgfx::setViewTransform(0, view, proj);
+ // Set view and projection matrix for view 0.
+ bx::mtxLookAt(view, eye, at);
+ mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
- // Set palette color for index 0
- bgfx::setPaletteColor(0, 0.0f, 0.0f, 0.0f, 0.0f);
+ bgfx::setViewTransform(0, view, proj);
- // Set palette color for index 1
- bgfx::setPaletteColor(1, 1.0f, 1.0f, 1.0f, 1.0f);
+ // Set palette color for index 0
+ bgfx::setPaletteColor(0, 0.0f, 0.0f, 0.0f, 0.0f);
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 1.0f // Depth
- , 0 // Stencil
- , 0 // FB texture 0, color palette 0
- , 1 == mode ? 1 : 0 // FB texture 1, color palette 1
- );
+ // Set palette color for index 1
+ bgfx::setPaletteColor(1, 1.0f, 1.0f, 1.0f, 1.0f);
- bgfx::setViewClear(1
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 1.0f // Depth
- , 0 // Stencil
- , 0 // Color palette 0
- );
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 1.0f // Depth
+ , 0 // Stencil
+ , 0 // FB texture 0, color palette 0
+ , 1 == m_mode ? 1 : 0 // FB texture 1, color palette 1
+ );
- bgfx::FrameBufferHandle invalid = BGFX_INVALID_HANDLE;
- bgfx::setViewFrameBuffer(0, 0 == mode ? invalid : fbh);
+ bgfx::setViewClear(1
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 1.0f // Depth
+ , 0 // Stencil
+ , 0 // Color palette 0
+ );
- // Set view and projection matrix for view 1.
- bx::mtxIdentity(view);
- bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
- bgfx::setViewTransform(1, view, proj);
+ bgfx::FrameBufferHandle invalid = BGFX_INVALID_HANDLE;
+ bgfx::setViewFrameBuffer(0, 0 == m_mode ? invalid : m_fbh);
- for (uint32_t depth = 0; depth < 3; ++depth)
- {
- uint32_t zz = frontToBack ? 2-depth : depth;
+ // Set view and projection matrix for view 1.
+ bx::mtxIdentity(view);
+ bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+ bgfx::setViewTransform(1, view, proj);
- for (uint32_t yy = 0; yy < 3; ++yy)
+ for (uint32_t depth = 0; depth < 3; ++depth)
{
- for (uint32_t xx = 0; xx < 3; ++xx)
- {
- float color[4] = { xx*1.0f/3.0f, zz*1.0f/3.0f, yy*1.0f/3.0f, 0.5f };
-
- if (fadeInOut
- && zz == 1)
- {
- color[3] = sinf(time*3.0f)*0.49f+0.5f;
- }
+ uint32_t zz = m_frontToBack ? 2-depth : depth;
- bgfx::setUniform(u_color, color);
-
- BX_UNUSED(time);
- float mtx[16];
- bx::mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
- //mtxIdentity(mtx);
- mtx[12] = -2.5f + float(xx)*2.5f;
- mtx[13] = -2.5f + float(yy)*2.5f;
- mtx[14] = -2.5f + float(zz)*2.5f;
-
- // Set transform for draw call.
- bgfx::setTransform(mtx);
-
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
-
- const uint64_t state = 0
- | BGFX_STATE_CULL_CW
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_DEPTH_TEST_LESS
- | BGFX_STATE_MSAA
- ;
-
- bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;
- switch (mode)
+ for (uint32_t yy = 0; yy < 3; ++yy)
+ {
+ for (uint32_t xx = 0; xx < 3; ++xx)
{
- case 0:
- // Set vertex and fragment shaders.
- program = blend;
-
- // Set render states.
- bgfx::setState(state
- | BGFX_STATE_BLEND_ALPHA
- );
- break;
-
- case 1:
- // Set vertex and fragment shaders.
- program = wbSeparatePass;
-
- // Set render states.
- bgfx::setState(state
- | BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_INV_SRC_ALPHA)
- );
- break;
-
- default:
- // Set vertex and fragment shaders.
- program = wbPass;
-
- // Set render states.
- bgfx::setState(state
- | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
- | BGFX_STATE_BLEND_INDEPENDENT
- , 0
- | BGFX_STATE_BLEND_FUNC_RT_1(BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_SRC_COLOR)
- );
- break;
+ float color[4] = { xx*1.0f/3.0f, zz*1.0f/3.0f, yy*1.0f/3.0f, 0.5f };
+
+ if (m_fadeInOut
+ && zz == 1)
+ {
+ color[3] = sinf(time*3.0f)*0.49f+0.5f;
+ }
+
+ bgfx::setUniform(u_color, color);
+
+ BX_UNUSED(time);
+ float mtx[16];
+ bx::mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
+ //mtxIdentity(mtx);
+ mtx[12] = -2.5f + float(xx)*2.5f;
+ mtx[13] = -2.5f + float(yy)*2.5f;
+ mtx[14] = -2.5f + float(zz)*2.5f;
+
+ // Set transform for draw call.
+ bgfx::setTransform(mtx);
+
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
+
+ const uint64_t state = 0
+ | BGFX_STATE_CULL_CW
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_MSAA
+ ;
+
+ bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;
+ switch (m_mode)
+ {
+ case 0:
+ // Set vertex and fragment shaders.
+ program = m_blend;
+
+ // Set render states.
+ bgfx::setState(state
+ | BGFX_STATE_BLEND_ALPHA
+ );
+ break;
+
+ case 1:
+ // Set vertex and fragment shaders.
+ program = m_wbSeparatePass;
+
+ // Set render states.
+ bgfx::setState(state
+ | BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ );
+ break;
+
+ default:
+ // Set vertex and fragment shaders.
+ program = m_wbPass;
+
+ // Set render states.
+ bgfx::setState(state
+ | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
+ | BGFX_STATE_BLEND_INDEPENDENT
+ , 0
+ | BGFX_STATE_BLEND_FUNC_RT_1(BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_SRC_COLOR)
+ );
+ break;
+ }
+
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, program);
}
-
- // Submit primitive for rendering to view 0.
- bgfx::submit(0, program);
}
}
- }
- if (0 != mode)
- {
- bgfx::setTexture(0, s_texColor0, fbtextures[0]);
- bgfx::setTexture(1, s_texColor1, fbtextures[1]);
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_SRC_ALPHA)
- );
- screenSpaceQuad( (float)width, (float)height, s_flipV);
- bgfx::submit(1
- , 1 == mode ? wbSeparateBlit : wbBlit
- );
+ if (0 != m_mode)
+ {
+ bgfx::setTexture(0, s_texColor0, m_fbtextures[0]);
+ bgfx::setTexture(1, s_texColor1, m_fbtextures[1]);
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_SRC_ALPHA)
+ );
+ screenSpaceQuad( (float)m_width, (float)m_height, s_flipV);
+ bgfx::submit(1
+ , 1 == m_mode ? m_wbSeparateBlit : m_wbBlit
+ );
+ }
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
}
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- // Cleanup.
- imguiDestroy();
-
- bgfx::destroyFrameBuffer(fbh);
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
- bgfx::destroyProgram(blend);
- bgfx::destroyProgram(wbSeparatePass);
- bgfx::destroyProgram(wbSeparateBlit);
- bgfx::destroyProgram(wbPass);
- bgfx::destroyProgram(wbBlit);
- bgfx::destroyUniform(s_texColor0);
- bgfx::destroyUniform(s_texColor1);
- bgfx::destroyUniform(u_color);
-
- // Shutdown bgfx.
- bgfx::shutdown();
-
- return 0;
-}
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ uint32_t m_mode;
+ int32_t m_scrollArea;
+ bool m_frontToBack;
+ bool m_fadeInOut;
+
+ uint32_t m_oldWidth;
+ uint32_t m_oldHeight;
+ uint32_t m_oldReset;
+
+ entry::MouseState m_mouseState;
+
+ int64_t m_timeOffset;
+
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+
+ bgfx::UniformHandle s_texColor0;
+ bgfx::UniformHandle s_texColor1;
+ bgfx::UniformHandle u_color;
+
+ bgfx::ProgramHandle m_blend;
+ bgfx::ProgramHandle m_wbSeparatePass;
+ bgfx::ProgramHandle m_wbSeparateBlit;
+ bgfx::ProgramHandle m_wbPass;
+ bgfx::ProgramHandle m_wbBlit;
+
+ bgfx::TextureHandle m_fbtextures[2];
+ bgfx::FrameBufferHandle m_fbh;
+};
+
+ENTRY_IMPLEMENT_MAIN(ExampleOIT);
diff --git a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
index f667ba180c2..206bca10237 100644
--- a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
+++ b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
@@ -1201,80 +1201,105 @@ void renderDemo(struct NVGcontext* vg, float mx, float my, float width, float he
nvgRestore(vg);
}
-int _main_(int _argc, char** _argv)
+class ExampleNanoVG : public entry::AppI
{
- Args args(_argc, _argv);
+ void init(int _argc, char** _argv) BX_OVERRIDE
+ {
+ Args args(_argc, _argv);
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(width, height, reset);
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ imguiCreate();
+
+ m_nvg = nvgCreate(1, 0);
+ bgfx::setViewSeq(0, true);
+
+ loadDemoData(m_nvg, &m_data);
+
+ bndSetFont(nvgCreateFont(m_nvg, "droidsans", "font/droidsans.ttf") );
+ bndSetIconImage(nvgCreateImage(m_nvg, "images/blender_icons16.png", 0) );
+
+ m_timeOffset = bx::getHPCounter();
+ }
- imguiCreate();
+ int shutdown() BX_OVERRIDE
+ {
+ freeDemoData(m_nvg, &m_data);
- NVGcontext* nvg = nvgCreate(1, 0);
- bgfx::setViewSeq(0, true);
+ nvgDelete(m_nvg);
- DemoData data;
- loadDemoData(nvg, &data);
+ imguiDestroy();
- bndSetFont(nvgCreateFont(nvg, "droidsans", "font/droidsans.ttf") );
- bndSetIconImage(nvgCreateImage(nvg, "images/blender_icons16.png", 0) );
+ // Shutdown bgfx.
+ bgfx::shutdown();
- int64_t timeOffset = bx::getHPCounter();
+ return 0;
+ }
- entry::MouseState mouseState;
- while (!entry::processEvents(width, height, debug, reset, &mouseState) )
+ bool update() BX_OVERRIDE
{
- int64_t now = bx::getHPCounter();
- const double freq = double(bx::getHPFrequency() );
- float time = (float)( (now-timeOffset)/freq);
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ int64_t now = bx::getHPCounter();
+ const double freq = double(bx::getHPFrequency() );
+ float time = (float)( (now-m_timeOffset)/freq);
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::touch(0);
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/20-nanovg");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: NanoVG is small antialiased vector graphics rendering library.");
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/20-nanovg");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: NanoVG is small antialiased vector graphics rendering library.");
- nvgBeginFrame(nvg, width, height, 1.0f);
+ nvgBeginFrame(m_nvg, m_width, m_height, 1.0f);
- renderDemo(nvg, float(mouseState.m_mx), float(mouseState.m_my), float(width), float(height), time, 0, &data);
+ renderDemo(m_nvg, float(m_mouseState.m_mx), float(m_mouseState.m_my), float(m_width), float(m_height), time, 0, &m_data);
- nvgEndFrame(nvg);
+ nvgEndFrame(m_nvg);
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
}
- freeDemoData(nvg, &data);
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- nvgDelete(nvg);
+ entry::MouseState m_mouseState;
- imguiDestroy();
+ int64_t m_timeOffset;
- // Shutdown bgfx.
- bgfx::shutdown();
+ NVGcontext* m_nvg;
+ DemoData m_data;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(ExampleNanoVG);
diff --git a/3rdparty/bgfx/examples/21-deferred/deferred.cpp b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
index 5a97b7f21b2..2f8fb5d3816 100644
--- a/3rdparty/bgfx/examples/21-deferred/deferred.cpp
+++ b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
@@ -213,7 +213,7 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf
}
}
-class Deferred : public entry::AppI
+class ExampleDeferred : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -792,4 +792,4 @@ class Deferred : public entry::AppI
int64_t m_timeOffset;
};
-ENTRY_IMPLEMENT_MAIN(Deferred);
+ENTRY_IMPLEMENT_MAIN(ExampleDeferred);
diff --git a/3rdparty/bgfx/examples/21-deferred/makefile b/3rdparty/bgfx/examples/21-deferred/makefile
index 011773e023f..4f81fb5bfb9 100644
--- a/3rdparty/bgfx/examples/21-deferred/makefile
+++ b/3rdparty/bgfx/examples/21-deferred/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/makefile b/3rdparty/bgfx/examples/23-vectordisplay/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/makefile
+++ b/3rdparty/bgfx/examples/23-vectordisplay/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
index a49eace14aa..74bcbc9eb12 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
@@ -186,7 +186,7 @@ void VectorDisplay::endFrame()
bgfx::setTexture(0, s_texColor, m_lineTexId);
- bgfx::setVertexBuffer(m_vertexBuffers[i], m_vertexBuffersSize[i]); // explicitly feed vertex number!
+ bgfx::setVertexBuffer(m_vertexBuffers[i], 0, m_vertexBuffersSize[i]); // explicitly feed vertex number!
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
diff --git a/3rdparty/bgfx/examples/24-nbody/makefile b/3rdparty/bgfx/examples/24-nbody/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/24-nbody/makefile
+++ b/3rdparty/bgfx/examples/24-nbody/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c
index a362736b435..3dd01e8c633 100644
--- a/3rdparty/bgfx/examples/25-c99/helloworld.c
+++ b/3rdparty/bgfx/examples/25-c99/helloworld.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
diff --git a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
index a6971cdd5cd..81e00f0c5fe 100644
--- a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
+++ b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
@@ -58,7 +58,7 @@ static const uint16_t s_cubeIndices[36] =
6, 3, 7,
};
-class Occlusion : public entry::AppI
+class ExampleOcclusion : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -282,4 +282,4 @@ class Occlusion : public entry::AppI
entry::WindowState m_state;
};
-ENTRY_IMPLEMENT_MAIN(Occlusion);
+ENTRY_IMPLEMENT_MAIN(ExampleOcclusion);
diff --git a/3rdparty/bgfx/examples/27-terrain/makefile b/3rdparty/bgfx/examples/27-terrain/makefile
index 011773e023f..e6278cb66dc 100644
--- a/3rdparty/bgfx/examples/27-terrain/makefile
+++ b/3rdparty/bgfx/examples/27-terrain/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -15,3 +15,4 @@ rebuild:
@make -s --no-print-directory TARGET=2 clean all
@make -s --no-print-directory TARGET=3 clean all
@make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/27-terrain/terrain.cpp b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
index 71ab88aa128..74d88ac350d 100644
--- a/3rdparty/bgfx/examples/27-terrain/terrain.cpp
+++ b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
@@ -58,7 +58,7 @@ struct BrushData
float m_power;
};
-class Terrain : public entry::AppI
+class ExampleTerrain : public entry::AppI
{
void init(int _argc, char** _argv) BX_OVERRIDE
{
@@ -169,9 +169,14 @@ class Terrain : public entry::AppI
bgfx::destroyProgram(m_terrainProgram);
bgfx::destroyProgram(m_terrainHeightTextureProgram);
- BX_FREE(entry::getAllocator(), m_terrain.m_vertices);
- BX_FREE(entry::getAllocator(), m_terrain.m_indices);
- BX_FREE(entry::getAllocator(), m_terrain.m_heightMap);
+ /// When data is passed to bgfx via makeRef we need to make
+ /// sure library is done with it before freeing memory blocks.
+ bgfx::frame();
+
+ bx::AllocatorI* allocator = entry::getAllocator();
+ BX_FREE(allocator, m_terrain.m_vertices);
+ BX_FREE(allocator, m_terrain.m_indices);
+ BX_FREE(allocator, m_terrain.m_heightMap);
// Shutdown bgfx.
bgfx::shutdown();
@@ -526,4 +531,4 @@ class Terrain : public entry::AppI
int64_t m_timeOffset;
};
-ENTRY_IMPLEMENT_MAIN(Terrain);
+ENTRY_IMPLEMENT_MAIN(ExampleTerrain);
diff --git a/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc b/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc
new file mode 100644
index 00000000000..4a68b1472e1
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc
@@ -0,0 +1,78 @@
+$input v_view, v_bc, v_normal
+
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "../common/common.sh"
+#include "uniforms.sh"
+
+vec3 evalSh(vec3 _dir)
+{
+# define k01 0.2820947918 // sqrt( 1/PI)/2
+# define k02 0.4886025119 // sqrt( 3/PI)/2
+# define k03 1.0925484306 // sqrt(15/PI)/2
+# define k04 0.3153915652 // sqrt( 5/PI)/4
+# define k05 0.5462742153 // sqrt(15/PI)/4
+
+ vec3 shEnv[9];
+ shEnv[0] = vec3( 0.967757057878229854, 0.976516067990363390, 0.891218272348969998); /* Band 0 */
+ shEnv[1] = vec3(-0.384163503608655643, -0.423492289131209787, -0.425532726148547868); /* Band 1 */
+ shEnv[2] = vec3( 0.055906294587354334, 0.056627436881069373, 0.069969936396987467);
+ shEnv[3] = vec3( 0.120985157386215209, 0.119297994074027414, 0.117111965829213599);
+ shEnv[4] = vec3(-0.176711633774331106, -0.170331404095516392, -0.151345020570876621); /* Band 2 */
+ shEnv[5] = vec3(-0.124682114349692147, -0.119340785411183953, -0.096300354204368860);
+ shEnv[6] = vec3( 0.001852378550138503, -0.032592784164597745, -0.088204495001329680);
+ shEnv[7] = vec3( 0.296365482782109446, 0.281268696656263029, 0.243328223888495510);
+ shEnv[8] = vec3(-0.079826665303240341, -0.109340956251195970, -0.157208859664677764);
+
+ vec3 nn = _dir.zxy;
+
+ float sh[9];
+ sh[0] = k01;
+ sh[1] = -k02*nn.y;
+ sh[2] = k02*nn.z;
+ sh[3] = -k02*nn.x;
+ sh[4] = k03*nn.y*nn.x;
+ sh[5] = -k03*nn.y*nn.z;
+ sh[6] = k04*(3.0*nn.z*nn.z-1.0);
+ sh[7] = -k03*nn.x*nn.z;
+ sh[8] = k05*(nn.x*nn.x-nn.y*nn.y);
+
+ vec3 rgb = vec3_splat(0.0);
+ rgb += shEnv[0] * sh[0] * 1.0;
+ rgb += shEnv[1] * sh[1] * 2.0/2.5;
+ rgb += shEnv[2] * sh[2] * 2.0/2.5;
+ rgb += shEnv[3] * sh[3] * 2.0/2.5;
+ rgb += shEnv[4] * sh[4] * 1.0/2.5;
+ rgb += shEnv[5] * sh[5] * 0.5;
+ rgb += shEnv[6] * sh[6] * 0.5;
+ rgb += shEnv[7] * sh[7] * 0.5;
+ rgb += shEnv[8] * sh[8] * 0.5;
+
+ return rgb;
+}
+
+void main()
+{
+ vec3 nn = normalize(v_normal);
+ vec3 col = evalSh(nn);
+
+ if (0.0 != u_drawEdges)
+ {
+ vec3 wfColor = u_wfColor;
+ float wfOpacity = u_wfOpacity;
+ float thickness = u_wfThickness;
+
+ vec3 fw = abs(dFdx(v_bc)) + abs(dFdy(v_bc));
+ vec3 val = smoothstep(vec3_splat(0.0), fw*thickness, v_bc);
+ float edge = min(min(val.x, val.y), val.z); // Gets to 0.0 when close to edges.
+
+ vec3 edgeCol = mix(col, wfColor, wfOpacity);
+ col = mix(edgeCol, col, edge);
+ }
+
+ gl_FragColor.xyz = col;
+ gl_FragColor.w = 1.0;
+}
diff --git a/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc b/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc
new file mode 100644
index 00000000000..e2ff1420011
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc
@@ -0,0 +1,26 @@
+$input v_view, v_bc
+
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "../common/common.sh"
+#include "uniforms.sh"
+
+void main()
+{
+ vec3 color = u_wfColor;
+ float opacity = u_wfOpacity;
+ float thickness = u_wfThickness;
+
+ if (gl_FrontFacing) { opacity *= 0.5; }
+
+ vec3 fw = abs(dFdx(v_bc)) + abs(dFdy(v_bc));
+ vec3 val = smoothstep(vec3_splat(0.0), fw*thickness, v_bc);
+ float edge = min(min(val.x, val.y), val.z); // Gets to 0.0 around the edges.
+
+ vec4 rgba = vec4(color, (1.0-edge)*opacity);
+ gl_FragColor = rgba;
+}
+
diff --git a/3rdparty/bgfx/examples/28-wireframe/makefile b/3rdparty/bgfx/examples/28-wireframe/makefile
new file mode 100644
index 00000000000..e6278cb66dc
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/makefile
@@ -0,0 +1,18 @@
+#
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+# License: http://www.opensource.org/licenses/BSD-2-Clause
+#
+
+BGFX_DIR=../..
+RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
+BUILD_DIR=../../.build
+
+include $(BGFX_DIR)/scripts/shader.mk
+
+rebuild:
+ @make -s --no-print-directory TARGET=0 clean all
+ @make -s --no-print-directory TARGET=1 clean all
+ @make -s --no-print-directory TARGET=2 clean all
+ @make -s --no-print-directory TARGET=3 clean all
+ @make -s --no-print-directory TARGET=4 clean all
+ @make -s --no-print-directory TARGET=5 clean all
diff --git a/3rdparty/bgfx/examples/28-wireframe/screenshot.png b/3rdparty/bgfx/examples/28-wireframe/screenshot.png
new file mode 100644
index 00000000000..65957306a9d
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/28-wireframe/uniforms.sh b/3rdparty/bgfx/examples/28-wireframe/uniforms.sh
new file mode 100644
index 00000000000..330555ee50d
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/uniforms.sh
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+uniform vec4 u_params[3];
+#define u_camPos u_params[0].xyz
+#define u_unused0 u_params[0].w
+#define u_wfColor u_params[1].xyz
+#define u_wfOpacity u_params[1].w
+#define u_drawEdges u_params[2].x
+#define u_wfThickness u_params[2].y
diff --git a/3rdparty/bgfx/examples/28-wireframe/varying.def.sc b/3rdparty/bgfx/examples/28-wireframe/varying.def.sc
new file mode 100644
index 00000000000..c0c52962ad3
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/varying.def.sc
@@ -0,0 +1,7 @@
+vec3 v_view : TEXCOORD0 = vec3(0.0, 0.0, 0.0);
+vec3 v_bc : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
+vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
+
+vec3 a_position : POSITION;
+vec3 a_color1 : COLOR1;
+vec3 a_normal : NORMAL;
diff --git a/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc b/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc
new file mode 100644
index 00000000000..3f51abc59ad
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc
@@ -0,0 +1,21 @@
+$input a_position, a_color1, a_normal
+$output v_view, v_bc, v_normal
+
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "../common/common.sh"
+#include "uniforms.sh"
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+
+ v_view = u_camPos - mul(u_model[0], vec4(a_position, 1.0) ).xyz;
+ v_bc = a_color1;
+
+ vec3 normal = a_normal.xyz*2.0 - 1.0;
+ v_normal = mul(u_model[0], vec4(normal, 0.0) ).xyz;
+}
diff --git a/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc b/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc
new file mode 100644
index 00000000000..1956b0d64ef
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc
@@ -0,0 +1,19 @@
+$input a_position, a_color1
+$output v_view, v_bc
+
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "../common/common.sh"
+#include "uniforms.sh"
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+
+ v_view = u_camPos - mul(u_model[0], vec4(a_position, 1.0) ).xyz;
+ v_bc = a_color1;
+}
+
diff --git a/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp b/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp
new file mode 100644
index 00000000000..df464f51ff9
--- /dev/null
+++ b/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp
@@ -0,0 +1,566 @@
+/*
+ * Copyright 2016 Dario Manesku. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "common.h"
+#include "bgfx_utils.h"
+#include "imgui/imgui.h"
+
+struct DrawMode
+{
+ enum
+ {
+ WireframeShaded,
+ Wireframe,
+ Shaded,
+ };
+};
+
+struct Camera
+{
+ Camera()
+ {
+ reset();
+ }
+
+ void reset()
+ {
+ m_target.curr[0] = 0.0f;
+ m_target.curr[1] = 0.0f;
+ m_target.curr[2] = 0.0f;
+ m_target.dest[0] = 0.0f;
+ m_target.dest[1] = 0.0f;
+ m_target.dest[2] = 0.0f;
+
+ m_pos.curr[0] = 0.0f;
+ m_pos.curr[1] = 0.0f;
+ m_pos.curr[2] = -2.0f;
+ m_pos.dest[0] = 0.0f;
+ m_pos.dest[1] = 0.0f;
+ m_pos.dest[2] = -2.0f;
+
+ m_orbit[0] = 0.0f;
+ m_orbit[1] = 0.0f;
+ }
+
+ void mtxLookAt(float* _outViewMtx)
+ {
+ bx::mtxLookAt(_outViewMtx, m_pos.curr, m_target.curr);
+ }
+
+ void orbit(float _dx, float _dy)
+ {
+ m_orbit[0] += _dx;
+ m_orbit[1] += _dy;
+ }
+
+ void dolly(float _dz)
+ {
+ const float cnear = 0.01f;
+ const float cfar = 10.0f;
+
+ const float toTarget[3] =
+ {
+ m_target.dest[0] - m_pos.dest[0],
+ m_target.dest[1] - m_pos.dest[1],
+ m_target.dest[2] - m_pos.dest[2],
+ };
+ const float toTargetLen = bx::vec3Length(toTarget);
+ const float invToTargetLen = 1.0f/(toTargetLen+FLT_MIN);
+ const float toTargetNorm[3] =
+ {
+ toTarget[0]*invToTargetLen,
+ toTarget[1]*invToTargetLen,
+ toTarget[2]*invToTargetLen,
+ };
+
+ float delta = toTargetLen*_dz;
+ float newLen = toTargetLen + delta;
+ if ( (cnear < newLen || _dz < 0.0f)
+ && (newLen < cfar || _dz > 0.0f) )
+ {
+ m_pos.dest[0] += toTargetNorm[0]*delta;
+ m_pos.dest[1] += toTargetNorm[1]*delta;
+ m_pos.dest[2] += toTargetNorm[2]*delta;
+ }
+ }
+
+ void consumeOrbit(float _amount)
+ {
+ float consume[2];
+ consume[0] = m_orbit[0]*_amount;
+ consume[1] = m_orbit[1]*_amount;
+ m_orbit[0] -= consume[0];
+ m_orbit[1] -= consume[1];
+
+ const float toPos[3] =
+ {
+ m_pos.curr[0] - m_target.curr[0],
+ m_pos.curr[1] - m_target.curr[1],
+ m_pos.curr[2] - m_target.curr[2],
+ };
+ const float toPosLen = bx::vec3Length(toPos);
+ const float invToPosLen = 1.0f/(toPosLen+FLT_MIN);
+ const float toPosNorm[3] =
+ {
+ toPos[0]*invToPosLen,
+ toPos[1]*invToPosLen,
+ toPos[2]*invToPosLen,
+ };
+
+ float ll[2];
+ latLongFromVec(ll[0], ll[1], toPosNorm);
+ ll[0] += consume[0];
+ ll[1] -= consume[1];
+ ll[1] = bx::fclamp(ll[1], 0.02f, 0.98f);
+
+ float tmp[3];
+ vecFromLatLong(tmp, ll[0], ll[1]);
+
+ float diff[3];
+ diff[0] = (tmp[0]-toPosNorm[0])*toPosLen;
+ diff[1] = (tmp[1]-toPosNorm[1])*toPosLen;
+ diff[2] = (tmp[2]-toPosNorm[2])*toPosLen;
+
+ m_pos.curr[0] += diff[0];
+ m_pos.curr[1] += diff[1];
+ m_pos.curr[2] += diff[2];
+ m_pos.dest[0] += diff[0];
+ m_pos.dest[1] += diff[1];
+ m_pos.dest[2] += diff[2];
+ }
+
+ void update(float _dt)
+ {
+ const float amount = bx::fmin(_dt/0.12f, 1.0f);
+
+ consumeOrbit(amount);
+
+ m_target.curr[0] = bx::flerp(m_target.curr[0], m_target.dest[0], amount);
+ m_target.curr[1] = bx::flerp(m_target.curr[1], m_target.dest[1], amount);
+ m_target.curr[2] = bx::flerp(m_target.curr[2], m_target.dest[2], amount);
+ m_pos.curr[0] = bx::flerp(m_pos.curr[0], m_pos.dest[0], amount);
+ m_pos.curr[1] = bx::flerp(m_pos.curr[1], m_pos.dest[1], amount);
+ m_pos.curr[2] = bx::flerp(m_pos.curr[2], m_pos.dest[2], amount);
+ }
+
+ static inline void vecFromLatLong(float _vec[3], float _u, float _v)
+ {
+ const float phi = _u * 2.0f*bx::pi;
+ const float theta = _v * bx::pi;
+
+ const float st = bx::fsin(theta);
+ const float sp = bx::fsin(phi);
+ const float ct = bx::fcos(theta);
+ const float cp = bx::fcos(phi);
+
+ _vec[0] = -st*sp;
+ _vec[1] = ct;
+ _vec[2] = -st*cp;
+ }
+
+ static inline void latLongFromVec(float& _u, float& _v, const float _vec[3])
+ {
+ const float phi = atan2f(_vec[0], _vec[2]);
+ const float theta = acosf(_vec[1]);
+
+ _u = (bx::pi + phi)*bx::invPi*0.5f;
+ _v = theta*bx::invPi;
+ }
+
+ struct Interp3f
+ {
+ float curr[3];
+ float dest[3];
+ };
+
+ Interp3f m_target;
+ Interp3f m_pos;
+ float m_orbit[2];
+};
+
+struct Mouse
+{
+ Mouse()
+ {
+ m_dx = 0.0f;
+ m_dy = 0.0f;
+ m_prevMx = 0.0f;
+ m_prevMx = 0.0f;
+ m_scroll = 0;
+ m_scrollPrev = 0;
+ }
+
+ void update(float _mx, float _my, int32_t _mz, uint32_t _width, uint32_t _height)
+ {
+ const float widthf = float(int32_t(_width));
+ const float heightf = float(int32_t(_height));
+
+ // Delta movement.
+ m_dx = float(_mx - m_prevMx)/widthf;
+ m_dy = float(_my - m_prevMy)/heightf;
+
+ m_prevMx = _mx;
+ m_prevMy = _my;
+
+ // Scroll.
+ m_scroll = _mz - m_scrollPrev;
+ m_scrollPrev = _mz;
+ }
+
+ float m_dx; // Screen space.
+ float m_dy;
+ float m_prevMx;
+ float m_prevMy;
+ int32_t m_scroll;
+ int32_t m_scrollPrev;
+};
+
+struct MeshMtx
+{
+ MeshMtx()
+ {
+ m_mesh = NULL;
+ }
+
+ void init(const char* _path
+ , float _scale = 1.0f
+ , float _rotX = 0.0f
+ , float _rotY = 0.0f
+ , float _rotZ = 0.0f
+ , float _transX = 0.0f
+ , float _transY = 0.0f
+ , float _transZ = 0.0f
+ )
+ {
+ m_mesh = meshLoad(_path);
+ bx::mtxSRT(m_mtx
+ , _scale
+ , _scale
+ , _scale
+ , _rotX
+ , _rotY
+ , _rotZ
+ , _transX
+ , _transY
+ , _transZ
+ );
+ }
+
+ void destroy()
+ {
+ if (NULL != m_mesh)
+ {
+ meshUnload(m_mesh);
+ }
+ }
+
+ Mesh* m_mesh;
+ float m_mtx[16];
+};
+
+struct Uniforms
+{
+ enum { NumVec4 = 3 };
+
+ void init()
+ {
+ m_camPos[0] = 0.0f;
+ m_camPos[1] = 1.0f;
+ m_camPos[2] = -2.5f;
+ m_wfColor[0] = 1.0f;
+ m_wfColor[1] = 0.0f;
+ m_wfColor[2] = 0.0f;
+ m_wfOpacity = 0.7f;
+ m_drawEdges = 0.0f;
+ m_wfThickness = 1.5f;
+
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, NumVec4);
+ }
+
+ void submit()
+ {
+ bgfx::setUniform(u_params, m_params, NumVec4);
+ }
+
+ void destroy()
+ {
+ bgfx::destroyUniform(u_params);
+ }
+
+ union
+ {
+ struct
+ {
+ /*0*/struct { float m_camPos[3], m_unused0; };
+ /*1*/struct { float m_wfColor[3], m_wfOpacity; };
+ /*2*/struct { float m_drawEdges, m_wfThickness, m_unused2[2]; };
+ };
+
+ float m_params[NumVec4*4];
+ };
+
+ bgfx::UniformHandle u_params;
+};
+
+class ExampleWireframe : public entry::AppI
+{
+ void init(int _argc, char** _argv) BX_OVERRIDE
+ {
+ Args args(_argc, _argv);
+
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = 0
+ | BGFX_RESET_VSYNC
+ | BGFX_RESET_MSAA_X16
+ ;
+
+ bgfx::init(args.m_type, args.m_pciId);
+ bgfx::reset(m_width, m_height, m_reset);
+
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ m_wfProgram = loadProgram("vs_wf_wireframe", "fs_wf_wireframe");
+ m_meshProgram = loadProgram("vs_wf_mesh", "fs_wf_mesh");
+
+ m_uniforms.init();
+
+ m_meshes[0].init("meshes/bunny.bin", 1.0f, 0.0f, bx::pi, 0.0f, 0.0f, -0.8f, 0.0f);
+ m_meshes[1].init("meshes/hollowcube.bin", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
+ m_meshes[2].init("meshes/orb.bin", 1.2f, 0.0f, 0.0f, 0.0f, 0.0f, -0.65f, 0.0f);
+
+ // Imgui.
+ imguiCreate();
+
+ m_oldWidth = 0;
+ m_oldHeight = 0;
+ m_oldReset = m_reset;
+
+ m_meshSelection = 1;
+ m_drawMode = DrawMode::WireframeShaded;
+ m_scrollArea = 0;
+ m_showWfColor = true;
+ }
+
+ virtual int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ imguiDestroy();
+
+ m_meshes[0].destroy();
+ m_meshes[1].destroy();
+ m_meshes[2].destroy();
+
+ bgfx::destroyProgram(m_wfProgram);
+ bgfx::destroyProgram(m_meshProgram);
+
+ m_uniforms.destroy();
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
+
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ if (m_oldWidth != m_width
+ || m_oldHeight != m_height
+ || m_oldReset != m_reset)
+ {
+ // Recreate variable size render targets when resolution changes.
+ m_oldWidth = m_width;
+ m_oldHeight = m_height;
+ m_oldReset = m_reset;
+ }
+
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , m_width
+ , m_height
+ );
+
+ imguiBeginScrollArea("Settings"
+ , m_width - m_width / 5 - 10
+ , 10
+ , m_width / 5
+ , 492
+ , &m_scrollArea
+ );
+
+ imguiSeparatorLine(1); imguiIndent(8); imguiLabel("Draw mode:"); imguiUnindent(8); imguiSeparatorLine(1);
+ imguiSeparator(4);
+ {
+ imguiIndent();
+ m_drawMode = imguiChoose(m_drawMode
+ , "Wireframe + Shaded"
+ , "Wireframe"
+ , "Shaded"
+ );
+ imguiUnindent();
+ }
+ imguiSeparator(8);
+
+ const bool wfEnabled = (DrawMode::Shaded != m_drawMode);
+ imguiSeparatorLine(1); imguiIndent(8); imguiLabel("Wireframe:", wfEnabled); imguiUnindent(8); imguiSeparatorLine(1);
+ imguiSeparator(4);
+ {
+ imguiColorWheel("Color", m_uniforms.m_wfColor, m_showWfColor, 0.6f, wfEnabled);
+ imguiIndent();
+ imguiSlider("Opacity", m_uniforms.m_wfOpacity, 0.1f, 1.0f, 0.1f, wfEnabled);
+ imguiSlider("Thickness", m_uniforms.m_wfThickness, 0.6f, 2.2f, 0.1f, wfEnabled);
+ imguiUnindent();
+ }
+ imguiSeparator(8);
+
+ imguiSeparatorLine(1); imguiIndent(8); imguiLabel("Mesh:"); imguiUnindent(8); imguiSeparatorLine(1);
+ imguiSeparator(4);
+ {
+ imguiIndent();
+ const uint32_t prevMeshSel = m_meshSelection;
+ m_meshSelection = imguiChoose(m_meshSelection
+ , "Bunny"
+ , "Hollowcubes"
+ , "Orb"
+ );
+ if (prevMeshSel != m_meshSelection)
+ {
+ m_camera.reset();
+ }
+ imguiUnindent();
+ }
+ imguiSeparator(8);
+
+ imguiEndScrollArea();
+ imguiEndFrame();
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+ const float deltaTimeSec = float(double(frameTime)/freq);
+
+ // Use m_debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/28-wirefame");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Drawing wireframe mesh.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ // Setup view.
+ bgfx::setViewRect(0, 0, 0, bgfx::BackbufferRatio::Equal);
+ bgfx::setViewClear(0, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH, 0x303030ff, 1.0f, 0);
+
+ const bool mouseOverGui = imguiMouseOverArea();
+ m_mouse.update(float(m_mouseState.m_mx), float(m_mouseState.m_my), m_mouseState.m_mz, m_width, m_height);
+ if (!mouseOverGui)
+ {
+ if (m_mouseState.m_buttons[entry::MouseButton::Left])
+ {
+ m_camera.orbit(m_mouse.m_dx, m_mouse.m_dy);
+ }
+ else if (m_mouseState.m_buttons[entry::MouseButton::Right])
+ {
+ m_camera.dolly(m_mouse.m_dx + m_mouse.m_dy);
+ }
+ else if (0 != m_mouse.m_scroll)
+ {
+ m_camera.dolly(float(m_mouse.m_scroll)*0.1f);
+ }
+ }
+
+ float view[16];
+ float proj[16];
+ m_camera.update(deltaTimeSec);
+ memcpy(m_uniforms.m_camPos, m_camera.m_pos.curr, 3*sizeof(float));
+ m_camera.mtxLookAt(view);
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
+
+ m_uniforms.m_drawEdges = (DrawMode::WireframeShaded == m_drawMode) ? 1.0f : 0.0f;
+ m_uniforms.submit();
+
+ if (DrawMode::Wireframe == m_drawMode)
+ {
+ uint64_t state = 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_CULL_CCW
+ | BGFX_STATE_MSAA
+ | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ ;
+ meshSubmit(m_meshes[m_meshSelection].m_mesh, 0, m_wfProgram, m_meshes[m_meshSelection].m_mtx, state);
+ }
+ else
+ {
+ uint64_t state = 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_CULL_CCW
+ | BGFX_STATE_MSAA
+ ;
+ meshSubmit(m_meshes[m_meshSelection].m_mesh, 0, m_meshProgram, m_meshes[m_meshSelection].m_mtx, state);
+ }
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ entry::MouseState m_mouseState;
+
+ bgfx::ProgramHandle m_wfProgram;
+ bgfx::ProgramHandle m_meshProgram;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ uint32_t m_oldWidth;
+ uint32_t m_oldHeight;
+ uint32_t m_oldReset;
+
+ Camera m_camera;
+ Mouse m_mouse;
+ Uniforms m_uniforms;
+ MeshMtx m_meshes[3];
+ uint32_t m_meshSelection;
+ uint32_t m_drawMode; // Holds data for 'DrawMode'.
+
+ bool m_showWfColor;
+ int32_t m_scrollArea;
+};
+
+ENTRY_IMPLEMENT_MAIN(ExampleWireframe);
diff --git a/3rdparty/bgfx/examples/assets/meshes/makefile b/3rdparty/bgfx/examples/assets/meshes/makefile
index f8b0ee890af..c171432ebd0 100644
--- a/3rdparty/bgfx/examples/assets/meshes/makefile
+++ b/3rdparty/bgfx/examples/assets/meshes/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -37,4 +37,4 @@ clean:
rebuild: clean all
$(RUNTIME_DIR)/meshes/%.bin : %.obj
- $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1 \ No newline at end of file
+ $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
index 9b03d3d70b9..8de8bf30964 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
@@ -389,7 +389,7 @@ struct Group
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
}
struct Mesh
@@ -540,17 +540,16 @@ struct Mesh
;
}
- uint32_t cached = bgfx::setTransform(_mtx);
+ bgfx::setTransform(_mtx);
+ bgfx::setState(_state);
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
{
const Group& group = *it;
- bgfx::setTransform(cached);
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
- bgfx::setState(_state);
- bgfx::submit(_id, _program);
+ bgfx::submit(_id, _program, 0, it != itEnd-1);
}
}
@@ -560,26 +559,28 @@ struct Mesh
for (uint32_t pass = 0; pass < _numPasses; ++pass)
{
+ bgfx::setTransform(cached, _numMatrices);
+
const MeshState& state = *_state[pass];
+ bgfx::setState(state.m_state);
+
+ for (uint8_t tex = 0; tex < state.m_numTextures; ++tex)
+ {
+ const MeshState::Texture& texture = state.m_textures[tex];
+ bgfx::setTexture(texture.m_stage
+ , texture.m_sampler
+ , texture.m_texture
+ , texture.m_flags
+ );
+ }
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
{
const Group& group = *it;
- bgfx::setTransform(cached, _numMatrices);
- for (uint8_t tex = 0; tex < state.m_numTextures; ++tex)
- {
- const MeshState::Texture& texture = state.m_textures[tex];
- bgfx::setTexture(texture.m_stage
- , texture.m_sampler
- , texture.m_texture
- , texture.m_flags
- );
- }
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
- bgfx::setState(state.m_state);
- bgfx::submit(state.m_viewId, state.m_program);
+ bgfx::submit(state.m_viewId, state.m_program, 0, it != itEnd-1);
}
}
}
@@ -646,10 +647,13 @@ Args::Args(int _argc, char** _argv)
{
m_type = bgfx::RendererType::OpenGL;
}
- else if (cmdLine.hasArg("noop")
- || cmdLine.hasArg("vk") )
+ else if (cmdLine.hasArg("vk") )
{
- m_type = bgfx::RendererType::OpenGL;
+ m_type = bgfx::RendererType::Vulkan;
+ }
+ else if (cmdLine.hasArg("noop") )
+ {
+ m_type = bgfx::RendererType::Null;
}
else if (BX_ENABLED(BX_PLATFORM_WINDOWS) )
{
diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp
index 3937b550567..0b2ae4460c9 100644
--- a/3rdparty/bgfx/examples/common/bounds.cpp
+++ b/3rdparty/bgfx/examples/common/bounds.cpp
@@ -277,6 +277,36 @@ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num
_sphere.m_radius = bx::fsqrt(maxDistSq);
}
+void calcPlaneUv(const Plane& _plane, float* _udir, float* _vdir)
+{
+ const uint8_t axis =
+ bx::fabsolute(_plane.m_normal[0]) > 0.6f ? 0
+ : (bx::fabsolute(_plane.m_normal[1]) > 0.6f ? 1
+ : 2
+ );
+ const uint8_t* index = (uint8_t*)&"\x1\x2\x0\x2\x0\x1"[axis*2];
+ const uint8_t idx0 = *(index );
+ const uint8_t idx1 = *(index+1);
+
+ _udir[0] = 0.0f;
+ _udir[1] = 0.0f;
+ _udir[2] = 0.0f;
+ _udir[idx0] = 1.0f;
+
+ _vdir[0] = 0.0f;
+ _vdir[1] = 0.0f;
+ _vdir[2] = 0.0f;
+ _vdir[idx1] = 1.0f;
+
+ const float invPlaneAxis = 1.0f / _plane.m_normal[axis];
+
+ _udir[axis] -= bx::vec3Dot(_udir, _plane.m_normal) * invPlaneAxis;
+ bx::vec3Norm(_udir, _udir);
+
+ _vdir[axis] -= bx::vec3Dot(_vdir, _plane.m_normal) * invPlaneAxis;
+ bx::vec3Norm(_vdir, _vdir);
+}
+
void buildFrustumPlanes(Plane* _result, const float* _viewProj)
{
const float xw = _viewProj[ 3];
diff --git a/3rdparty/bgfx/examples/common/bounds.h b/3rdparty/bgfx/examples/common/bounds.h
index 24f23414f10..03cac67ca9a 100644
--- a/3rdparty/bgfx/examples/common/bounds.h
+++ b/3rdparty/bgfx/examples/common/bounds.h
@@ -94,6 +94,9 @@ void calcMaxBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num
/// Calculate minimum bounding sphere.
void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step = 0.01f);
+/// Calculate coplanar U/V vectors.
+void calcPlaneUv(const Plane& _plane, float* _udir, float* _vdir);
+
/// Returns 6 (near, far, left, right, top, bottom) planes representing frustum planes.
void buildFrustumPlanes(Plane* _planes, const float* _viewProj);
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
new file mode 100644
index 00000000000..469e814eb87
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
@@ -0,0 +1,1490 @@
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx/bgfx.h>
+#include "debugdraw.h"
+
+#include <bx/fpumath.h>
+#include <bx/radixsort.h>
+#include <bx/uint32_t.h>
+#include <bx/crtimpl.h>
+
+struct DebugVertex
+{
+ float m_x;
+ float m_y;
+ float m_z;
+ float m_len;
+ uint32_t m_abgr;
+
+ static void init()
+ {
+ ms_decl
+ .begin()
+ .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord0, 1, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
+ .end();
+ }
+
+ static bgfx::VertexDecl ms_decl;
+};
+
+bgfx::VertexDecl DebugVertex::ms_decl;
+
+struct DebugShapeVertex
+{
+ float m_x;
+ float m_y;
+ float m_z;
+ float m_mask;
+
+ static void init()
+ {
+ ms_decl
+ .begin()
+ .add(bgfx::Attrib::Position, 4, bgfx::AttribType::Float)
+ .end();
+ }
+
+ static bgfx::VertexDecl ms_decl;
+};
+
+bgfx::VertexDecl DebugShapeVertex::ms_decl;
+
+static DebugShapeVertex s_cubeVertices[8] =
+{
+ {-1.0f, 1.0f, 1.0f, 0.0f },
+ { 1.0f, 1.0f, 1.0f, 0.0f },
+ {-1.0f, -1.0f, 1.0f, 0.0f },
+ { 1.0f, -1.0f, 1.0f, 0.0f },
+ {-1.0f, 1.0f, -1.0f, 0.0f },
+ { 1.0f, 1.0f, -1.0f, 0.0f },
+ {-1.0f, -1.0f, -1.0f, 0.0f },
+ { 1.0f, -1.0f, -1.0f, 0.0f },
+};
+
+static const uint16_t s_cubeIndices[36] =
+{
+ 0, 1, 2, // 0
+ 1, 3, 2,
+ 4, 6, 5, // 2
+ 5, 6, 7,
+ 0, 2, 4, // 4
+ 4, 2, 6,
+ 1, 5, 3, // 6
+ 5, 7, 3,
+ 0, 4, 1, // 8
+ 4, 5, 1,
+ 2, 3, 6, // 10
+ 6, 3, 7,
+};
+
+static const uint8_t s_circleLod[] =
+{
+ 37,
+ 29,
+ 23,
+ 17,
+ 11,
+};
+
+static uint8_t getCircleLod(uint8_t _lod)
+{
+ _lod = _lod > BX_COUNTOF(s_circleLod)-1 ? BX_COUNTOF(s_circleLod)-1 : _lod;
+ return s_circleLod[_lod];
+}
+
+static void circle(float* _out, float _angle)
+{
+ float sa = bx::fsin(_angle);
+ float ca = bx::fcos(_angle);
+ _out[0] = sa;
+ _out[1] = ca;
+}
+
+static void squircle(float* _out, float _angle)
+{
+ float sa = bx::fsin(_angle);
+ float ca = bx::fcos(_angle);
+ _out[0] = bx::fsqrt(bx::fabsolute(sa) ) * bx::fsign(sa);
+ _out[1] = bx::fsqrt(bx::fabsolute(ca) ) * bx::fsign(ca);
+}
+
+uint32_t genSphere(uint8_t _subdiv0, void* _pos0 = NULL, uint16_t _posStride0 = 0, void* _normals0 = NULL, uint16_t _normalStride0 = 0)
+{
+ if (NULL != _pos0)
+ {
+ struct Gen
+ {
+ Gen(void* _pos, uint16_t _posStride, void* _normals, uint16_t _normalStride, uint8_t _subdiv)
+ : m_pos( (uint8_t*)_pos)
+ , m_normals( (uint8_t*)_normals)
+ , m_posStride(_posStride)
+ , m_normalStride(_normalStride)
+ {
+ static const float scale = 1.0f;
+ static const float golden = 1.6180339887f;
+ static const float len = bx::fsqrt(golden*golden + 1.0f);
+ static const float ss = 1.0f/len * scale;
+ static const float ll = ss*golden;
+
+ static const float vv[12][4] =
+ {
+ { -ll, 0.0f, -ss, 0.0f },
+ { ll, 0.0f, -ss, 0.0f },
+ { ll, 0.0f, ss, 0.0f },
+ { -ll, 0.0f, ss, 0.0f },
+
+ { -ss, ll, 0.0f, 0.0f },
+ { ss, ll, 0.0f, 0.0f },
+ { ss, -ll, 0.0f, 0.0f },
+ { -ss, -ll, 0.0f, 0.0f },
+
+ { 0.0f, -ss, ll, 0.0f },
+ { 0.0f, ss, ll, 0.0f },
+ { 0.0f, ss, -ll, 0.0f },
+ { 0.0f, -ss, -ll, 0.0f },
+ };
+
+ m_numVertices = 0;
+
+ triangle(vv[ 0], vv[ 4], vv[ 3], scale, _subdiv);
+ triangle(vv[ 0], vv[10], vv[ 4], scale, _subdiv);
+ triangle(vv[ 4], vv[10], vv[ 5], scale, _subdiv);
+ triangle(vv[ 5], vv[10], vv[ 1], scale, _subdiv);
+ triangle(vv[ 5], vv[ 1], vv[ 2], scale, _subdiv);
+ triangle(vv[ 5], vv[ 2], vv[ 9], scale, _subdiv);
+ triangle(vv[ 5], vv[ 9], vv[ 4], scale, _subdiv);
+ triangle(vv[ 3], vv[ 4], vv[ 9], scale, _subdiv);
+
+ triangle(vv[ 0], vv[ 3], vv[ 7], scale, _subdiv);
+ triangle(vv[ 0], vv[ 7], vv[11], scale, _subdiv);
+ triangle(vv[11], vv[ 7], vv[ 6], scale, _subdiv);
+ triangle(vv[11], vv[ 6], vv[ 1], scale, _subdiv);
+ triangle(vv[ 1], vv[ 6], vv[ 2], scale, _subdiv);
+ triangle(vv[ 2], vv[ 6], vv[ 8], scale, _subdiv);
+ triangle(vv[ 8], vv[ 6], vv[ 7], scale, _subdiv);
+ triangle(vv[ 8], vv[ 7], vv[ 3], scale, _subdiv);
+
+ triangle(vv[ 0], vv[11], vv[10], scale, _subdiv);
+ triangle(vv[ 1], vv[10], vv[11], scale, _subdiv);
+ triangle(vv[ 2], vv[ 8], vv[ 9], scale, _subdiv);
+ triangle(vv[ 3], vv[ 9], vv[ 8], scale, _subdiv);
+ }
+
+ void addVert(const float* _v)
+ {
+ float* verts = (float*)m_pos;
+ verts[0] = _v[0];
+ verts[1] = _v[1];
+ verts[2] = _v[2];
+ m_pos += m_posStride;
+
+ if (NULL != m_normals)
+ {
+ float* normals = (float*)m_normals;
+ bx::vec3Norm(normals, _v);
+ m_normals += m_normalStride;
+ }
+
+ m_numVertices++;
+ }
+
+ void triangle(const float* _v0, const float* _v1, const float* _v2, float _scale, uint8_t _subdiv)
+ {
+ if (0 == _subdiv)
+ {
+ addVert(_v0);
+ addVert(_v1);
+ addVert(_v2);
+ }
+ else
+ {
+ float tmp0[4];
+ float tmp1[4];
+
+ float v01[4];
+ bx::vec3Add(tmp0, _v0, _v1);
+ bx::vec3Norm(tmp1, tmp0);
+ bx::vec3Mul(v01, tmp1, _scale);
+
+ float v12[4];
+ bx::vec3Add(tmp0, _v1, _v2);
+ bx::vec3Norm(tmp1, tmp0);
+ bx::vec3Mul(v12, tmp1, _scale);
+
+ float v20[4];
+ bx::vec3Add(tmp0, _v2, _v0);
+ bx::vec3Norm(tmp1, tmp0);
+ bx::vec3Mul(v20, tmp1, _scale);
+
+ --_subdiv;
+ triangle(_v0, v01, v20, _scale, _subdiv);
+ triangle(_v1, v12, v01, _scale, _subdiv);
+ triangle(_v2, v20, v12, _scale, _subdiv);
+ triangle(v01, v12, v20, _scale, _subdiv);
+ }
+ }
+
+ uint8_t* m_pos;
+ uint8_t* m_normals;
+ uint16_t m_posStride;
+ uint16_t m_normalStride;
+ uint32_t m_numVertices;
+
+ } gen(_pos0, _posStride0, _normals0, _normalStride0, _subdiv0);
+ }
+
+ uint32_t numVertices = 20*3*bx::uint32_max(1, (uint32_t)bx::fpow(4.0f, _subdiv0) );
+ return numVertices;
+}
+
+void getPoint(float* _result, Axis::Enum _axis, float _x, float _y)
+{
+ switch (_axis)
+ {
+ case Axis::X:
+ _result[0] = 0.0f;
+ _result[1] = _x;
+ _result[2] = _y;
+ break;
+
+ case Axis::Y:
+ _result[0] = _y;
+ _result[1] = 0.0f;
+ _result[2] = _x;
+ break;
+
+ default:
+ _result[0] = _x;
+ _result[1] = _y;
+ _result[2] = 0.0f;
+ break;
+ }
+}
+
+
+#include "vs_debugdraw_lines.bin.h"
+#include "fs_debugdraw_lines.bin.h"
+#include "vs_debugdraw_lines_stipple.bin.h"
+#include "fs_debugdraw_lines_stipple.bin.h"
+#include "vs_debugdraw_fill.bin.h"
+#include "fs_debugdraw_fill.bin.h"
+#include "vs_debugdraw_fill_lit.bin.h"
+#include "fs_debugdraw_fill_lit.bin.h"
+
+struct EmbeddedShader
+{
+ bgfx::RendererType::Enum type;
+ const uint8_t* data;
+ uint32_t size;
+};
+
+#define BGFX_DECLARE_SHADER_EMBEDDED(_name) \
+ { \
+ { bgfx::RendererType::Direct3D9, BX_CONCATENATE(_name, _dx9 ), sizeof(BX_CONCATENATE(_name, _dx9 ) ) }, \
+ { bgfx::RendererType::Direct3D11, BX_CONCATENATE(_name, _dx11), sizeof(BX_CONCATENATE(_name, _dx11) ) }, \
+ { bgfx::RendererType::Direct3D12, BX_CONCATENATE(_name, _dx11), sizeof(BX_CONCATENATE(_name, _dx11) ) }, \
+ { bgfx::RendererType::OpenGL, BX_CONCATENATE(_name, _glsl), sizeof(BX_CONCATENATE(_name, _glsl) ) }, \
+ { bgfx::RendererType::OpenGLES, BX_CONCATENATE(_name, _glsl), sizeof(BX_CONCATENATE(_name, _glsl) ) }, \
+ { bgfx::RendererType::Vulkan, BX_CONCATENATE(_name, _glsl), sizeof(BX_CONCATENATE(_name, _glsl) ) }, \
+ { bgfx::RendererType::Metal, BX_CONCATENATE(_name, _mtl ), sizeof(BX_CONCATENATE(_name, _mtl ) ) }, \
+ { bgfx::RendererType::Count, NULL, 0 }, \
+ }
+
+static const EmbeddedShader s_embeddedShaders[][8] =
+{
+ BGFX_DECLARE_SHADER_EMBEDDED(vs_debugdraw_lines),
+ BGFX_DECLARE_SHADER_EMBEDDED(fs_debugdraw_lines),
+ BGFX_DECLARE_SHADER_EMBEDDED(vs_debugdraw_lines_stipple),
+ BGFX_DECLARE_SHADER_EMBEDDED(fs_debugdraw_lines_stipple),
+ BGFX_DECLARE_SHADER_EMBEDDED(vs_debugdraw_fill),
+ BGFX_DECLARE_SHADER_EMBEDDED(fs_debugdraw_fill),
+ BGFX_DECLARE_SHADER_EMBEDDED(vs_debugdraw_fill_lit),
+ BGFX_DECLARE_SHADER_EMBEDDED(fs_debugdraw_fill_lit),
+};
+
+static bgfx::ShaderHandle createEmbeddedShader(bgfx::RendererType::Enum _type, uint32_t _index)
+{
+ for (const EmbeddedShader* es = s_embeddedShaders[_index]; bgfx::RendererType::Count != es->type; ++es)
+ {
+ if (_type == es->type)
+ {
+ return bgfx::createShader(bgfx::makeRef(es->data, es->size) );
+ }
+ }
+
+ bgfx::ShaderHandle handle = BGFX_INVALID_HANDLE;
+ return handle;
+}
+
+struct DebugDraw
+{
+ DebugDraw()
+ : m_state(State::Count)
+ {
+ }
+
+ void init(bx::AllocatorI* _allocator)
+ {
+ m_allocator = _allocator;
+
+#if BX_CONFIG_ALLOCATOR_CRT
+ if (NULL == _allocator)
+ {
+ static bx::CrtAllocator allocator;
+ m_allocator = &allocator;
+ }
+#endif // BX_CONFIG_ALLOCATOR_CRT
+
+ DebugVertex::init();
+ DebugShapeVertex::init();
+
+ bgfx::RendererType::Enum type = bgfx::getRendererType();
+
+ m_program[Program::Lines] =
+ bgfx::createProgram(createEmbeddedShader(type, 0)
+ , createEmbeddedShader(type, 1)
+ , true
+ );
+
+ m_program[Program::LinesStipple] =
+ bgfx::createProgram(createEmbeddedShader(type, 2)
+ , createEmbeddedShader(type, 3)
+ , true
+ );
+
+ m_program[Program::Fill] =
+ bgfx::createProgram(createEmbeddedShader(type, 4)
+ , createEmbeddedShader(type, 5)
+ , true
+ );
+
+ m_program[Program::FillLit] =
+ bgfx::createProgram(createEmbeddedShader(type, 6)
+ , createEmbeddedShader(type, 7)
+ , true
+ );
+
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, 4);
+
+ void* vertices[Mesh::Count] = {};
+ uint16_t* indices[Mesh::Count] = {};
+ uint16_t stride = DebugShapeVertex::ms_decl.getStride();
+
+ uint32_t startVertex = 0;
+ uint32_t startIndex = 0;
+
+ for (uint32_t mesh = 0; mesh < 4; ++mesh)
+ {
+ Mesh::Enum id = Mesh::Enum(Mesh::Sphere0+mesh);
+
+ const uint8_t tess = uint8_t(3-mesh);
+ const uint32_t numVertices = genSphere(tess);
+ const uint32_t numIndices = numVertices;
+
+ vertices[id] = BX_ALLOC(m_allocator, numVertices*stride);
+ genSphere(tess, vertices[id], stride);
+
+ uint16_t* trilist = (uint16_t*)BX_ALLOC(m_allocator, numIndices*sizeof(uint16_t) );
+ for (uint32_t ii = 0; ii < numIndices; ++ii)
+ {
+ trilist[ii] = uint16_t(ii);
+ }
+
+
+
+
+ uint32_t numLineListIndices = bgfx::topologyConvert(bgfx::TopologyConvert::TriListToLineList
+ , NULL
+ , 0
+ , trilist
+ , numIndices
+ , false
+ );
+ indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) );
+ uint16_t* indicesOut = indices[id];
+ memcpy(indicesOut, trilist, numIndices*sizeof(uint16_t) );
+
+ bgfx::topologyConvert(bgfx::TopologyConvert::TriListToLineList
+ , &indicesOut[numIndices]
+ , numLineListIndices*sizeof(uint16_t)
+ , trilist
+ , numIndices
+ , false
+ );
+
+ m_mesh[id].m_startVertex = startVertex;
+ m_mesh[id].m_numVertices = numVertices;
+ m_mesh[id].m_startIndex[0] = startIndex;
+ m_mesh[id].m_numIndices[0] = numIndices;
+ m_mesh[id].m_startIndex[1] = startIndex+numIndices;
+ m_mesh[id].m_numIndices[1] = numLineListIndices;
+
+ startVertex += numVertices;
+ startIndex += numIndices + numLineListIndices;
+
+ BX_FREE(m_allocator, trilist);
+ }
+
+ m_mesh[Mesh::Cube].m_startVertex = startVertex;
+ m_mesh[Mesh::Cube].m_numVertices = BX_COUNTOF(s_cubeVertices);
+ m_mesh[Mesh::Cube].m_startIndex[0] = startIndex;
+ m_mesh[Mesh::Cube].m_numIndices[0] = BX_COUNTOF(s_cubeIndices);
+ m_mesh[Mesh::Cube].m_startIndex[1] = 0;
+ m_mesh[Mesh::Cube].m_numIndices[1] = 0;
+ startVertex += m_mesh[Mesh::Cube].m_numVertices;
+ startIndex += m_mesh[Mesh::Cube].m_numIndices[0];
+
+ const bgfx::Memory* vb = bgfx::alloc(startVertex*stride);
+ const bgfx::Memory* ib = bgfx::alloc(startIndex*sizeof(uint16_t) );
+
+ for (uint32_t mesh = 0; mesh < 4; ++mesh)
+ {
+ Mesh::Enum id = Mesh::Enum(Mesh::Sphere0+mesh);
+ memcpy(&vb->data[m_mesh[id].m_startVertex * stride]
+ , vertices[id]
+ , m_mesh[id].m_numVertices*stride
+ );
+
+ memcpy(&ib->data[m_mesh[id].m_startIndex[0] * sizeof(uint16_t)]
+ , indices[id]
+ , (m_mesh[id].m_numIndices[0]+m_mesh[id].m_numIndices[1])*sizeof(uint16_t)
+ );
+
+ BX_FREE(m_allocator, vertices[id]);
+ BX_FREE(m_allocator, indices[id]);
+ }
+
+ memcpy(&vb->data[m_mesh[Mesh::Cube].m_startVertex * stride]
+ , s_cubeVertices
+ , sizeof(s_cubeVertices)
+ );
+
+ memcpy(&ib->data[m_mesh[Mesh::Cube].m_startIndex[0] * sizeof(uint16_t)]
+ , s_cubeIndices
+ , sizeof(s_cubeIndices)
+ );
+
+ m_vbh = bgfx::createVertexBuffer(vb, DebugShapeVertex::ms_decl);
+ m_ibh = bgfx::createIndexBuffer(ib);
+
+ m_mtx = 0;
+ m_viewId = 0;
+ m_pos = 0;
+ m_indexPos = 0;
+ m_vertexPos = 0;
+ }
+
+ void shutdown()
+ {
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ for (uint32_t ii = 0; ii < Program::Count; ++ii)
+ {
+ bgfx::destroyProgram(m_program[ii]);
+ }
+ bgfx::destroyUniform(u_params);
+ }
+
+ void begin(uint8_t _viewId)
+ {
+ BX_CHECK(State::Count == m_state);
+
+ m_viewId = _viewId;
+ m_mtx = 0;
+ m_state = State::None;
+ m_stack = 0;
+
+ Attrib& attrib = m_attrib[0];
+ attrib.m_state = 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_CULL_CW
+ ;
+ attrib.m_scale = 1.0f;
+ attrib.m_offset = 0.0f;
+ attrib.m_abgr = UINT32_MAX;
+ attrib.m_stipple = false;
+ attrib.m_wireframe = false;
+ attrib.m_lod = 0;
+ }
+
+ void end()
+ {
+ BX_CHECK(0 == m_stack, "Invalid stack %d.", m_stack);
+
+ flush();
+
+ m_state = State::Count;
+ }
+
+ void push()
+ {
+ BX_CHECK(State::Count != m_state);
+ ++m_stack;
+ m_attrib[m_stack] = m_attrib[m_stack-1];
+ }
+
+ void pop()
+ {
+ BX_CHECK(State::Count != m_state);
+ if (m_attrib[m_stack].m_stipple != m_attrib[m_stack-1].m_stipple)
+ {
+ flush();
+ }
+ --m_stack;
+ }
+
+ void setTransform(const void* _mtx)
+ {
+ BX_CHECK(State::Count != m_state);
+ flush();
+
+ if (NULL == _mtx)
+ {
+ m_mtx = 0;
+ return;
+ }
+
+ bgfx::Transform transform;
+ m_mtx = bgfx::allocTransform(&transform, 1);
+ memcpy(transform.data, _mtx, 64);
+ }
+
+ void setTranslate(float _x, float _y, float _z)
+ {
+ float mtx[16];
+ bx::mtxTranslate(mtx, _x, _y, _z);
+ setTransform(mtx);
+ }
+
+ void setTranslate(const float* _pos)
+ {
+ setTranslate(_pos[0], _pos[1], _pos[2]);
+ }
+
+ void setState(bool _depthTest, bool _depthWrite, bool _clockwise)
+ {
+ m_attrib[m_stack].m_state &= ~(0
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_CULL_CW
+ | BGFX_STATE_CULL_CCW
+ );
+
+ m_attrib[m_stack].m_state |= _depthTest
+ ? BGFX_STATE_DEPTH_TEST_LESS
+ : 0
+ ;
+
+ m_attrib[m_stack].m_state |= _depthWrite
+ ? BGFX_STATE_DEPTH_WRITE
+ : 0
+ ;
+
+ m_attrib[m_stack].m_state |= _clockwise
+ ? BGFX_STATE_CULL_CW
+ : BGFX_STATE_CULL_CCW
+ ;
+ }
+
+ void setColor(uint32_t _abgr)
+ {
+ BX_CHECK(State::Count != m_state);
+ m_attrib[m_stack].m_abgr = _abgr;
+ }
+
+ void setLod(uint8_t _lod)
+ {
+ BX_CHECK(State::Count != m_state);
+ m_attrib[m_stack].m_lod = _lod;
+ }
+
+ void setWireframe(bool _wireframe)
+ {
+ BX_CHECK(State::Count != m_state);
+ m_attrib[m_stack].m_wireframe = _wireframe;
+ }
+
+ void setStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f)
+ {
+ BX_CHECK(State::Count != m_state);
+
+ Attrib& attrib = m_attrib[m_stack];
+
+ if (attrib.m_stipple != _stipple)
+ {
+ flush();
+ }
+
+ attrib.m_stipple = _stipple;
+ attrib.m_offset = _offset;
+ attrib.m_scale = _scale;
+ }
+
+ void moveTo(float _x, float _y, float _z = 0.0f)
+ {
+ BX_CHECK(State::Count != m_state);
+
+ softFlush();
+
+ m_state = State::MoveTo;
+
+ DebugVertex& vertex = m_cache[m_pos];
+ vertex.m_x = _x;
+ vertex.m_y = _y;
+ vertex.m_z = _z;
+
+ Attrib& attrib = m_attrib[m_stack];
+ vertex.m_abgr = attrib.m_abgr;
+ vertex.m_len = attrib.m_offset;
+
+ m_vertexPos = m_pos;
+ }
+
+ void moveTo(const void* _pos)
+ {
+ BX_CHECK(State::Count != m_state);
+
+ const float* pos = (const float*)_pos;
+ moveTo(pos[0], pos[1], pos[2]);
+ }
+
+ void moveTo(Axis::Enum _axis, float _x, float _y)
+ {
+ float pos[3];
+ getPoint(pos, _axis, _x, _y);
+ moveTo(pos);
+ }
+
+ void lineTo(float _x, float _y, float _z = 0.0f)
+ {
+ BX_CHECK(State::Count != m_state);
+ if (State::None == m_state)
+ {
+ moveTo(_x, _y, _z);
+ return;
+ }
+
+ if (m_pos+2 > uint16_t(BX_COUNTOF(m_cache) ) )
+ {
+ uint32_t pos = m_pos;
+ uint32_t vertexPos = m_vertexPos;
+
+ flush();
+
+ memcpy(&m_cache[0], &m_cache[vertexPos], sizeof(DebugVertex) );
+ if (vertexPos == pos)
+ {
+ m_pos = 1;
+ }
+ else
+ {
+ memcpy(&m_cache[1], &m_cache[pos - 1], sizeof(DebugVertex) );
+ m_pos = 2;
+ }
+
+ m_state = State::LineTo;
+ }
+ else if (State::MoveTo == m_state)
+ {
+ ++m_pos;
+ m_state = State::LineTo;
+ }
+
+ uint16_t prev = m_pos-1;
+ uint16_t curr = m_pos++;
+ DebugVertex& vertex = m_cache[curr];
+ vertex.m_x = _x;
+ vertex.m_y = _y;
+ vertex.m_z = _z;
+
+ Attrib& attrib = m_attrib[m_stack];
+ vertex.m_abgr = attrib.m_abgr;
+ vertex.m_len = attrib.m_offset;
+
+ float tmp[3];
+ bx::vec3Sub(tmp, &vertex.m_x, &m_cache[prev].m_x);
+ float len = bx::vec3Length(tmp) * attrib.m_scale;
+ vertex.m_len = m_cache[prev].m_len + len;
+
+ m_indices[m_indexPos++] = prev;
+ m_indices[m_indexPos++] = curr;
+ }
+
+ void lineTo(const void* _pos)
+ {
+ BX_CHECK(State::Count != m_state);
+
+ const float* pos = (const float*)_pos;
+ lineTo(pos[0], pos[1], pos[2]);
+ }
+
+ void lineTo(Axis::Enum _axis, float _x, float _y)
+ {
+ float pos[3];
+ getPoint(pos, _axis, _x, _y);
+ lineTo(pos);
+ }
+
+ void close()
+ {
+ BX_CHECK(State::Count != m_state);
+ DebugVertex& vertex = m_cache[m_vertexPos];
+ lineTo(vertex.m_x, vertex.m_y, vertex.m_z);
+
+ m_state = State::None;
+ }
+
+ void draw(const Aabb& _aabb)
+ {
+ moveTo(_aabb.m_min[0], _aabb.m_min[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_min[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_max[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_min[0], _aabb.m_max[1], _aabb.m_min[2]);
+ close();
+
+ moveTo(_aabb.m_min[0], _aabb.m_min[1], _aabb.m_max[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_min[1], _aabb.m_max[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_max[1], _aabb.m_max[2]);
+ lineTo(_aabb.m_min[0], _aabb.m_max[1], _aabb.m_max[2]);
+ close();
+
+ moveTo(_aabb.m_min[0], _aabb.m_min[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_min[0], _aabb.m_min[1], _aabb.m_max[2]);
+
+ moveTo(_aabb.m_max[0], _aabb.m_min[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_min[1], _aabb.m_max[2]);
+
+ moveTo(_aabb.m_min[0], _aabb.m_max[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_min[0], _aabb.m_max[1], _aabb.m_max[2]);
+
+ moveTo(_aabb.m_max[0], _aabb.m_max[1], _aabb.m_min[2]);
+ lineTo(_aabb.m_max[0], _aabb.m_max[1], _aabb.m_max[2]);
+ }
+
+ void draw(const Cylinder& _cylinder, bool _capsule)
+ {
+ BX_UNUSED(_cylinder, _capsule);
+ }
+
+ void draw(const Disk& _disk)
+ {
+ BX_UNUSED(_disk);
+ }
+
+ void draw(const Obb& _obb)
+ {
+ const Attrib& attrib = m_attrib[m_stack];
+ if (attrib.m_wireframe)
+ {
+ setTransform(_obb.m_mtx);
+
+ moveTo(-1.0f, -1.0f, -1.0f);
+ lineTo( 1.0f, -1.0f, -1.0f);
+ lineTo( 1.0f, 1.0f, -1.0f);
+ lineTo(-1.0f, 1.0f, -1.0f);
+ close();
+
+ moveTo(-1.0f, 1.0f, 1.0f);
+ lineTo( 1.0f, 1.0f, 1.0f);
+ lineTo( 1.0f, -1.0f, 1.0f);
+ lineTo(-1.0f, -1.0f, 1.0f);
+ close();
+
+ moveTo( 1.0f, -1.0f, -1.0f);
+ lineTo( 1.0f, -1.0f, 1.0f);
+
+ moveTo( 1.0f, 1.0f, -1.0f);
+ lineTo( 1.0f, 1.0f, 1.0f);
+
+ moveTo(-1.0f, 1.0f, -1.0f);
+ lineTo(-1.0f, 1.0f, 1.0f);
+
+ moveTo(-1.0f, -1.0f, -1.0f);
+ lineTo(-1.0f, -1.0f, 1.0f);
+
+ setTransform(NULL);
+ }
+ else
+ {
+ draw(Mesh::Cube, _obb.m_mtx, false);
+ }
+ }
+
+ void draw(const Sphere& _sphere)
+ {
+ const Attrib& attrib = m_attrib[m_stack];
+ float mtx[16];
+ bx::mtxSRT(mtx
+ , _sphere.m_radius
+ , _sphere.m_radius
+ , _sphere.m_radius
+ , 0.0f
+ , 0.0f
+ , 0.0f
+ , _sphere.m_center[0]
+ , _sphere.m_center[1]
+ , _sphere.m_center[2]
+ );
+ uint8_t lod = attrib.m_lod > Mesh::SphereMaxLod
+ ? uint8_t(Mesh::SphereMaxLod)
+ : attrib.m_lod
+ ;
+ draw(Mesh::Enum(Mesh::Sphere0 + lod), mtx, attrib.m_wireframe);
+ }
+
+ void drawFrustum(const float* _viewProj)
+ {
+ Plane planes[6];
+ buildFrustumPlanes(planes, _viewProj);
+
+ float points[24];
+ intersectPlanes(&points[ 0], planes[0], planes[2], planes[4]);
+ intersectPlanes(&points[ 3], planes[0], planes[3], planes[4]);
+ intersectPlanes(&points[ 6], planes[0], planes[3], planes[5]);
+ intersectPlanes(&points[ 9], planes[0], planes[2], planes[5]);
+ intersectPlanes(&points[12], planes[1], planes[2], planes[4]);
+ intersectPlanes(&points[15], planes[1], planes[3], planes[4]);
+ intersectPlanes(&points[18], planes[1], planes[3], planes[5]);
+ intersectPlanes(&points[21], planes[1], planes[2], planes[5]);
+
+ moveTo(&points[ 0]);
+ lineTo(&points[ 3]);
+ lineTo(&points[ 6]);
+ lineTo(&points[ 9]);
+ close();
+
+ moveTo(&points[12]);
+ lineTo(&points[15]);
+ lineTo(&points[18]);
+ lineTo(&points[21]);
+ close();
+
+ moveTo(&points[ 0]);
+ lineTo(&points[12]);
+
+ moveTo(&points[ 3]);
+ lineTo(&points[15]);
+
+ moveTo(&points[ 6]);
+ lineTo(&points[18]);
+
+ moveTo(&points[ 9]);
+ lineTo(&points[21]);
+ }
+
+ void drawFrustum(const void* _viewProj)
+ {
+ drawFrustum( (const float*)_viewProj);
+ }
+
+ void drawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees)
+ {
+ const Attrib& attrib = m_attrib[m_stack];
+ const uint32_t num = getCircleLod(attrib.m_lod);
+ const float step = bx::pi * 2.0f / num;
+
+ _degrees = bx::fwrap(_degrees, 360.0f);
+
+ float pos[3];
+ getPoint(pos, _axis
+ , bx::fsin(step * 0)*_radius
+ , bx::fcos(step * 0)*_radius
+ );
+
+ moveTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+
+ uint32_t n = uint32_t(num*_degrees/360.0f);
+
+ for (uint32_t ii = 1; ii < n+1; ++ii)
+ {
+ getPoint(pos, _axis
+ , bx::fsin(step * ii)*_radius
+ , bx::fcos(step * ii)*_radius
+ );
+ lineTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+ }
+
+ moveTo(_x, _y, _z);
+ getPoint(pos, _axis
+ , bx::fsin(step * 0)*_radius
+ , bx::fcos(step * 0)*_radius
+ );
+ lineTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+
+ getPoint(pos, _axis
+ , bx::fsin(step * n)*_radius
+ , bx::fcos(step * n)*_radius
+ );
+ moveTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+ lineTo(_x, _y, _z);
+ }
+
+ void drawCircle(const float* _normal, const float* _center, float _radius, float _weight = 0.0f)
+ {
+ const Attrib& attrib = m_attrib[m_stack];
+ const uint32_t num = getCircleLod(attrib.m_lod);
+ const float step = bx::pi * 2.0f / num;
+ _weight = bx::fclamp(_weight, 0.0f, 2.0f);
+
+ Plane plane = { { _normal[0], _normal[1], _normal[2] }, 0.0f };
+ float udir[3];
+ float vdir[3];
+ calcPlaneUv(plane, udir, vdir);
+
+ float pos[3];
+ float tmp0[3];
+ float tmp1[3];
+
+ float xy0[2];
+ float xy1[2];
+ circle(xy0, 0.0f);
+ squircle(xy1, 0.0f);
+
+ bx::vec3Mul(pos, udir, bx::flerp(xy0[0], xy1[0], _weight)*_radius);
+ bx::vec3Mul(tmp0, vdir, bx::flerp(xy0[1], xy1[1], _weight)*_radius);
+ bx::vec3Add(tmp1, pos, tmp0);
+ bx::vec3Add(pos, tmp1, _center);
+ moveTo(pos);
+
+ for (uint32_t ii = 1; ii < num; ++ii)
+ {
+ float angle = step * ii;
+ circle(xy0, angle);
+ squircle(xy1, angle);
+
+ bx::vec3Mul(pos, udir, bx::flerp(xy0[0], xy1[0], _weight)*_radius);
+ bx::vec3Mul(tmp0, vdir, bx::flerp(xy0[1], xy1[1], _weight)*_radius);
+ bx::vec3Add(tmp1, pos, tmp0);
+ bx::vec3Add(pos, tmp1, _center);
+ lineTo(pos);
+ }
+
+ close();
+ }
+
+ void drawCircle(const void* _normal, const void* _center, float _radius, float _weight = 0.0f)
+ {
+ drawCircle( (const float*)_normal, (const float*)_center, _radius, _weight);
+ }
+
+ void drawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight = 0.0f)
+ {
+ const Attrib& attrib = m_attrib[m_stack];
+ const uint32_t num = getCircleLod(attrib.m_lod);
+ const float step = bx::pi * 2.0f / num;
+ _weight = bx::fclamp(_weight, 0.0f, 2.0f);
+
+ float xy0[2];
+ float xy1[2];
+ circle(xy0, 0.0f);
+ squircle(xy1, 0.0f);
+
+ float pos[3];
+ getPoint(pos, _axis
+ , bx::flerp(xy0[0], xy1[0], _weight)*_radius
+ , bx::flerp(xy0[1], xy1[1], _weight)*_radius
+ );
+
+ moveTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+ for (uint32_t ii = 1; ii < num; ++ii)
+ {
+ float angle = step * ii;
+ circle(xy0, angle);
+ squircle(xy1, angle);
+
+ getPoint(pos, _axis
+ , bx::flerp(xy0[0], xy1[0], _weight)*_radius
+ , bx::flerp(xy0[1], xy1[1], _weight)*_radius
+ );
+ lineTo(pos[0] + _x, pos[1] + _y, pos[2] + _z);
+ }
+ close();
+ }
+
+ void drawAxis(float _x, float _y, float _z, float _len, Axis::Enum _highlight)
+ {
+ push();
+
+ setColor(Axis::X == _highlight ? 0xff00ffff : 0xff0000ff);
+ moveTo(_x, _y, _z);
+ lineTo(_x + _len, _y, _z);
+
+ setColor(Axis::Y == _highlight ? 0xff00ffff : 0xff00ff00);
+ moveTo(_x, _y, _z);
+ lineTo(_x, _y + _len, _z);
+
+ setColor(Axis::Z == _highlight ? 0xff00ffff : 0xffff0000);
+ moveTo(_x, _y, _z);
+ lineTo(_x, _y, _z + _len);
+
+ pop();
+ }
+
+ void drawGrid(const float* _normal, const float* _center, uint32_t _size, float _step)
+ {
+ float udir[3];
+ float vdir[3];
+ Plane plane = { { _normal[0], _normal[1], _normal[2] }, 0.0f };
+ calcPlaneUv(plane, udir, vdir);
+
+ bx::vec3Mul(udir, udir, _step);
+ bx::vec3Mul(vdir, vdir, _step);
+
+ const uint32_t num = (_size/2)*2+1;
+ const float halfExtent = float(_size/2);
+
+ float umin[3];
+ bx::vec3Mul(umin, udir, -halfExtent);
+
+ float umax[3];
+ bx::vec3Mul(umax, udir, halfExtent);
+
+ float vmin[3];
+ bx::vec3Mul(vmin, vdir, -halfExtent);
+
+ float vmax[3];
+ bx::vec3Mul(vmax, vdir, halfExtent);
+
+ float tmp[3];
+
+ float xs[3];
+ float xe[3];
+
+ bx::vec3Add(tmp, umin, vmin);
+ bx::vec3Add(xs, _center, tmp);
+
+ bx::vec3Add(tmp, umax, vmin);
+ bx::vec3Add(xe, _center, tmp);
+
+ float ys[3];
+ float ye[3];
+
+ bx::vec3Add(tmp, umin, vmin);
+ bx::vec3Add(ys, _center, tmp);
+
+ bx::vec3Add(tmp, umin, vmax);
+ bx::vec3Add(ye, _center, tmp);
+
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ moveTo(xs);
+ lineTo(xe);
+ bx::vec3Add(xs, xs, vdir);
+ bx::vec3Add(xe, xe, vdir);
+
+ moveTo(ys);
+ lineTo(ye);
+ bx::vec3Add(ys, ys, udir);
+ bx::vec3Add(ye, ye, udir);
+ }
+ }
+
+ void drawGrid(const void* _normal, const void* _center, uint32_t _size, float _step)
+ {
+ drawGrid( (const float*)_normal, (const float*)_center, _size, _step);
+ }
+
+ void drawGrid(Axis::Enum _axis, const float* _center, uint32_t _size, float _step)
+ {
+ push();
+ setTranslate(_center);
+
+ const uint32_t num = (_size/2)*2-1;
+ const float halfExtent = float(_size/2) * _step;
+
+ setColor(0xff606060);
+ float yy = -halfExtent + _step;
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ moveTo(_axis, -halfExtent, yy);
+ lineTo(_axis, halfExtent, yy);
+
+ moveTo(_axis, yy, -halfExtent);
+ lineTo(_axis, yy, halfExtent);
+
+ yy += _step;
+ }
+
+ setColor(0xff101010);
+ moveTo(_axis, -halfExtent, -halfExtent);
+ lineTo(_axis, -halfExtent, halfExtent);
+ lineTo(_axis, halfExtent, halfExtent);
+ lineTo(_axis, halfExtent, -halfExtent);
+ close();
+
+ moveTo(_axis, -halfExtent, 0.0f);
+ lineTo(_axis, halfExtent, 0.0f);
+
+ moveTo(_axis, 0.0f, -halfExtent);
+ lineTo(_axis, 0.0f, halfExtent);
+
+ pop();
+ }
+
+ void drawGrid(Axis::Enum _axis, const void* _center, uint32_t _size, float _step)
+ {
+ drawGrid(_axis, (const float*)_center, _size, _step);
+ }
+
+ void drawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _hightlight)
+ {
+ push();
+
+ setColor(Axis::X == _hightlight ? 0xff00ffff : 0xff0000ff);
+ drawCircle(Axis::X, _x, _y, _z, _radius);
+
+ setColor(Axis::Y == _hightlight ? 0xff00ffff : 0xff00ff00);
+ drawCircle(Axis::Y, _x, _y, _z, _radius);
+
+ setColor(Axis::Z == _hightlight ? 0xff00ffff : 0xffff0000);
+ drawCircle(Axis::Z, _x, _y, _z, _radius);
+
+ pop();
+ }
+
+private:
+ struct Mesh
+ {
+ enum Enum
+ {
+ Sphere0,
+ Sphere1,
+ Sphere2,
+ Sphere3,
+ Cube,
+
+ Count,
+
+ SphereMaxLod = Sphere3 - Sphere0,
+ };
+
+ uint32_t m_startVertex;
+ uint32_t m_numVertices;
+ uint32_t m_startIndex[2];
+ uint32_t m_numIndices[2];
+ };
+
+ struct Program
+ {
+ enum Enum
+ {
+ Lines,
+ LinesStipple,
+ Fill,
+ FillLit,
+
+ Count
+ };
+ };
+
+ void draw(Mesh::Enum _mesh, const float* _mtx, bool _wireframe) const
+ {
+ const Mesh& mesh = m_mesh[_mesh];
+
+ const Attrib& attrib = m_attrib[m_stack];
+
+ if (0 != mesh.m_numIndices[_wireframe])
+ {
+ bgfx::setIndexBuffer(m_ibh
+ , mesh.m_startIndex[_wireframe]
+ , mesh.m_numIndices[_wireframe]
+ );
+ }
+
+ float params[4][4] =
+ {
+ {
+ 0.0f,
+ -1.0f,
+ 0.0f,
+ 3.0f,
+ },
+ {
+ 1.0f,
+ 0.9f,
+ 0.8f,
+ 0.0f,
+ },
+ {
+ 0.2f,
+ 0.22f,
+ 0.5f,
+ 0.0f,
+ },
+ {
+ ( (attrib.m_abgr>>24) )/255.0f,
+ ( (attrib.m_abgr>>16)&0xff)/255.0f,
+ ( (attrib.m_abgr>> 8)&0xff)/255.0f,
+ ( (attrib.m_abgr )&0xff)/255.0f,
+ },
+ };
+
+ bx::vec3Norm(params[0], params[0]);
+
+ bgfx::setUniform(u_params, params, 4);
+
+ bgfx::setTransform(_mtx);
+ bgfx::setVertexBuffer(m_vbh, mesh.m_startVertex, mesh.m_numVertices);
+ bgfx::setState(0
+ | attrib.m_state
+ | (_wireframe ? BGFX_STATE_PT_LINES : 0)
+ );
+ bgfx::submit(m_viewId, m_program[_wireframe ? Program::Fill : Program::FillLit]);
+ }
+
+ void softFlush()
+ {
+ if (m_pos == uint16_t(BX_COUNTOF(m_cache) ) )
+ {
+ flush();
+ }
+ }
+
+ void flush()
+ {
+ if (0 != m_pos)
+ {
+ if (bgfx::checkAvailTransientBuffers(m_pos, DebugVertex::ms_decl, m_indexPos) )
+ {
+ bgfx::TransientVertexBuffer tvb;
+ bgfx::allocTransientVertexBuffer(&tvb, m_pos, DebugVertex::ms_decl);
+ memcpy(tvb.data, m_cache, m_pos * DebugVertex::ms_decl.m_stride);
+
+ bgfx::TransientIndexBuffer tib;
+ bgfx::allocTransientIndexBuffer(&tib, m_indexPos);
+ memcpy(tib.data, m_indices, m_indexPos * sizeof(uint16_t) );
+
+ bgfx::setVertexBuffer(&tvb);
+ bgfx::setIndexBuffer(&tib);
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_PT_LINES
+ | BGFX_STATE_DEPTH_TEST_LEQUAL
+ | BGFX_STATE_DEPTH_WRITE
+// | BGFX_STATE_BLEND_ALPHA
+ );
+ bgfx::setTransform(m_mtx);
+ bgfx::ProgramHandle program = m_program[m_attrib[m_stack].m_stipple ? 1 : 0];
+ bgfx::submit(m_viewId, program);
+ }
+
+ m_state = State::None;
+ m_pos = 0;
+ m_indexPos = 0;
+ m_vertexPos = 0;
+ }
+ }
+
+ struct State
+ {
+ enum Enum
+ {
+ None,
+ MoveTo,
+ LineTo,
+
+ Count
+ };
+ };
+
+ static const uint32_t cacheSize = 1024;
+ static const uint32_t stackSize = 16;
+ BX_STATIC_ASSERT(cacheSize >= 3, "Cache must be at least 3 elements.");
+ DebugVertex m_cache[cacheSize+1];
+ uint32_t m_mtx;
+ uint16_t m_indices[cacheSize*2];
+ uint16_t m_pos;
+ uint16_t m_indexPos;
+ uint16_t m_vertexPos;
+ uint8_t m_viewId;
+ uint8_t m_stack;
+
+ struct Attrib
+ {
+ uint64_t m_state;
+ float m_offset;
+ float m_scale;
+ uint32_t m_abgr;
+ bool m_stipple;
+ bool m_wireframe;
+ uint8_t m_lod;
+ };
+
+ Attrib m_attrib[stackSize];
+
+ State::Enum m_state;
+
+ Mesh m_mesh[Mesh::Count];
+
+ bgfx::ProgramHandle m_program[Program::Count];
+ bgfx::UniformHandle u_params;
+
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+
+ bx::AllocatorI* m_allocator;
+};
+
+static DebugDraw s_dd;
+
+void ddInit(bx::AllocatorI* _allocator)
+{
+ s_dd.init(_allocator);
+}
+
+void ddShutdown()
+{
+ s_dd.shutdown();
+}
+
+void ddBegin(uint8_t _viewId)
+{
+ s_dd.begin(_viewId);
+}
+
+void ddEnd()
+{
+ s_dd.end();
+}
+
+void ddPush()
+{
+ s_dd.push();
+}
+
+void ddPop()
+{
+ s_dd.pop();
+}
+
+void ddSetState(bool _depthTest, bool _depthWrite, bool _clockwise)
+{
+ s_dd.setState(_depthTest, _depthWrite, _clockwise);
+}
+
+void ddSetColor(uint32_t _abgr)
+{
+ s_dd.setColor(_abgr);
+}
+
+void ddSetLod(uint8_t _lod)
+{
+ s_dd.setLod(_lod);
+}
+
+void ddSetWireframe(bool _wireframe)
+{
+ s_dd.setWireframe(_wireframe);
+}
+
+void ddSetStipple(bool _stipple, float _scale, float _offset)
+{
+ s_dd.setStipple(_stipple, _scale, _offset);
+}
+
+void ddSetTransform(const void* _mtx)
+{
+ s_dd.setTransform(_mtx);
+}
+
+void ddSetTranslate(float _x, float _y, float _z)
+{
+ s_dd.setTranslate(_x, _y, _z);
+}
+
+void ddMoveTo(float _x, float _y, float _z)
+{
+ s_dd.moveTo(_x, _y, _z);
+}
+
+void ddMoveTo(const void* _pos)
+{
+ s_dd.moveTo(_pos);
+}
+
+void ddLineTo(float _x, float _y, float _z)
+{
+ s_dd.lineTo(_x, _y, _z);
+}
+
+void ddLineTo(const void* _pos)
+{
+ s_dd.lineTo(_pos);
+}
+
+void ddClose()
+{
+ s_dd.close();
+}
+
+void ddDraw(const Aabb& _aabb)
+{
+ s_dd.draw(_aabb);
+}
+
+void ddDraw(const Cylinder& _cylinder, bool _capsule)
+{
+ s_dd.draw(_cylinder, _capsule);
+}
+
+void ddDraw(const Disk& _disk)
+{
+ s_dd.draw(_disk);
+}
+
+void ddDraw(const Obb& _obb)
+{
+ s_dd.draw(_obb);
+}
+
+void ddDraw(const Sphere& _sphere)
+{
+ s_dd.draw(_sphere);
+}
+
+void ddDrawFrustum(const void* _viewProj)
+{
+ s_dd.drawFrustum(_viewProj);
+}
+
+void ddDrawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees)
+{
+ s_dd.drawArc(_axis, _x, _y, _z, _radius, _degrees);
+}
+
+void ddDrawCircle(const void* _normal, const void* _center, float _radius, float _weight)
+{
+ s_dd.drawCircle(_normal, _center, _radius, _weight);
+}
+
+void ddDrawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight)
+{
+ s_dd.drawCircle(_axis, _x, _y, _z, _radius, _weight);
+}
+
+void ddDrawAxis(float _x, float _y, float _z, float _len, Axis::Enum _hightlight)
+{
+ s_dd.drawAxis(_x, _y, _z, _len, _hightlight);
+}
+
+void ddDrawGrid(const void* _normal, const void* _center, uint32_t _size, float _step)
+{
+ s_dd.drawGrid(_normal, _center, _size, _step);
+}
+
+void ddDrawGrid(Axis::Enum _axis, const void* _center, uint32_t _size, float _step)
+{
+ s_dd.drawGrid(_axis, _center, _size, _step);
+}
+
+void ddDrawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _hightlight)
+{
+ s_dd.drawOrb(_x, _y, _z, _radius, _hightlight);
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h
new file mode 100644
index 00000000000..e6c22094537
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef DEBUGDRAW_H_HEADER_GUARD
+#define DEBUGDRAW_H_HEADER_GUARD
+
+#include <bx/allocator.h>
+#include "../bounds.h"
+
+struct Axis
+{
+ enum Enum
+ {
+ X,
+ Y,
+ Z,
+
+ Count
+ };
+};
+
+///
+void ddInit(bx::AllocatorI* _allocator = NULL);
+
+///
+void ddShutdown();
+
+///
+void ddBegin(uint8_t _viewId);
+
+///
+void ddEnd();
+
+///
+void ddPush();
+
+///
+void ddPop();
+
+///
+void ddSetState(bool _depthTest, bool _depthWrite, bool _clockwise);
+
+///
+void ddSetColor(uint32_t _abgr);
+
+///
+void ddSetLod(uint8_t _lod);
+
+///
+void ddSetWireframe(bool _wireframe);
+
+///
+void ddSetStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f);
+
+///
+void ddSetTransform(const void* _mtx);
+
+///
+void ddSetTranslate(float _x, float _y, float _z);
+
+///
+void ddMoveTo(float _x, float _y, float _z = 0.0f);
+
+///
+void ddMoveTo(const void* _pos);
+
+///
+void ddLineTo(float _x, float _y, float _z = 0.0f);
+
+///
+void ddLineTo(const void* _pos);
+
+///
+void ddClose();
+
+///
+void ddDraw(const Aabb& _aabb);
+
+///
+void ddDraw(const Cylinder& _cylinder, bool _capsule = false);
+
+///
+void ddDraw(const Disk& _disk);
+
+///
+void ddDraw(const Obb& _obb);
+
+///
+void ddDraw(const Sphere& _sphere);
+
+///
+void ddDrawFrustum(const void* _viewProj);
+
+///
+void ddDrawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees);
+
+///
+void ddDrawCircle(const void* _normal, const void* _center, float _radius, float _weight = 0.0f);
+
+///
+void ddDrawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight = 0.0f);
+
+///
+void ddDrawAxis(float _x, float _y, float _z, float _len = 1.0f, Axis::Enum _highlight = Axis::Count);
+
+///
+void ddDrawGrid(const void* _normal, const void* _center, uint32_t _size = 20, float _step = 1.0f);
+
+///
+void ddDrawGrid(Axis::Enum _axis, const void* _center, uint32_t _size = 20, float _step = 1.0f);
+
+///
+void ddDrawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _highlight = Axis::Count);
+
+#endif // DEBUGDRAW_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h
new file mode 100644
index 00000000000..5bdca884235
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h
@@ -0,0 +1,73 @@
+static const uint8_t fs_debugdraw_fill_glsl[104] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH........u_par
+ 0x61, 0x6d, 0x73, 0x02, 0x04, 0x00, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, // ams......J...uni
+ 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // form vec4 u_para
+ 0x6d, 0x73, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // ms[4];.void main
+ 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // ().{. gl_FragC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, // olor = u_params[
+ 0x33, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 3];.}...
+};
+static const uint8_t fs_debugdraw_fill_dx9[192] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH........u_par
+ 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0xa4, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, // ams.............
+ 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, // .#.CTAB....S....
+ 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, // ...............L
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, // ...0...........<
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, // .......u_params.
+ 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...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, 0x31, 0x30, 0x2e, // der Compiler 10.
+ 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x01, // 0.10011.16384...
+ 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ................
+};
+static const uint8_t fs_debugdraw_fill_dx11[251] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH........u_par
+ 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0xdc, 0x00, 0x44, 0x58, 0x42, 0x43, 0xda, // ams........DXBC.
+ 0xfb, 0x8d, 0xd4, 0xad, 0x58, 0xef, 0x92, 0x13, 0x90, 0x07, 0xb7, 0x79, 0x4c, 0x38, 0x95, 0x01, // ....X......yL8..
+ 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, // ...........,...`
+ 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // .......ISGN,....
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ....... ........
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S
+ 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x2c, // V_POSITION.OSGN,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................
+ 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, // ...SV_TARGET...S
+ 0x48, 0x44, 0x52, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x59, // HDR@...@.......Y
+ 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, // ...F. .........e
+ 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0xf2, // .... ......6....
+ 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ......F. ......
+ 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // ...>.....@.
+};
+static const uint8_t fs_debugdraw_fill_mtl[410] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // . float4 gl_Fra
+ 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // gColor;.};.struc
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, // t xlatMtlShaderU
+ 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // niform {. float
+ 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x7d, // 4 u_params[4];.}
+ 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // ;.fragment xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, // tlShaderOutput x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, // latMtlMain (xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, // MtlShaderInput _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, // mtl_i [[stage_in
+ 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // ]], constant xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // tMtlShaderUnifor
+ 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, // m& _mtl_u [[buff
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // _mtl_o;. _mtl_
+ 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // o.gl_FragColor =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // _mtl_u.u_params
+ 0x5b, 0x33, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, // [3];. return _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc
new file mode 100644
index 00000000000..3ae18cd6a5c
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bgfx_shader.sh>
+
+uniform vec4 u_params[4];
+
+#define u_lightDir u_params[0].xyz
+#define u_shininess u_params[0].w
+#define u_skyColor u_params[1].xyz
+#define u_groundColor u_params[2].xyz
+#define u_matColor u_params[3]
+
+void main()
+{
+ gl_FragColor = u_matColor;
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h
new file mode 100644
index 00000000000..7bc4cae198b
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h
@@ -0,0 +1,168 @@
+static const uint8_t fs_debugdraw_fill_lit_glsl[510] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH...V_...u_par
+ 0x61, 0x6d, 0x73, 0x02, 0x04, 0x00, 0x00, 0x04, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, // ams..........var
+ 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // ying highp vec3
+ 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // v_world;.uniform
+ 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x34, // vec4 u_params[4
+ 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // ];.void main ().
+ 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, // {. highp vec3 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x77, 0x6f, 0x72, // r_1 = dFdx(v_wor
+ 0x6c, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // ld);. highp vec
+ 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 3 tmpvar_2;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, // pvar_2 = dFdy(v_
+ 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // world);. medium
+ 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, // p vec4 tmpvar_3;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, // . tmpvar_3.xyz
+ 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // = (mix (u_params
+ 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // [2].xyz, u_param
+ 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, // s[1].xyz, (.
+ 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, // (dot (normalize(
+ 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // (. (tmpvar_
+ 0x31, 0x2e, 0x79, 0x7a, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // 1.yzx * tmpvar_2
+ 0x2e, 0x7a, 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, // .zxy). - .
+ 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x78, // (tmpvar_1.zx
+ 0x79, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x7a, 0x78, // y * tmpvar_2.yzx
+ 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ). )), u_para
+ 0x6d, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, // ms[0].xyz) * 0.5
+ 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, // ). + 0.5)) * u
+ 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, // _params[3].xyz);
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, // . tmpvar_3.w =
+ 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x77, 0x3b, 0x0a, 0x20, // u_params[3].w;.
+ 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, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_3;.}...
+};
+static const uint8_t fs_debugdraw_fill_lit_dx9[412] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH...V_...u_par
+ 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, // ams.............
+ 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, // .#.CTAB....S....
+ 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, // ...............L
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, // ...0...........<
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, // .......u_params.
+ 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...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, 0x31, 0x30, 0x2e, // der Compiler 10.
+ 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x51, // 0.10011.16384..Q
+ 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........?.....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x00, // ................
+ 0x00, 0x07, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xc9, 0x91, 0x5c, // ................
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, // ...........[....
+ 0x00, 0x07, 0x80, 0x00, 0x00, 0xd2, 0x90, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x00, // ................
+ 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, // ................
+ 0x00, 0xd2, 0x80, 0x00, 0x00, 0xc9, 0x80, 0x02, 0x00, 0xe4, 0x81, 0x24, 0x00, 0x00, 0x02, 0x01, // ...........$....
+ 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, // ................
+ 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, // ................
+ 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, // ................
+ 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x01, // ................
+ 0x00, 0x90, 0x81, 0x01, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, // ................
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................
+ 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // ................
+ 0x08, 0x08, 0x80, 0x03, 0x00, 0xff, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ............
+};
+static const uint8_t fs_debugdraw_fill_lit_dx11[719] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x01, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, // FSH...V_...u_par
+ 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0xb0, 0x02, 0x44, 0x58, 0x42, 0x43, 0x59, // ams........DXBCY
+ 0x1c, 0xf9, 0xc6, 0x41, 0xb7, 0xae, 0xfd, 0xa5, 0xa5, 0x0c, 0x28, 0x25, 0x0d, 0x24, 0x29, 0x01, // ...A......(%.$).
+ 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, // ...........,....
+ 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, // .......ISGNh....
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......P........
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................
+ 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x53, // ...............S
+ 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, // V_POSITION.TEXCO
+ 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // ORD....OSGN,....
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S
+ 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xd8, // V_TARGET...SHDR.
+ 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, // ...@...v...Y...F
+ 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, // . .........b...r
+ 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......e.... ...
+ 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x72, // ...h.......6...r
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x14, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, // ...........A....
+ 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......r.......F
+ 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r....
+ 0x00, 0x00, 0x00, 0x26, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // ...&.......8...r
+ 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F
+ 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, // .......2...r....
+ 0x00, 0x00, 0x00, 0x26, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x04, 0x10, 0x00, 0x00, // ...&............
+ 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, // ...F...A........
+ 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...........F....
+ 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, // ...F.......D....
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // .......:.......8
+ 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, // ...r............
+ 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x12, // ...F............
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F
+ 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, // . .........2....
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, // @.....?.@.....?.
+ 0x00, 0x00, 0x0a, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x00, 0x00, // ............. ..
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ......... .A....
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, // .......2...r....
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, // ...F. .........8
+ 0x00, 0x00, 0x08, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...r ......F....
+ 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ...F. .........6
+ 0x00, 0x00, 0x06, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, // .... ......:. ..
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // .......>.....@.
+};
+static const uint8_t fs_debugdraw_fill_lit_mtl[835] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH...V_..4...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, // . float3 v_worl
+ 0x64, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, // d;.};.struct xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, // {. float4 gl_F
+ 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // ragColor;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // rUniform {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x34, 0x5d, 0x3b, // at4 u_params[4];
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, // ffer(0)]]).{. x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, // latMtlShaderOutp
+ 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ut _mtl_o;. flo
+ 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // at3 tmpvar_1;.
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x66, 0x64, 0x78, 0x28, // tmpvar_1 = dfdx(
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x3b, // _mtl_i.v_world);
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // . float3 tmpvar
+ 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, // _2;. tmpvar_2 =
+ 0x20, 0x64, 0x66, 0x64, 0x79, 0x28, 0x2d, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // dfdy(-_mtl_i.v_
+ 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // world);. float4
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_3;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x78, // var_3.xyz = (mix
+ 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // (_mtl_u.u_param
+ 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // s[2].xyz, _mtl_u
+ 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, // .u_params[1].xyz
+ 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x6f, // , (. (dot (no
+ 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // rmalize((.
+ 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x7a, 0x78, 0x20, 0x2a, 0x20, // (tmpvar_1.yzx *
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, // tmpvar_2.zxy).
+ 0x20, 0x20, 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, // - . (tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // var_1.zxy * tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x7a, 0x78, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, // ar_2.yzx). ))
+ 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // , _mtl_u.u_param
+ 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, // s[0].xyz) * 0.5)
+ 0x0a, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // . + 0.5)) * _m
+ 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, // tl_u.u_params[3]
+ 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // .xyz);. tmpvar_
+ 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // 3.w = _mtl_u.u_p
+ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // arams[3].w;. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // tl_o.gl_FragColo
+ 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, // r = tmpvar_3;.
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, // return _mtl_o;.}
+ 0x0a, 0x0a, 0x00, // ...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc
new file mode 100644
index 00000000000..3e0638701e7
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc
@@ -0,0 +1,35 @@
+$input v_view, v_world
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bgfx_shader.sh>
+
+uniform vec4 u_params[4];
+
+#define u_lightDir u_params[0].xyz
+#define u_shininess u_params[0].w
+#define u_skyColor u_params[1].xyz
+#define u_groundColor u_params[2].xyz
+#define u_matColor u_params[3]
+
+void main()
+{
+ vec3 normal = normalize(cross(dFdx(v_world), dFdy(v_world) ) );
+ vec3 viewDir = -normalize(v_view);
+
+ float ndotl = dot(normal, u_lightDir);
+ vec3 diffuse = mix(u_groundColor, u_skyColor, ndotl*0.5 + 0.5) * u_matColor.xyz;
+
+#if 0
+ vec3 reflected = 2.0*ndotl*normal - u_lightDir;
+ float rdotv = dot(reflected, viewDir);
+ float spec = step(0.0, ndotl) * pow(max(0.0, rdotv), u_shininess);
+#else
+ float spec = 0.0;
+#endif
+
+ gl_FragColor = vec4(diffuse + vec3_splat(spec), u_matColor.w);
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h
new file mode 100644
index 00000000000..747bb107908
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h
@@ -0,0 +1,70 @@
+static const uint8_t fs_debugdraw_lines_glsl[89] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...va
+ 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
+ 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void
+ 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // main ().{. gl_F
+ 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_debugdraw_lines_dx9[141] =
+{
+ 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, 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_debugdraw_lines_dx11[260] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0xf4, 0x00, 0x44, 0x58, 0x42, 0x43, // FSH....I....DXBC
+ 0xa6, 0x7f, 0x08, 0xe2, 0x95, 0xbd, 0x5f, 0xa3, 0x3f, 0x5b, 0x58, 0x8e, 0x54, 0x0f, 0x89, 0x67, // ......_.?[X.T..g
+ 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
+ 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, // ........ISGNL...
+ 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........8.......
+ 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
+ 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // D...............
+ 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT
+ 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, // ION.COLOR...OSGN
+ 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
+ 0x53, 0x48, 0x44, 0x52, 0x38, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, // SHDR8...@.......
+ 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...........e...
+ 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // . ......6.... ..
+ 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>...
+ 0x00, 0x00, 0x00, 0x00, // ....
+};
+static const uint8_t fs_debugdraw_lines_mtl[404] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x75, 0x73, // FSH....I......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // r0;.};.struct xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // t {. float4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // FragColor;.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // erUniform {.};.f
+ 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // tl_o;. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // l_FragColor = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, // tl_i.v_color0;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc
new file mode 100644
index 00000000000..9ba669f81a2
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc
@@ -0,0 +1,13 @@
+$input v_color0
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_FragColor = v_color0;
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h
new file mode 100644
index 00000000000..76ea1657b15
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h
@@ -0,0 +1,110 @@
+static const uint8_t fs_debugdraw_lines_stipple_glsl[235] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH...Z.......va
+ 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
+ 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi
+ 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, // ng highp float v
+ 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // _stipple;.void m
+ 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // ain ().{. highp
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // float tmpvar_1;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x66, // . tmpvar_1 = (f
+ 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x6d, 0x6f, 0x64, 0x20, 0x28, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, // loat(mod (v_stip
+ 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ple, 0.25)));.
+ 0x69, 0x66, 0x20, 0x28, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x35, 0x20, 0x3c, 0x20, 0x74, 0x6d, 0x70, // if ((0.125 < tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, // var_1)) {. di
+ 0x73, 0x63, 0x61, 0x72, 0x64, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // scard;. };. gl
+ 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, // _FragColor = v_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // olor0;.}...
+};
+static const uint8_t fs_debugdraw_lines_stipple_dx9[309] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x28, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH...Z...(.....
+ 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, 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, 0x80, 0x40, 0x00, 0x00, 0x80, 0x3e, // Q..........@...>
+ 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, // ...>....Q.......
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
+ 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x01, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
+ 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, // ................
+ 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, // ..............U.
+ 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
+ 0x00, 0x00, 0x55, 0xa1, 0x01, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ..U.............
+ 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ........X.......
+ 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, 0x41, 0x00, 0x00, 0x01, // ..........U.A...
+ 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x90, // ................
+ 0xff, 0xff, 0x00, 0x00, 0x00, // .....
+};
+static const uint8_t fs_debugdraw_lines_stipple_dx11[440] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0xa8, 0x01, 0x44, 0x58, 0x42, 0x43, // FSH...Z.....DXBC
+ 0x6f, 0x8f, 0x64, 0x39, 0xd9, 0xef, 0xc7, 0x09, 0x59, 0xdc, 0x77, 0x5a, 0xe8, 0x91, 0x4c, 0x16, // o.d9....Y.wZ..L.
+ 0x01, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
+ 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
+ 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
+ 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
+ 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
+ 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, // ................
+ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
+ 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
+ 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
+ 0x53, 0x48, 0x44, 0x52, 0xcc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, // SHDR....@...3...
+ 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // b...........b...
+ 0x12, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... ..
+ 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ....h.......8...
+ 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, // .@.....@A.......
+ 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ............2...
+ 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A...
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x0a, 0x10, 0x10, 0x00, // .....@.....>....
+ 0x02, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....1...........
+ 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // .@.....>........
+ 0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ............6...
+ 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // . ......F.......
+ 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >.......
+};
+static const uint8_t fs_debugdraw_lines_stipple_mtl[551] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH...Z.......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, 0x5f, 0x73, 0x74, // r0;. float v_st
+ 0x69, 0x70, 0x70, 0x6c, 0x65, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // ipple;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // tput {. float4
+ 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, // gl_FragColor;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, // haderUniform {.}
+ 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // ;.fragment xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, // tlShaderOutput x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, // latMtlMain (xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, // MtlShaderInput _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, // mtl_i [[stage_in
+ 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // ]], constant xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // tMtlShaderUnifor
+ 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, // m& _mtl_u [[buff
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _mtl_o;. float
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x66, // var_1 = (float(f
+ 0x6d, 0x6f, 0x64, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x73, 0x74, // mod (_mtl_i.v_st
+ 0x69, 0x70, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x29, 0x29, 0x29, 0x3b, 0x0a, // ipple, 0.25)));.
+ 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x35, 0x20, 0x3c, 0x20, 0x74, // if ((0.125 < t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // mpvar_1)) {.
+ 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, // discard_fragment
+ 0x28, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ();. };. _mtl_
+ 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // o.gl_FragColor =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // _mtl_i.v_color0
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ;. return _mtl_
+ 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc
new file mode 100644
index 00000000000..bfc5b642508
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc
@@ -0,0 +1,18 @@
+$input v_color0, v_stipple
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ if (0.125 < mod(v_stipple, 0.25) )
+ {
+ discard;
+ }
+
+ gl_FragColor = v_color0;
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/makefile b/3rdparty/bgfx/examples/common/debugdraw/makefile
new file mode 100644
index 00000000000..ab2bae2d539
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/makefile
@@ -0,0 +1,9 @@
+#
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+# License: http://www.opensource.org/licenses/BSD-2-Clause
+#
+
+include ../../../../bgfx/scripts/shader-embeded.mk
+
+rebuild:
+ @make -s --no-print-directory clean all
diff --git a/3rdparty/bgfx/examples/common/debugdraw/varying.def.sc b/3rdparty/bgfx/examples/common/debugdraw/varying.def.sc
new file mode 100644
index 00000000000..79ed7aebf68
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/varying.def.sc
@@ -0,0 +1,8 @@
+vec3 a_position : POSITION;
+vec4 a_color0 : COLOR0;
+float a_texcoord0 : TEXCOORD0;
+
+vec4 v_color0 : COLOR = vec4(1.0, 0.0, 0.0, 1.0);
+float v_stipple : TEXCOORD0 = 0.0;
+vec3 v_view : TEXCOORD0 = vec3(0.0, 0.0, 0.0);
+vec3 v_world : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h
new file mode 100644
index 00000000000..16fd98a58ef
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h
@@ -0,0 +1,107 @@
+static const uint8_t vs_debugdraw_fill_glsl[242] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 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, 0x01, 0x00, // elViewProj......
+ 0xcd, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ghp vec3 a_posit
+ 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, // ion;.uniform hig
+ 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // hp mat4 u_modelV
+ 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // iewProj;.void ma
+ 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // in ().{. highp
+ 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 tmpvar_1;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, // tmpvar_1.w = 1.
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // 0;. tmpvar_1.xy
+ 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // z = a_position;.
+ 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // gl_Position =
+ 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // (u_modelViewProj
+ 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, // * tmpvar_1);.}.
+ 0x0a, 0x00, // ..
+};
+static const uint8_t vs_debugdraw_fill_dx9[287] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 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......
+ 0xfc, 0x00, 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_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, // modelViewProj...
+ 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, 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, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................
+ 0x0f, 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, 0xe4, 0xa0, 0x00, 0x00, // U...............
+ 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, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+};
+static const uint8_t vs_debugdraw_fill_dx11[404] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x6c, 0x01, 0x44, 0x58, 0x42, 0x43, 0x87, 0x3c, 0x16, 0xa4, 0x8d, 0x3d, 0x5b, 0xea, 0x61, 0x5c, // l.DXBC.<...=[.a.
+ 0x10, 0x3b, 0xa1, 0xf8, 0xf8, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x03, 0x00, // .;........l.....
+ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...`.......IS
+ 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, // GN,........... .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0xab, // ......POSITION..
+ 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,.........
+ 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // .. .............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS
+ 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x53, 0x48, 0x44, 0x52, 0xd0, 0x00, 0x00, 0x00, 0x40, 0x00, // ITION.SHDR....@.
+ 0x01, 0x00, 0x34, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..4...Y...F. ...
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, // ......_...r.....
+ 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........
+ 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, // ..h.......8.....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......V.......F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // .........2.....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. .......
+ 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ..........F.....
+ 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, // ...............
+ 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, // ..F............
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......F.......F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x01, // .........>.....
+ 0x01, 0x00, 0x40, 0x00, // ..@.
+};
+static const uint8_t vs_debugdraw_fill_mtl[555] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float3 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // (0)]];.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // tput {. float4
+ 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // gl_Position [[po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // sition]];.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // rUniform {. flo
+ 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // at4x4 u_modelVie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, // wProj;.};.vertex
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // tput xlatMtlMain
+ 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, // (xlatMtlShaderI
+ 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, // nput _mtl_i [[st
+ 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, // age_in]], consta
+ 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // nt xlatMtlShader
+ 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, // Uniform& _mtl_u
+ 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, // [[buffer(0)]]).{
+ 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // . xlatMtlShader
+ 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, // Output _mtl_o;.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // float4 tmpvar_1
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_1.w =
+ 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 1.0;. tmpvar_1
+ 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, // .xyz = _mtl_i.a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // position;. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, // _o.gl_Position =
+ 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // (_mtl_u.u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ViewProj * tmpva
+ 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, // r_1);. return _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc
new file mode 100644
index 00000000000..d007e9367cd
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc
@@ -0,0 +1,13 @@
+$input a_position
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h
new file mode 100644
index 00000000000..2df5e3fbe89
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h
@@ -0,0 +1,195 @@
+static const uint8_t vs_debugdraw_fill_lit_glsl[613] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...V_...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0b, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model
+ 0x56, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // View.......u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x20, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ...attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ghp vec3 a_posit
+ 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, // ion;.varying hig
+ 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x3b, 0x0a, // hp vec3 v_view;.
+ 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve
+ 0x63, 0x33, 0x20, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // c3 v_world;.unif
+ 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // orm mat4 u_model
+ 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, // [32];.uniform hi
+ 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // ghp mat4 u_model
+ 0x56, 0x69, 0x65, 0x77, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, // View;.uniform hi
+ 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // ghp mat4 u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // ViewProj;.void m
+ 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // ain ().{. highp
+ 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // vec4 tmpvar_1;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, // tmpvar_1.w = 1
+ 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // .0;. tmpvar_1.x
+ 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // yz = a_position;
+ 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, // . gl_Position =
+ 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // (u_modelViewPro
+ 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, // j * tmpvar_1);.
+ 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp vec4 tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // ar_2;. tmpvar_2
+ 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .w = 1.0;. tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // ar_2.xyz = a_pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x20, // ition;. v_view
+ 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x20, 0x2a, // = (u_modelView *
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, // tmpvar_2).xyz;.
+ 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // highp vec4 tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_3;. tmpvar_
+ 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 3.w = 1.0;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // var_3.xyz = a_po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, // sition;. v_worl
+ 0x64, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x20, // d = (u_model[0]
+ 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, // * tmpvar_3).xyz;
+ 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}...
+};
+static const uint8_t vs_debugdraw_fill_lit_dx9[563] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...V_...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x04, 0x00, 0x0b, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
+ 0x56, 0x69, 0x65, 0x77, 0x04, 0x01, 0x04, 0x00, 0x04, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // View.......u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x08, 0x00, 0x04, 0x00, // elViewProj......
+ 0xf0, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x37, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........7.CTAB..
+ 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, // ..........X.....
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, // ......`.......p.
+ 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........|.....
+ 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7c, 0x00, // ..............|.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, // ......u_model...
+ 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ...... .......u_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, // modelView.......
+ 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // ..........u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, // lViewProj.vs_3_0
+ 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H
+ 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi
+ 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x31, 0x31, 0x2e, 0x31, // ler 10.0.10011.1
+ 0x36, 0x33, 0x38, 0x34, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // 6384............
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
+ 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x09, 0x00, // ................
+ 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x08, 0x00, // ....U...........
+ 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
+ 0x0f, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
+ 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0xe4, 0xa0, 0x05, 0x00, // ................
+ 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U...
+ 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x00, 0x00, // ................
+ 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0xe0, 0x00, 0x00, // ................
+ 0xe4, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, // ................
+ 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, // ....U...........
+ 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
+ 0x07, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
+ 0x00, 0x03, 0x02, 0x00, 0x07, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, // ................
+ 0x00, 0x00, 0x00, // ...
+};
+static const uint8_t vs_debugdraw_fill_lit_dx11[808] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...V_...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x0b, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
+ 0x56, 0x69, 0x65, 0x77, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // View.......u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x40, 0x08, 0x04, 0x00, // elViewProj..@...
+ 0xe0, 0x02, 0x44, 0x58, 0x42, 0x43, 0xda, 0xb8, 0xef, 0x0e, 0x34, 0xc8, 0x8c, 0x2c, 0x06, 0xbc, // ..DXBC....4..,..
+ 0x07, 0x0b, 0x43, 0x58, 0xee, 0x33, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x03, 0x00, // ..CX.3..........
+ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...`.......IS
+ 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, // GN,........... .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0xab, // ......POSITION..
+ 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGNh.........
+ 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // ..P.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x08, // ................
+ 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS
+ 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // ITION.TEXCOORD..
+ 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x08, 0x02, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x82, 0x00, // ..SHDR....@.....
+ 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, // ..Y...F. .......
+ 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, // .._...r.......g.
+ 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, // ... ..........e.
+ 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, // ..r ......e...r
+ 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......h.......8.
+ 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, // ..........V.....
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2.
+ 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
+ 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ...........
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
+ 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F.....
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x38, 0x00, // ..F. .........8.
+ 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, // ..r.......V.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2.
+ 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r.......F. ...
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...r.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ...........
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
+ 0x00, 0x08, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..r ......F.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x38, 0x00, // ..F. .........8.
+ 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, // ..r.......V.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2.
+ 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r.......F. ...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...r.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ...........
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
+ 0x00, 0x08, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..r ......F.....
+ 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..F. .........>.
+ 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x80, 0x08, // ........
+};
+static const uint8_t vs_debugdraw_fill_lit_mtl[898] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x73, 0x03, 0x00, 0x00, 0x75, 0x73, // VSH...V_..s...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float3 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // (0)]];.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // tput {. float4
+ 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // gl_Position [[po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // sition]];. floa
+ 0x74, 0x33, 0x20, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // t3 v_view;. flo
+ 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // at3 v_world;.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // float4x4 u_model
+ 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, // [32];. float4x4
+ 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x3b, 0x0a, 0x20, 0x20, // u_modelView;.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // float4x4 u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, // ViewProj;.};.ver
+ 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // tex xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // rOutput xlatMtlM
+ 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ain (xlatMtlShad
+ 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, // erInput _mtl_i [
+ 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, // [stage_in]], con
+ 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // stant xlatMtlSha
+ 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // derUniform& _mtl
+ 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // _u [[buffer(0)]]
+ 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // ).{. xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // derOutput _mtl_o
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ;. float4 tmpva
+ 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // r_1;. tmpvar_1.
+ 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // w = 1.0;. tmpva
+ 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // r_1.xyz = _mtl_i
+ 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // .a_position;. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // mtl_o.gl_Positio
+ 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, // n = (_mtl_u.u_mo
+ 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // delViewProj * tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // pvar_1);. float
+ 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_2;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // pvar_2.w = 1.0;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, // tmpvar_2.xyz =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // _mtl_i.a_positi
+ 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x76, // on;. _mtl_o.v_v
+ 0x69, 0x65, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // iew = (_mtl_u.u_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // modelView * tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ar_2).xyz;. flo
+ 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, // at4 tmpvar_3;.
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, // tmpvar_3.w = 1.0
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, // ;. tmpvar_3.xyz
+ 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // = _mtl_i.a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, // tion;. _mtl_o.v
+ 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // _world = (_mtl_u
+ 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x20, 0x2a, 0x20, 0x74, 0x6d, // .u_model[0] * tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, // pvar_3).xyz;. r
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, // eturn _mtl_o;.}.
+ 0x0a, 0x00, // ..
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc
new file mode 100644
index 00000000000..02054e3ef28
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc
@@ -0,0 +1,16 @@
+$input a_position
+$output v_view, v_world
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+ v_view = mul(u_modelView, vec4(a_position, 1.0) ).xyz;
+ v_world = mul(u_model[0], vec4(a_position, 1.0) ).xyz;
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h
new file mode 100644
index 00000000000..b5c9c73d715
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h
@@ -0,0 +1,127 @@
+static const uint8_t vs_debugdraw_lines_glsl[325] =
+{
+ 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, 0x01, 0x00, // elViewProj......
+ 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ...attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
+ 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
+ 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec3 a_positi
+ 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, // on;.varying high
+ 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // p vec4 v_color0;
+ 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, // .uniform highp m
+ 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // at4 u_modelViewP
+ 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, // roj;.void main (
+ 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ).{. highp vec4
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_1.w = 1.0;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_1.xyz =
+ 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // a_position;. gl
+ 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, // _Position = (u_m
+ 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, // odelViewProj * t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, // mpvar_1);. v_co
+ 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_debugdraw_lines_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......
+ 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_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, // modelViewProj...
+ 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, 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_debugdraw_lines_dx11[510] =
+{
+ 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, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0xd4, 0x01, 0x44, 0x58, 0x42, 0x43, 0x32, 0x9b, 0xdd, 0xb5, 0xa9, 0xb7, 0x22, 0xf0, 0xcf, 0x5e, // ..DXBC2....."..^
+ 0x34, 0x2c, 0x72, 0xf0, 0x87, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, // 4,r.............
+ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...|.......IS
+ 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNH...........8.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......>.........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x43, 0x4f, // ..............CO
+ 0x4c, 0x4f, 0x52, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0xab, 0x4f, 0x53, // LOR.POSITION..OS
+ 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......D.........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, // ..............SV
+ 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, // _POSITION.COLOR.
+ 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xfc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x3f, 0x00, // ..SHDR....@...?.
+ 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ..Y...F. .......
+ 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._..........._.
+ 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..r.......g....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..........e....
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......h.......8.
+ 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, // ..........V.....
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2.
+ 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ...........
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
+ 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F.....
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, // ..F. .........6.
+ 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, // ... ......F.....
+ 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // ..>.........@.
+};
+static const uint8_t vs_debugdraw_lines_mtl[647] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH....I..x...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // bute(1)]];.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // erOutput {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // at4 gl_Position
+ 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // [[position]];.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // float4 v_color0;
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, // {. float4x4 u_m
+ 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, // odelViewProj;.};
+ 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .vertex xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, // tl_o;. float4 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // r_1.w = 1.0;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // mpvar_1.xyz = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // tl_i.a_position;
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // . _mtl_o.gl_Pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ition = (_mtl_u.
+ 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, // u_modelViewProj
+ 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // * tmpvar_1);. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // mtl_o.v_color0 =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // _mtl_i.a_color0
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ;. return _mtl_
+ 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc
new file mode 100644
index 00000000000..b4090d2c29a
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc
@@ -0,0 +1,15 @@
+$input a_position, a_color0
+$output v_color0
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+ v_color0 = a_color0;
+}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h
new file mode 100644
index 00000000000..875c4ac10c6
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h
@@ -0,0 +1,148 @@
+static const uint8_t vs_debugdraw_lines_stipple_glsl[418] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...Z....u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x7d, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // }...attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
+ 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
+ 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec3 a_positi
+ 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // on;.attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // ghp float a_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // oord0;.varying h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ighp vec4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, // r0;.varying high
+ 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, // p float v_stippl
+ 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // e;.uniform highp
+ 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // mat4 u_modelVie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // wProj;.void main
+ 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ().{. highp ve
+ 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // mpvar_1.w = 1.0;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, // . tmpvar_1.xyz
+ 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // = a_position;.
+ 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, // gl_Position = (u
+ 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, // _modelViewProj *
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, // tmpvar_1);. v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // color0 = a_color
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, // 0;. v_stipple =
+ 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, // a_texcoord0;.}.
+ 0x0a, 0x00, // ..
+};
+static const uint8_t vs_debugdraw_lines_stipple_dx9[359] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...Z....u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x44, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // D.......$.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_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, // modelViewProj...
+ 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, 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, // ................
+ 0x01, 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, 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, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0xe0, 0x02, 0x00, // ................
+ 0x00, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .......
+};
+static const uint8_t vs_debugdraw_lines_stipple_dx11[620] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH...Z....u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x40, 0x02, 0x44, 0x58, 0x42, 0x43, 0xe3, 0xb5, 0xa4, 0x88, 0xa6, 0x8c, 0xfa, 0x02, 0x7e, 0x55, // @.DXBC........~U
+ 0x75, 0xcd, 0x57, 0x76, 0xf4, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x03, 0x00, // u.Wv......@.....
+ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
+ 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNh...........P.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......V.........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x5f, 0x00, // .............._.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ................
+ 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x50, 0x4f, 0x53, 0x49, // ......COLOR.POSI
+ 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, // TION.TEXCOORD.OS
+ 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNl...........P.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, // ..............b.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ................
+ 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO
+ 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, // N.COLOR.TEXCOORD
+ 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, 0x28, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x4a, 0x00, // ..SHDR(...@...J.
+ 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ..Y...F. .......
+ 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._..........._.
+ 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, // ..r......._.....
+ 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......g.... ....
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // ......e.... ....
+ 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h.
+ 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8.........
+ 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ...
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ...........
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2.
+ 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ........... ....
+ 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // ......6.... ....
+ 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, // ..F.......6....
+ 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..............>.
+ 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ..........@.
+};
+static const uint8_t vs_debugdraw_lines_stipple_mtl[745] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0xda, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...Z.......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, // at a_texcoord0 [
+ 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, // [attribute(2)]];
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // . float4 gl_Pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // ition [[position
+ 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, // ]];. float4 v_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, // olor0;. float v
+ 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // _stipple;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // rUniform {. flo
+ 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // at4x4 u_modelVie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, // wProj;.};.vertex
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // tput xlatMtlMain
+ 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, // (xlatMtlShaderI
+ 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, // nput _mtl_i [[st
+ 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, // age_in]], consta
+ 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // nt xlatMtlShader
+ 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, // Uniform& _mtl_u
+ 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, // [[buffer(0)]]).{
+ 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // . xlatMtlShader
+ 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, // Output _mtl_o;.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // float4 tmpvar_1
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_1.w =
+ 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 1.0;. tmpvar_1
+ 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, // .xyz = _mtl_i.a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // position;. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, // _o.gl_Position =
+ 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // (_mtl_u.u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ViewProj * tmpva
+ 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, // r_1);. _mtl_o.v
+ 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // _color0 = _mtl_i
+ 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // .a_color0;. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, // l_o.v_stipple =
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _mtl_i.a_texcoor
+ 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, // d0;. return _mt
+ 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // l_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc
new file mode 100644
index 00000000000..9607a45509e
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc
@@ -0,0 +1,16 @@
+$input a_position, a_color0, a_texcoord0
+$output v_color0, v_stipple
+
+/*
+ * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+ v_color0 = a_color0;
+ v_stipple = a_texcoord0;
+}
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 1fb0497be85..03cf82b5373 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -6,7 +6,7 @@
#include <bx/bx.h>
#include <bgfx/bgfx.h>
#include <bx/string.h>
-#include <bx/readerwriter.h>
+#include <bx/crtimpl.h>
#include <time.h>
diff --git a/3rdparty/bgfx/examples/common/entry/entry_qnx.cpp b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
index af91ca7db40..c6544595229 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_qnx.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
@@ -5,7 +5,7 @@
#include "entry_p.h"
-#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_QNX
+#if ENTRY_CONFIG_USE_NOOP
#include <stdio.h>
@@ -76,4 +76,4 @@ int main(int _argc, char** _argv)
entry::main(_argc, _argv);
}
-#endif // ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_QNX
+#endif // ENTRY_CONFIG_USE_NOOP
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 502eed673ad..f44a421946a 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -13,6 +13,10 @@
#include "entry.h"
#include <string.h> // memcpy
+#ifndef ENTRY_CONFIG_USE_NOOP
+# define ENTRY_CONFIG_USE_NOOP (BX_PLATFORM_QNX || BX_PLATFORM_XBOXONE)
+#endif // ENTRY_CONFIG_USE_NOOP
+
#ifndef ENTRY_CONFIG_USE_SDL
# define ENTRY_CONFIG_USE_SDL BX_PLATFORM_STEAMLINK
#endif // ENTRY_CONFIG_USE_SDL
@@ -22,6 +26,7 @@
#endif // ENTRY_CONFIG_USE_GLFW
#if !defined(ENTRY_CONFIG_USE_NATIVE) \
+ && !ENTRY_CONFIG_USE_NOOP \
&& !ENTRY_CONFIG_USE_SDL \
&& !ENTRY_CONFIG_USE_GLFW
# define ENTRY_CONFIG_USE_NATIVE 1
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 989d0ae0667..07193b83ca7 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -29,6 +29,7 @@ BX_PRAGMA_DIAGNOSTIC_POP_CLANG()
#include <bx/thread.h>
#include <bx/handlealloc.h>
#include <bx/readerwriter.h>
+#include <bx/crtimpl.h>
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -219,7 +220,7 @@ namespace entry
# elif BX_PLATFORM_WINDOWS
return wmi.info.win.window;
# elif BX_PLATFORM_STEAMLINK
- return wmi.info.vivante.window;
+ return wmi.info.vivante.window;
# endif // BX_PLATFORM_
}
@@ -307,6 +308,7 @@ namespace entry
initTranslateKey(SDL_SCANCODE_PRINTSCREEN, Key::Print);
initTranslateKey(SDL_SCANCODE_KP_PLUS, Key::Plus);
initTranslateKey(SDL_SCANCODE_KP_MINUS, Key::Minus);
+ initTranslateKey(SDL_SCANCODE_GRAVE, Key::Tilde);
initTranslateKey(SDL_SCANCODE_F1, Key::F1);
initTranslateKey(SDL_SCANCODE_F2, Key::F2);
initTranslateKey(SDL_SCANCODE_F3, Key::F3);
diff --git a/3rdparty/bgfx/examples/common/entry/input.cpp b/3rdparty/bgfx/examples/common/entry/input.cpp
index c0d2686d293..bb9925990b0 100644
--- a/3rdparty/bgfx/examples/common/entry/input.cpp
+++ b/3rdparty/bgfx/examples/common/entry/input.cpp
@@ -11,6 +11,7 @@
#include <bx/allocator.h>
#include <bx/ringbuffer.h>
+#include <tinystl/string.h>
#include <tinystl/allocator.h>
#include <tinystl/unordered_map.h>
namespace stl = tinystl;
@@ -197,12 +198,12 @@ struct Input
void addBindings(const char* _name, const InputBinding* _bindings)
{
- m_inputBindingsMap.insert(stl::make_pair(_name, _bindings) );
+ m_inputBindingsMap.insert(stl::make_pair(stl::string(_name), _bindings) );
}
void removeBindings(const char* _name)
{
- InputBindingMap::iterator it = m_inputBindingsMap.find(_name);
+ InputBindingMap::iterator it = m_inputBindingsMap.find(stl::string(_name));
if (it != m_inputBindingsMap.end() )
{
m_inputBindingsMap.erase(it);
@@ -275,7 +276,7 @@ struct Input
}
}
- typedef stl::unordered_map<const char*, const InputBinding*> InputBindingMap;
+ typedef stl::unordered_map<stl::string, const InputBinding*> InputBindingMap;
InputBindingMap m_inputBindingsMap;
Mouse m_mouse;
Keyboard m_keyboard;
diff --git a/3rdparty/bgfx/examples/common/font/makefile b/3rdparty/bgfx/examples/common/font/makefile
index 13b0215ee97..38f4d0d7d86 100644
--- a/3rdparty/bgfx/examples/common/font/makefile
+++ b/3rdparty/bgfx/examples/common/font/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
index 230eb97e164..9acb796212f 100644
--- a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
@@ -822,8 +822,8 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
);
}
- bgfx::setVertexBuffer(vbh, bc.textBuffer->getVertexCount() );
- bgfx::setIndexBuffer(ibh, bc.textBuffer->getIndexCount() );
+ bgfx::setVertexBuffer(vbh, 0, bc.textBuffer->getVertexCount() );
+ bgfx::setIndexBuffer(ibh, 0, bc.textBuffer->getIndexCount() );
}
break;
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 593de84d168..11044efd9ae 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
@@ -1,10 +1,10 @@
-static const uint8_t fs_imgui_image_swizz_glsl[425] =
+static const uint8_t fs_imgui_image_swizz_glsl[565] =
{
0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x02, 0x01, 0x00, 0x00, // geLodEnabled....
0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x02, 0x01, 0x00, 0x00, // ...u_swizzle....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
- 0x00, 0x01, 0x00, 0x61, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...a...varying h
+ 0x00, 0x01, 0x00, 0xed, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // .......varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
@@ -13,20 +13,29 @@ static const uint8_t fs_imgui_image_swizz_glsl[425] =
0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // u_swizzle;.unifo
0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, // rm sampler2D s_t
0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // exColor;.void ma
- 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // in ().{. lowp v
- 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;.
- 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, // tmpvar_1.xyz = v
- 0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ec3(dot (texture
- 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // 2DLod (s_texC
- 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // olor, v_texcoord
- 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // 0, u_imageLodEna
- 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // bled.x), u_swizz
- 0x6c, 0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // le));. tmpvar_1
- 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8
- 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // * u_imageLodEna
- 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));. gl_F
- 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;.}...
+ 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // in ().{. lowp f
+ 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // loat tmpvar_1;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, // tmpvar_1 = dot
+ 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // (texture2DLod
+ 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, // (s_texColor, v_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, // texcoord0, u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, // geLodEnabled.x),
+ 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // u_swizzle);. l
+ 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec3 tmpvar_
+ 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x20, // 2;. tmpvar_2.x
+ 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // = tmpvar_1;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // pvar_2.y = tmpva
+ 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, // r_1;. tmpvar_2.
+ 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // z = tmpvar_1;.
+ 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // mediump vec4 tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_3;. tmpvar_
+ 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // 3.xyz = tmpvar_2
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_3.w =
+ 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, // (0.2 + (0.8 * u
+ 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, // _imageLodEnabled
+ 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // .y));. gl_FragC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, // olor = tmpvar_3;
+ 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}...
};
static const uint8_t fs_imgui_image_swizz_dx9[462] =
{
@@ -94,9 +103,9 @@ static const uint8_t fs_imgui_image_swizz_dx11[493] =
0x3e, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, // >6.... .........
0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // .....>..... .
};
-static const uint8_t fs_imgui_image_swizz_mtl[879] =
+static const uint8_t fs_imgui_image_swizz_mtl[1005] =
{
- 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH.o.><..`...us
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0xde, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH.o.><......us
0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
@@ -135,20 +144,28 @@ static const uint8_t fs_imgui_image_swizz_mtl[879] =
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, // _texcoord0), lev
0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // el(_mtl_u.u_imag
0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x29, // eLodEnabled.x)))
+ 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ;. half tmpvar_
+ 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, // 2;. tmpvar_2 =
+ 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, // ((half)dot ((flo
+ 0x61, 0x74, 0x34, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x5f, 0x6d, // at4)tmpvar_1, _m
+ 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x29, 0x29, // tl_u.u_swizzle))
0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. float tmpvar
- 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, // _2;. tmpvar_2 =
+ 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, // _3;. tmpvar_3 =
0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x5f, // (0.2 + (0.8 * _
0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, // mtl_u.u_imageLod
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // Enabled.y));. h
- 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // alf4 tmpvar_3;.
- 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_3.xyz =
- 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x64, 0x6f, 0x74, // half3(((half)dot
- 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ((float4)tmpvar
- 0x5f, 0x31, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x77, 0x69, // _1, _mtl_u.u_swi
- 0x7a, 0x7a, 0x6c, 0x65, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // zzle)));. tmpva
- 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x28, 0x74, 0x6d, 0x70, // r_3.w = half(tmp
- 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // var_2);. _mtl_o
- 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // .gl_FragColor =
- 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // tmpvar_3;. retu
- 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+ 0x61, 0x6c, 0x66, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // alf3 tmpvar_4;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, // tmpvar_4.x = tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_2;. tmpvar
+ 0x5f, 0x34, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // _4.y = tmpvar_2;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, // . tmpvar_4.z =
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // tmpvar_2;. half
+ 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_5;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // pvar_5.xyz = tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_4;. tmpvar_
+ 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // 5.w = half(tmpva
+ 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // r_3);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, // l_FragColor = tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, // pvar_5;. return
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 4cdc5f30fe5..60afe3df290 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -28,6 +28,7 @@
#include <bx/uint32_t.h>
#include <bx/fpumath.h>
#include <bx/handlealloc.h>
+#include <bx/crtimpl.h>
#include "imgui.h"
#include "ocornut_imgui.h"
@@ -454,11 +455,13 @@ struct Imgui
{
m_allocator = _allocator;
- if (NULL == m_allocator)
+#if BX_CONFIG_ALLOCATOR_CRT
+ if (NULL == _allocator)
{
static bx::CrtAllocator allocator;
m_allocator = &allocator;
}
+#endif // BX_CONFIG_ALLOCATOR_CRT
if (NULL == _data)
{
diff --git a/3rdparty/bgfx/examples/common/imgui/makefile b/3rdparty/bgfx/examples/common/imgui/makefile
index 70d3ff0e69d..965ac34d302 100644
--- a/3rdparty/bgfx/examples/common/imgui/makefile
+++ b/3rdparty/bgfx/examples/common/imgui/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/common/nanovg/makefile b/3rdparty/bgfx/examples/common/nanovg/makefile
index 13b0215ee97..38f4d0d7d86 100644
--- a/3rdparty/bgfx/examples/common/nanovg/makefile
+++ b/3rdparty/bgfx/examples/common/nanovg/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
index 1da34bd790f..e5795ad2131 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
@@ -30,6 +30,7 @@
#include <bx/bx.h>
#include <bx/allocator.h>
+#include <bx/crtimpl.h>
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4244); // warning C4244: '=' : conversion from '' to '', possible loss of data
diff --git a/3rdparty/bgfx/examples/common/shaderlib.sh b/3rdparty/bgfx/examples/common/shaderlib.sh
index a6a51199a1f..51f9b6a445f 100644
--- a/3rdparty/bgfx/examples/common/shaderlib.sh
+++ b/3rdparty/bgfx/examples/common/shaderlib.sh
@@ -367,4 +367,20 @@ float random(vec2 _uv)
return fract(sin(dot(_uv.xy, vec2(12.9898, 78.233) ) ) * 43758.5453);
}
+vec3 fixCubeLookup(vec3 _v, float _lod, float _topLevelCubeSize)
+{
+ // Reference:
+ // Seamless cube-map filtering
+ // http://the-witness.net/news/2012/02/seamless-cube-map-filtering/
+ float ax = abs(_v.x);
+ float ay = abs(_v.y);
+ float az = abs(_v.z);
+ float vmax = max(max(ax, ay), az);
+ float scale = 1.0 - exp2(_lod) / _topLevelCubeSize;
+ if (ax != vmax) { _v.x *= scale; }
+ if (ay != vmax) { _v.y *= scale; }
+ if (az != vmax) { _v.z *= scale; }
+ return _v;
+}
+
#endif // __SHADERLIB_SH__
diff --git a/3rdparty/bgfx/examples/makefile b/3rdparty/bgfx/examples/makefile
index 9e53c42cd5e..13ce9f336b8 100644
--- a/3rdparty/bgfx/examples/makefile
+++ b/3rdparty/bgfx/examples/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
@@ -30,27 +30,7 @@ rebuild:
# @make -s --no-print-directory rebuild -C 25-c99
# @make -s --no-print-directory rebuild -C 26-occlusion
@make -s --no-print-directory rebuild -C 27-terrain
+ @make -s --no-print-directory rebuild -C 28-wireframe
@make -s --no-print-directory rebuild -C common/font
@make -s --no-print-directory rebuild -C common/imgui
@make -s --no-print-directory rebuild -C common/nanovg
-
-metal:
- @make -s --no-print-directory TARGET=5 -C 01-cubes
- @make -s --no-print-directory TARGET=5 -C 03-raymarch
- @make -s --no-print-directory TARGET=5 -C 04-mesh
- @make -s --no-print-directory TARGET=5 -C 05-instancing
- @make -s --no-print-directory TARGET=5 -C 06-bump
- @make -s --no-print-directory TARGET=5 -C 07-callback
- @make -s --no-print-directory TARGET=5 -C 08-update
- @make -s --no-print-directory TARGET=5 -C 09-hdr
- @make -s --no-print-directory TARGET=5 -C 12-lod
- @make -s --no-print-directory TARGET=5 -C 13-stencil
- @make -s --no-print-directory TARGET=5 -C 14-shadowvolumes
- @make -s --no-print-directory TARGET=5 -C 15-shadowmaps-simple
- @make -s --no-print-directory TARGET=5 -C 16-shadowmaps
- @make -s --no-print-directory TARGET=5 -C 18-ibl
- @make -s --no-print-directory TARGET=5 -C 19-oit
- @make -s --no-print-directory TARGET=5 -C 21-deferred
- @make -s --no-print-directory TARGET=5 -C 23-vectordisplay
- @make -s --no-print-directory TARGET=5 -C 24-nbody
- @make -s --no-print-directory TARGET=5 -C 27-terrain
diff --git a/3rdparty/bgfx/examples/runtime/meshes/bunny.bin b/3rdparty/bgfx/examples/runtime/meshes/bunny.bin
index b34244a745d..794ec22c7fe 100644
--- a/3rdparty/bgfx/examples/runtime/meshes/bunny.bin
+++ b/3rdparty/bgfx/examples/runtime/meshes/bunny.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/meshes/hollowcube.bin b/3rdparty/bgfx/examples/runtime/meshes/hollowcube.bin
index 69a4a38c125..0ea300901e5 100644
--- a/3rdparty/bgfx/examples/runtime/meshes/hollowcube.bin
+++ b/3rdparty/bgfx/examples/runtime/meshes/hollowcube.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/meshes/orb.bin b/3rdparty/bgfx/examples/runtime/meshes/orb.bin
index 336f3680565..ac9455a25a5 100644
--- a/3rdparty/bgfx/examples/runtime/meshes/orb.bin
+++ b/3rdparty/bgfx/examples/runtime/meshes/orb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
index d3ea732918d..155058f3846 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin
index 13b5e270386..07ca7e697d5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.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 e599c4ec016..b27f3fd3fc7 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 c2ac4161f46..03a3f89b28f 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 acb5c01247e..f85d0ec52b1 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 3430e96d811..39d115c48e3 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 6c4859be087..13ad93358d9 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 95467349adc..d688775bd11 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 d1612f8ca11..00300aa3a4e 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 f6b2ac6587d..3fa09702654 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 52ac4285db6..12eaab3eb5e 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 221a4278dd8..98f5ff1429a 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 03b37762125..07e12b43e1b 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 11f1c23b014..cde6f19fc26 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 19d9bba4d4a..2faada8a015 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 9581dddcd64..76b37271222 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 8746b286f44..cf8a001ccb4 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 9957e3b8588..67c95d9110b 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 3c72697a9d3..748714f916d 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 834b235eebe..26fac391383 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 0ae83c419f1..27d528221a8 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 87536cda4d4..e2184d5b475 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 5129fdb6b0b..c06948c1609 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 08a5970da44..91716e56c98 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 39d3bff0226..338bd6fc819 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 0991b66851f..4ecfdbb92da 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_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_mesh.bin
new file mode 100644
index 00000000000..76647c0b804
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_wireframe.bin
new file mode 100644
index 00000000000..3706b830375
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
index b9febc31cb4..90127469c67 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
index 5aa032ea932..8c29510aa1b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_mesh.bin
new file mode 100644
index 00000000000..f65702b92e7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_wireframe.bin
new file mode 100644
index 00000000000..076f9d1dabe
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_wf_wireframe.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 3a3ecaba313..74ad610bbf1 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 2e49131b0a3..031de157008 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_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin
index 99f5564ce4d..bd5c93be505 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 420080db2fd..046ad528e4e 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 2b80ccad6c3..ae7c92272c0 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 3bbfea99ae7..a47bbbbb521 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 c9d81f6fa64..4c1eb4fff5b 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 308f93ef2e3..e1964e28fd8 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 3de4dcbce87..ac0c477d7e5 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 c53e8814a34..42ffa588595 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 d29c6e8c1ed..c57f980bdbf 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 ca069354ca4..3035d4d8848 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 c316724a908..8169fc8a1a3 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 bef6549d95b..c9b5cd1b755 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 55bce42f02a..cccab4c488c 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 7427157c5fa..7b2afedb883 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 a8c173e3c39..100b6afa14c 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 984458101ee..ff07f745bcf 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 e96824aae10..de0f7436c62 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 bf00e8523f3..a58ecb13461 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 ac96c99da43..e5654bea62a 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 0e69a3950ac..fabcb490544 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 a1ce662b545..d01917f3f12 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 80befb85a01..d283cc99403 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 f0bdfd66f7b..14941129ad7 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 856c659ffe6..9d5f242964f 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_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.bin
new file mode 100644
index 00000000000..06e389eb117
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.bin
new file mode 100644
index 00000000000..6d992770f5e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.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 4218e8ab377..f0c040a4ce1 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 c0e84000a3a..0c8d2ffaf25 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_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.bin
new file mode 100644
index 00000000000..6f13919f414
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin
new file mode 100644
index 00000000000..54e1d124e03
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin
index 72c5eaf6bb2..1faf1aeb562 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
index 048a96abc67..d74d461cfac 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
index 1059fa84416..ddd207ccf9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
index 5e96353619c..75c93b113e3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
index bb2e9aeafe3..76079d0ec8d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.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 df53debb5b1..e594526cf19 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 2ae88a47fff..3b51e727e87 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 700694d399e..72ed5111aee 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 525a27cdd51..7c77f0cbbfe 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 04c38666671..789141dcccc 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 27d8231f863..3c1d07e15f6 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 4ca43066c34..1503d413ab3 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 4b3fea74139..f79e214b2da 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 7c5095f0e29..c6f6593ea1e 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 b77c2c824c4..74c0c1cf2a9 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 3988caee216..c0e05951bdd 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 9a8ae99224e..19062f01b8c 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 1965c493afa..6187725d9f2 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 31b8e22ba35..133e398538c 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 c867113fd8c..422bf35ec8e 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 c78a27741db..9f78cbeee15 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 85cebb56f07..5ee79f73a28 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 93c5b80ef33..4bb6fa06e51 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 4769169ac7f..456040c60a3 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 18a43e1ea27..fc57ca84ebc 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 f42d12496d6..ccababe2e1b 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 50e5c4f14cb..74ff8b8dd26 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 3e96ec50a4c..754e424ea12 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 df85bd9510c..53f2ea31f22 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 2d63ad15e45..0b0a1bbbf16 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 772ec28f6ed..ad331bd4ffd 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 d8509532b15..c50ce9cc452 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 3997cd62a98..d6bdeb0b6c9 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 a366ac46963..c1c6b516290 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 0fd472eda28..db9d665275d 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 d8509532b15..c50ce9cc452 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_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
index 2222aa66d6d..c2fb7eac9cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin
index cbe487457f7..4b7b683d8cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.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 5844d74493e..227b76c4fa2 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.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin
index 98147ab064a..3262874eaf3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.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 384de3f5387..3c4b91fdcca 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/gles/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lighting.bin
index 776c24867fd..f3e5bd234a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lighting.bin
index 3ceba55ea2f..f35896a59d8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
index b7b8fb4cd0e..1566fb77bef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_mesh.bin
new file mode 100644
index 00000000000..a090c615b90
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_wireframe.bin
new file mode 100644
index 00000000000..f39c7916d82
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
index fa99121843b..bbd50acd51f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
index 6a3f2f2e619..d0c60ada93c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_mesh.bin
new file mode 100644
index 00000000000..39b2f0bbc48
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_wireframe.bin
new file mode 100644
index 00000000000..f456e30f22c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
index 146f0f80889..9a0b306fb00 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
index 8c0aa81a7c4..bd4bd9b6086 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
index 04eb1a408b5..3b695029314 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
index 2e35f1e240e..3260e151099 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin
index 16c6969b746..3ac60719279 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.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 1bfc2361d5c..32f69e5aed2 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 f8ae5bc9b81..56a47cab952 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 f5a580f1289..4f66a07bb0f 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 1e7a4d25acd..7249ac3fc01 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 3c41f4ed3f7..57a0637840f 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 b930d047c81..daa9d7bc412 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 5b5e123eaec..5213127e2b3 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 9e5441e5839..0728fd38ac9 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 62a4fab7411..40a6fe35f34 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 7ae79a1339c..27694944113 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 52a0b821316..68de56248ff 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 08808de87a7..e9d07c376e4 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 3218ab5f3cc..eceb44fdf0f 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 0f8e094c7e9..d7893ba4369 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 797ec0bcdbe..3638832c180 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 c649bf07a24..957f309bc5e 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 5f0c1c7c365..03143cba754 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 5b07162b001..202b3b76236 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 34d5c091ce2..7d6487b1514 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 53f13abd5c8..d8f9e902fac 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 3ba96599cd4..46a9e14444f 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 d1d4d641bdb..5af575e1be6 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 5b675445db3..17290531064 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 cbcecf1feb4..79058cad0d7 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 a2aeda4ead7..5915c930f4e 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 fd9d3902609..93b5a2a0bb2 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 f1180dceb51..f8fa7a5d8b6 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 960eba1e085..6148b430945 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 a592392cdd6..d59593b94a3 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 acda8d5f64f..6602f5e43e0 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 f1180dceb51..f8fa7a5d8b6 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_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
index 2222aa66d6d..5bbd5e24023 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin
index cbe487457f7..04a7b089fef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.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 a036a3a6254..8e0fb26cd2b 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.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin
index 98147ab064a..946d0e83e3b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.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 7286ee6bf99..c590fd26595 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/glsl/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lighting.bin
index 4135af924d1..7977435653d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lighting.bin
index aa333ccb02c..b53189391ea 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
index 8b9af3fc299..f5f2c0271dd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_mesh.bin
new file mode 100644
index 00000000000..d297e624e2a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_wireframe.bin
new file mode 100644
index 00000000000..c6118cce70f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
index 172605cd36f..924d39fbdcf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
index dcf57829e4a..be3bea2edbd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_mesh.bin
new file mode 100644
index 00000000000..558881a8f49
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_wireframe.bin
new file mode 100644
index 00000000000..70a464fa95a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
index 3ee33011539..917de5500a2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
index f36f1f5ebba..1fd0392deaa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
index 2dae0e8f200..e7e9e98bb8e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
index ef295e63d22..76eb570a740 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
index 2ef7b1b065c..0cf73b0621a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
index 3772fd2de80..5b4ccf94d83 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
index 5b9813e8595..9b2b3ac0881 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
index c5a8b4b215c..04b4c14e4c1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
index c4d87c03987..5c8a98f584a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 2eeed8cde91..6c95e24e176 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index 4ce8af71a63..aa490324ea3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
index ca3449ca4d2..eebf557cdfa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
index d8fe2fc1ae9..efd340c5844 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
index 5089c8f1d23..f168696c34b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
index 1884107d6bc..8b57ab983a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index 2fa958d85bd..78c3faa2538 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index 6e7bffc7959..0e2962e2781 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
index af048da8a6f..7a75fac01a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
index 467c47d243e..5e0d6d5c618 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
index 6faad277fd6..f4ea4faa7ac 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
index 3e0fbb37abc..a8fa89d7f0e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 31dd9f7c420..a14ca23e82e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index 3a5f285cf37..89e922cc5c5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
index e7c3ad1fa1a..d9c75ba069a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
index a76c572dc2a..b20618eeb15 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
index 8915dd6c718..3822c869067 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
index 79ddb6551c8..1f0b147ec5a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index 392fceccbd3..1dc620e1147 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index b377bf7db6a..94be509057a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
index 953b60d9b18..4490f1ef874 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
index ae7007c7af8..52de7234847 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
index b5fe202adc9..76c36a25cde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
index f42eef2fcc8..45aba573279 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
index ccec78ba002..2fe89fbc1e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
index 67b12c79dcc..4d2a474262a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
index 436d6d4471f..e48079000cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
index cd9a6e88530..60c98b10a77 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
index 94abea67646..54fe70de383 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
index b5fe202adc9..76c36a25cde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
index f42eef2fcc8..45aba573279 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
index 187800af846..7fddc0e0d93 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
index 747c3963734..682bfa5fa57 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
index 5c173c76aac..862531d061c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
index 26a2cc3de69..fb1631dffaf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
index 5281abc6100..b5140b48e9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
index 4d4b4469ace..d4ee3580678 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
index ec312f8a3d8..f6898291c93 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
index b0f45e5b5b6..229840b069a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin
new file mode 100644
index 00000000000..bb0f5dd11e5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
index c36a93d60b5..f272476055b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
index aa8f3cb2e9a..dfdd88e41ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin
new file mode 100644
index 00000000000..3628dd93e5d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin
new file mode 100644
index 00000000000..e00b6fa3f91
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
index c29d5680e10..b842f18e72f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
index ada939a9055..0052efc7049 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin
new file mode 100644
index 00000000000..003bac66ae8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin
new file mode 100644
index 00000000000..135157b549a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin
new file mode 100644
index 00000000000..caec269a5d4
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin
new file mode 100644
index 00000000000..b72c2f84c67
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/bolonga_irr.dds b/3rdparty/bgfx/examples/runtime/textures/bolonga_irr.dds
new file mode 100644
index 00000000000..618b3342961
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/bolonga_irr.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/bolonga_lod.dds b/3rdparty/bgfx/examples/runtime/textures/bolonga_lod.dds
new file mode 100644
index 00000000000..139328bed2d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/bolonga_lod.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/ennis_irr.dds b/3rdparty/bgfx/examples/runtime/textures/ennis_irr.dds
deleted file mode 100644
index 1a55992e19c..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/ennis_irr.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/ennis_lod.dds b/3rdparty/bgfx/examples/runtime/textures/ennis_lod.dds
deleted file mode 100644
index 1bda2347a91..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/ennis_lod.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/grace_irr.dds b/3rdparty/bgfx/examples/runtime/textures/grace_irr.dds
deleted file mode 100644
index 85fa2fd495d..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/grace_irr.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/grace_lod.dds b/3rdparty/bgfx/examples/runtime/textures/grace_lod.dds
deleted file mode 100644
index a76097b0646..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/grace_lod.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/kyoto_irr.dds b/3rdparty/bgfx/examples/runtime/textures/kyoto_irr.dds
new file mode 100644
index 00000000000..c3f5ccfa72c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/kyoto_irr.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/kyoto_lod.dds b/3rdparty/bgfx/examples/runtime/textures/kyoto_lod.dds
new file mode 100644
index 00000000000..dc2e0552072
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/kyoto_lod.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/pisa_irr.dds b/3rdparty/bgfx/examples/runtime/textures/pisa_irr.dds
deleted file mode 100644
index 34f355cae2d..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/pisa_irr.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/pisa_lod.dds b/3rdparty/bgfx/examples/runtime/textures/pisa_lod.dds
deleted file mode 100644
index b8afe83cf21..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/pisa_lod.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/uffizi_irr.dds b/3rdparty/bgfx/examples/runtime/textures/uffizi_irr.dds
deleted file mode 100644
index 5a1013108dd..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/uffizi_irr.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/uffizi_lod.dds b/3rdparty/bgfx/examples/runtime/textures/uffizi_lod.dds
deleted file mode 100644
index fe20eabba29..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/uffizi_lod.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/wells_irr.dds b/3rdparty/bgfx/examples/runtime/textures/wells_irr.dds
deleted file mode 100644
index b972bcfc9a5..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/wells_irr.dds
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/wells_lod.dds b/3rdparty/bgfx/examples/runtime/textures/wells_lod.dds
deleted file mode 100644
index d66a0c443db..00000000000
--- a/3rdparty/bgfx/examples/runtime/textures/wells_lod.dds
+++ /dev/null
Binary files differ