Previous 199869 Revisions Next

r37059 Friday 27th March, 2015 at 10:19:36 UTC by Joakim Larsson Edström
Fixed compilation error due to out of bounds strcpy in teh support for corvus - not tested!
[/trunk]makefile
[3rdparty/bgfx].editorconfig README.md makefile
[3rdparty/bgfx/3rdparty/glsl-optimizer]CMakeLists.txt Changelog.md
[3rdparty/bgfx/3rdparty/glsl-optimizer/include]c99_compat.h
[3rdparty/bgfx/3rdparty/glsl-optimizer/src]glsl_optimizer_lib.gyp
[3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl]Makefile builtin_functions.cpp builtin_variables.cpp glsl_optimizer.cpp ir_print_glsl_visitor.cpp ir_print_glsl_visitor.h ir_print_metal_visitor.cpp linker.cpp loop_analysis.cpp loop_analysis.h loop_controls.cpp main.cpp opt_algebraic.cpp standalone_scaffolding.cpp
[3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp]glcpp-lex.c glcpp-lex.l
[3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main]compiler.h
[3rdparty/bgfx/3rdparty/glsl-optimizer/tests]global-mutable-inES.txt global-mutable-inES3.txt global-mutable-outES.txt global-mutable-outES3.txt global-mutable-outES3Metal.txt glsl_optimizer_tests.cpp
[3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment]array-const-out.txt array-const-outES.txt array-const-outES3.txt array-const-outES3Metal.txt array-constconst-out.txt array-constconst-outES.txt array-constconst-outES3.txt array-constconst-outES3Metal.txt ast-outES3.txt bug-loop-undeclaredinductor-inES3.txt bug-loop-undeclaredinductor-outES3.txt bug-loop-undeclaredinductor-outES3Metal.txt float-literals-in.txt float-literals-out.txt intrinsics-inES3.txt intrinsics-outES.txt intrinsics-outES3.txt intrinsics-outES3Metal.txt loop-for-inES3.txt loop-forafterdiscard-inES3.txt loop-fornounroll-outES.txt loop-forunbounded-outES.txt opt-movevars-sideeffect2-outES.txt prec-default-outES.txt prec-inlineexpr1-outES.txt prec-inlineexpr2-outES.txt prec-matrix-constr-inES3.txt prec-matrix-constr-outES3.txt prec-matrix-constr-outES3Metal.txt sampler-precision-inES3.txt tex2dlod-outES.txt texOffset-outES3.txt texProj-outES.txt z-DirLMBasis-inES3.txt z-DirLMBasis-outES3.txt z-DirLMBasis-outES3Metal.txt z-LightShaftsCoord-outES3.txt z-alphabumpspec-inES3.txt z-alphabumpspec-outES3.txt z-alphabumpspec-outES3Metal.txt z-collectshadows-inES3.txt z-fxaa-preset3-inES3.txt z-fxaa-preset3-out.txt z-fxaa-preset3-outES3.txt z-fxaa-preset3-outES3Metal.txt z-fxaa3-11-consolepc-outES.txt z-fxaa3-11-pc39-outES.txt z-prepasslight-inES3.txt z-prepasslight-outES.txt z-prepasslight-outES3.txt z-prepasslight-outES3Metal.txt z-treeleafloop-inES3.txt z-unishader-dirlm-inES3.txt z-unishader-dirlm-outES3.txt z-unishader-dirlm-outES3Metal.txt zun-MobileBumpSpec-inES3.txt zun-SSAO24-outES3.txt zun-SSAO24-outES3Metal.txt zun-SSAO8-outES.txt
[3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex]MF-GodRays-outES.txt MF-GodRays-outES3.txt bug-swizzle-lhs-cast-outES3.txt bug-swizzle-lhs-cast-outES3Metal.txt inputs-outES3.txt inputs-outES3Metal.txt loops-for-withvec4-outES3.txt loops-for-withvec4inductorW-inES3.txt loops-for-withvec4inductorW-outES3.txt loops-for-withvec4inductorW-outES3Metal.txt opt-matrix-transpose-mul-outES3.txt opt-normalize-out.txt uniforms-arrays-outES3.txt z-NichsHybridLightVectorInsertBug-in.txt z-NichsHybridLightVectorInsertBug-inES.txt z-NichsHybridLightVectorInsertBug-inES3.txt z-NichsHybridLightVectorInsertBug-out.txt z-NichsHybridLightVectorInsertBug-outES.txt z-NichsHybridLightVectorInsertBug-outES3.txt z-NichsHybridLightVectorInsertBug-outES3Metal.txt z-treeleaf-outES3.txt zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
[3rdparty/bgfx/3rdparty/khronos/gl]glext.h
[3rdparty/bgfx/3rdparty/ocornut-imgui]imgui.h
[3rdparty/bgfx/3rdparty/sdf]sdf.h
[3rdparty/bgfx/3rdparty/stb]stb_image.c
[3rdparty/bgfx/examples/02-metaballs]fs_metaballs.bin.h metaballs.cpp
[3rdparty/bgfx/examples/05-instancing]instancing.cpp
[3rdparty/bgfx/examples/06-bump]bump.cpp
[3rdparty/bgfx/examples/07-callback]callback.cpp
[3rdparty/bgfx/examples/08-update]update.cpp
[3rdparty/bgfx/examples/09-hdr]hdr.cpp
[3rdparty/bgfx/examples/12-lod]lod.cpp
[3rdparty/bgfx/examples/13-stencil]stencil.cpp
[3rdparty/bgfx/examples/14-shadowvolumes]shadowvolumes.cpp
[3rdparty/bgfx/examples/15-shadowmaps-simple]shadowmaps_simple.cpp
[3rdparty/bgfx/examples/16-shadowmaps]shadowmaps.cpp
[3rdparty/bgfx/examples/20-nanovg]blendish.h nanovg.cpp
[3rdparty/bgfx/examples/21-deferred]deferred.cpp
[3rdparty/bgfx/examples/23-vectordisplay]main.cpp vectordisplay.cpp
[3rdparty/bgfx/examples/24-nbody]nbody.cpp
[3rdparty/bgfx/examples/25-c99]helloworld.c
[3rdparty/bgfx/examples/common]bounds.cpp
[3rdparty/bgfx/examples/common/entry]entry.cpp entry_p.h
[3rdparty/bgfx/examples/common/font]fs_font_basic.bin.h fs_font_distance_field.bin.h fs_font_distance_field_subpixel.bin.h
[3rdparty/bgfx/examples/common/imgui]fs_imgui_cubemap.bin.h fs_imgui_image.bin.h fs_imgui_image_swizz.bin.h fs_imgui_latlong.bin.h imgui.cpp makefile ocornut_imgui.cpp vs_imgui_latlong.bin.h
[3rdparty/bgfx/examples/common/nanovg]nanovg.cpp
[3rdparty/bgfx/examples/runtime/shaders/gles]fs_bump.bin fs_callback.bin fs_deferred_combine.bin fs_deferred_geom.bin fs_deferred_light.bin fs_hdr_blur.bin fs_hdr_bright.bin fs_hdr_lum.bin fs_hdr_lumavg.bin fs_hdr_mesh.bin fs_hdr_skybox.bin fs_hdr_tonemap.bin fs_ibl_mesh.bin fs_ibl_skybox.bin fs_mesh.bin fs_oit_wb.bin fs_oit_wb_separate.bin fs_particle.bin fs_raymarching.bin fs_shadowmaps_color_lightning_esm.bin fs_shadowmaps_color_lightning_esm_csm.bin fs_shadowmaps_color_lightning_esm_linear.bin fs_shadowmaps_color_lightning_esm_linear_csm.bin fs_shadowmaps_color_lightning_esm_linear_omni.bin fs_shadowmaps_color_lightning_esm_omni.bin fs_shadowmaps_color_lightning_hard.bin fs_shadowmaps_color_lightning_hard_csm.bin fs_shadowmaps_color_lightning_hard_linear.bin fs_shadowmaps_color_lightning_hard_linear_csm.bin fs_shadowmaps_color_lightning_hard_linear_omni.bin fs_shadowmaps_color_lightning_hard_omni.bin fs_shadowmaps_color_lightning_pcf.bin fs_shadowmaps_color_lightning_pcf_csm.bin fs_shadowmaps_color_lightning_pcf_linear.bin fs_shadowmaps_color_lightning_pcf_linear_csm.bin fs_shadowmaps_color_lightning_pcf_linear_omni.bin fs_shadowmaps_color_lightning_pcf_omni.bin fs_shadowmaps_color_lightning_vsm.bin fs_shadowmaps_color_lightning_vsm_csm.bin fs_shadowmaps_color_lightning_vsm_linear.bin fs_shadowmaps_color_lightning_vsm_linear_csm.bin fs_shadowmaps_color_lightning_vsm_linear_omni.bin fs_shadowmaps_color_lightning_vsm_omni.bin fs_shadowmaps_color_texture.bin fs_shadowmaps_hblur.bin fs_shadowmaps_hblur_vsm.bin fs_shadowmaps_packdepth.bin fs_shadowmaps_packdepth_linear.bin fs_shadowmaps_packdepth_vsm.bin fs_shadowmaps_packdepth_vsm_linear.bin fs_shadowmaps_unpackdepth.bin fs_shadowmaps_unpackdepth_vsm.bin fs_shadowmaps_vblur.bin fs_shadowmaps_vblur_vsm.bin fs_shadowvolume_color_lightning.bin fs_shadowvolume_color_texture.bin fs_shadowvolume_svbacktex1.bin fs_shadowvolume_svbacktex2.bin fs_shadowvolume_svfronttex1.bin fs_shadowvolume_svfronttex2.bin fs_shadowvolume_svside.bin fs_shadowvolume_svsidetex.bin fs_shadowvolume_texture_lightning.bin fs_sms_mesh.bin fs_sms_mesh_pd.bin fs_sms_shadow_pd.bin fs_stencil_color_lightning.bin fs_stencil_color_texture.bin fs_stencil_texture_lightning.bin fs_tree.bin
[3rdparty/bgfx/examples/runtime/shaders/glsl]cs_init_instances.bin cs_update_instances.bin fs_bump.bin fs_callback.bin fs_deferred_combine.bin fs_deferred_light.bin fs_hdr_blur.bin fs_hdr_bright.bin fs_hdr_lum.bin fs_hdr_mesh.bin fs_hdr_tonemap.bin fs_mesh.bin fs_oit_wb.bin fs_oit_wb_separate.bin fs_raymarching.bin fs_shadowmaps_color_lightning_esm.bin fs_shadowmaps_color_lightning_esm_csm.bin fs_shadowmaps_color_lightning_esm_linear.bin fs_shadowmaps_color_lightning_esm_linear_csm.bin fs_shadowmaps_color_lightning_esm_linear_omni.bin fs_shadowmaps_color_lightning_esm_omni.bin fs_shadowmaps_color_lightning_hard.bin fs_shadowmaps_color_lightning_hard_csm.bin fs_shadowmaps_color_lightning_hard_linear.bin fs_shadowmaps_color_lightning_hard_linear_csm.bin fs_shadowmaps_color_lightning_hard_linear_omni.bin fs_shadowmaps_color_lightning_hard_omni.bin fs_shadowmaps_color_lightning_pcf.bin fs_shadowmaps_color_lightning_pcf_csm.bin fs_shadowmaps_color_lightning_pcf_linear.bin fs_shadowmaps_color_lightning_pcf_linear_csm.bin fs_shadowmaps_color_lightning_pcf_linear_omni.bin fs_shadowmaps_color_lightning_pcf_omni.bin fs_shadowmaps_color_lightning_vsm.bin fs_shadowmaps_color_lightning_vsm_csm.bin fs_shadowmaps_color_lightning_vsm_linear.bin fs_shadowmaps_color_lightning_vsm_linear_csm.bin fs_shadowmaps_color_lightning_vsm_linear_omni.bin fs_shadowmaps_color_lightning_vsm_omni.bin fs_shadowmaps_color_texture.bin fs_shadowmaps_hblur.bin fs_shadowmaps_hblur_vsm.bin fs_shadowmaps_packdepth.bin fs_shadowmaps_packdepth_linear.bin fs_shadowmaps_unpackdepth.bin fs_shadowmaps_vblur.bin fs_shadowmaps_vblur_vsm.bin fs_shadowvolume_color_lightning.bin fs_shadowvolume_color_texture.bin fs_shadowvolume_texture_lightning.bin fs_sms_mesh.bin fs_sms_mesh_pd.bin fs_sms_shadow_pd.bin fs_stencil_color_lightning.bin fs_stencil_color_texture.bin fs_stencil_texture_lightning.bin fs_tree.bin
[3rdparty/bgfx/include]bgfx.c99.h bgfx.h bgfxdefines.h
[3rdparty/bgfx/scripts]bgfx.lua example-common.lua genie.lua shaderc.lua
[3rdparty/bgfx/src]bgfx.cpp bgfx_p.h config.h glcontext_eagl.h glcontext_eagl.mm glcontext_egl.cpp glcontext_egl.h glcontext_glx.cpp glcontext_glx.h glcontext_nsgl.h glcontext_nsgl.mm glcontext_ppapi.cpp glcontext_ppapi.h glcontext_wgl.cpp glcontext_wgl.h image.cpp ovr.cpp ovr.h renderer_d3d11.cpp renderer_d3d11.h renderer_d3d9.cpp renderer_gl.cpp renderer_gl.h
[3rdparty/bgfx/tools/geometryc]geometryc.cpp
[3rdparty/bgfx/tools/shaderc]shaderc.cpp shaderc_d3d11.cpp shaderc_d3d9.cpp shaderc_dx11.cpp* shaderc_dx9.cpp* shaderc_glsl.cpp
[3rdparty/bx/3rdparty/CL]cl_platform.h
[3rdparty/bx/include/bx]fpumath.h platform.h radixsort.h ringbuffer.h uint32_t.h
[3rdparty/bx/include/tinystl]hash_base.h string.h unordered_set.h vector.h
[3rdparty/bx/scripts]toolchain.lua
[3rdparty/bx/tests]unordered_set_copyctor.cpp unordered_set_pod.cpp
[3rdparty/bx/tools/bin/darwin]genie
[3rdparty/bx/tools/bin/linux]genie
[3rdparty/bx/tools/bin/windows]genie.exe
[3rdparty/genie]README.md
[3rdparty/genie/build/gmake.darwin]genie.make
[3rdparty/genie/build/gmake.linux]genie.make
[3rdparty/genie/build/gmake.windows]genie.make
[3rdparty/genie/scripts]genie.lua
[3rdparty/genie/src/actions/make]make_cpp.lua
[3rdparty/genie/src/actions/vstudio]vs2010_vcxproj.lua vs2010_vcxproj_filters.lua
[3rdparty/genie/src/actions/xcode]xcode_common.lua
[3rdparty/genie/src/base]api.lua bake.lua
[3rdparty/genie/src/host]os_ticks.c premake.c premake.h scripts.c version.h
[3rdparty/genie/src/host/lua-5.2.3]Makefile* README*
[3rdparty/genie/src/host/lua-5.2.3/doc]contents.html* logo.gif* lua.1* lua.css* luac.1* manual.css* manual.html* osi-certified-72x60.png* readme.html*
[3rdparty/genie/src/host/lua-5.2.3/src]Makefile* lapi.c* lapi.h* lauxlib.c* lauxlib.h* lbaselib.c* lbitlib.c* lcode.c* lcode.h* lcorolib.c* lctype.c* lctype.h* ldblib.c* ldebug.c* ldebug.h* ldo.c* ldo.h* ldump.c* lfunc.c* lfunc.h* lgc.c* lgc.h* linit.c* liolib.c* llex.c* llex.h* llimits.h* lmathlib.c* lmem.c* lmem.h* loadlib.c* lobject.c* lobject.h* lopcodes.c* lopcodes.h* loslib.c* lparser.c* lparser.h* lstate.c* lstate.h* lstring.c* lstring.h* lstrlib.c* ltable.c* ltable.h* ltablib.c* ltm.c* ltm.h* lua.c* lua.h* lua.hpp* luac.c* luaconf.h* lualib.h* lundump.c* lundump.h* lvm.c* lvm.h* lzio.c* lzio.h*
[3rdparty/genie/src/host/lua-5.3.0]Makefile README
[3rdparty/genie/src/host/lua-5.3.0/doc]contents.html logo.gif lua.1 lua.css luac.1 manual.css manual.html osi-certified-72x60.png readme.html
[3rdparty/genie/src/host/lua-5.3.0/src]Makefile lapi.c lapi.h lauxlib.c lauxlib.h lbaselib.c lbitlib.c lcode.c lcode.h lcorolib.c lctype.c lctype.h ldblib.c ldebug.c ldebug.h ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h linit.c liolib.c llex.c llex.h llimits.h lmathlib.c lmem.c lmem.h loadlib.c lobject.c lobject.h lopcodes.c lopcodes.h loslib.c lparser.c lparser.h lprefix.h lstate.c lstate.h lstring.c lstring.h lstrlib.c ltable.c ltable.h ltablib.c ltm.c ltm.h lua.c lua.h lua.hpp luac.c luaconf.h lualib.h lundump.c lundump.h lutf8lib.c lvm.c lvm.h lzio.c lzio.h
[3rdparty/genie/src/tools]gcc.lua
[3rdparty/sqlite3]sqlite3.c
[hash]abc80.xml* abc80_cass.xml abc80_flop.xml famicom_flop.xml gamegear.xml nes.xml pc88va.xml pet_rom.xml snes.xml snread.xml
[scripts]depfilter.awk genie.lua toolchain.lua
[scripts/src]3rdparty.lua bus.lua cpu.lua emu.lua lib.lua machine.lua main.lua netlist.lua osd.lua* osd_cfg.lua* sound.lua tools.lua video.lua
[scripts/src/osd]modules.lua osdmini.lua osdmini_cfg.lua sdl.lua sdl_cfg.lua windows.lua windows_cfg.lua
[scripts/target/ldplayer]ldplayer.lua
[scripts/target/mame]mame.lua tiny.lua
[scripts/target/mess]mess.lua tiny.lua
[scripts/target/ume]tiny.lua ume.lua
[src/build]makedep.c* makemak.c*
[src/emu]attotime.h emucore.h luaengine.c machine.c profiler.h
[src/emu/bus/abcbus]abc890.c abc890.h abcbus.c abcbus.h dos.c* dos.h* fd2.c fd2.h lux10828.c lux10828.h memcard.c memcard.h ram.c ram.h
[src/emu/bus/ieee488]c8050fdc.c c8050fdc.h
[src/emu/bus/nes]nes_pcb.inc
[src/emu/cpu/hmcs40]hmcs40.c
[src/emu/cpu/m68000]m68kcpu.h m68kops.c m68kops.h makefile
[src/emu/cpu/mips]mips3.c mips3.h mips3drc.c
[src/emu/cpu/nec]v53.c
[src/emu/cpu/sh4]sh4.c sh4.h
[src/emu/machine]6522via.c 6522via.h hdc9234.c hdc9234.h mos6530n.c mos6530n.h pci.c vrc4373.c vrc4373.h z80pio.c z80pio.h
[src/emu/netlist]plists.h
[src/emu/sound]discrete.h es1373.c es1373.h fm.h iremga20.c l7a1045_l6028_dsp_a.c l7a1045_l6028_dsp_a.h okim9810.c okim9810.h segapcm.c tms5220.c tms5220.h
[src/emu/ui]ui.c
[src/emu/video]pc_vga.c pc_vga.h rgbvmx.h
[src/lib/formats]abcfd2_dsk.c abcfd2_dsk.h
[src/lib/util]delegate.h
[src/mame]mame.lst
[src/mame/audio]dcs.c exidy.c hng64.c wiping.c wiping.h
[src/mame/drivers]alpha68k.c berzerk.c bigstrkb.c cheekyms.c clshroad.c cninja.c cps1.c cps2.c cv1k.c fruitpc.c goldstar.c hexion.c hng64.c invqix.c iteagle.c jackie.c kinst.c konamim2.c lwings.c m107.c m72.c mainsnk.c mirax.c namcos23.c niyanpai.c nmk16.c peplus.c pgm.c pitnrun.c portrait.c route16.c sbugger.c seattle.c seibuspi.c seicross.c seta.c spcforce.c splash.c spoker.c spool99.c ssfindo.c stactics.c suprnova.c tail2nos.c thepit.c ttchamp.c tunhunt.c twins.c unkhorse.c vegas.c vicdual.c victory.c warpsped.c wiz.c zn.c
[src/mame/includes]alpha68k.h bigstrkb.h cheekyms.h clshroad.h hng64.h m107.h m72.h mainsnk.h niyanpai.h pitnrun.h portrait.h route16.h sbugger.h spcforce.h splash.h stactics.h tail2nos.h thepit.h tunhunt.h vicdual.h victory.h
[src/mame/machine]cps2crpt.c n64.c pitnrun.c
[src/mame/video]bigstrkb.c cheekyms.c clshroad.c hng64.c m107.c m72.c mainsnk.c niyanpai.c pitnrun.c portrait.c route16.c sbugger.c spcforce.c splash.c stactics.c tail2nos.c thepit.c tunhunt.c victory.c
[src/mess]mess.lst mess.mak
[src/mess/drivers]abc80.c abc80x.c alesis.c elecbowl.c gba.c hh_hmcs40.c hh_pic16.c hh_tms1k.c hh_ucom4.c mbdtower.c mpf1.c ngen.c pc88va.c pc9801.c sms.c ticalc1x.c tispeak.c
[src/mess/includes]abc1600.h abc80.h hh_tms1k.h mpf1.h
[src/mess/layout]astro.lay einvader.lay elecbowl.lay ssimon.lay
[src/mess/machine]pce_cd.c pce_cd.h victor9k_fdc.c victor9k_fdc.h
[src/osd]eivc.h eivcx86.h eminline.h osdcomm.h osdcore.h osdepend.h osdnet.c osdnet.h strconv.c strconv.h
[src/osd/modules]osdmodule.c osdmodule.h
[src/osd/modules/debugger]debugint.c debugosx.m debugqt.c debugwin.c none.c
[src/osd/modules/debugger/osx]debugconsole.m debugosx.h debugview.h debugview.m disassemblyviewer.m memoryviewer.m pointsviewer.m
[src/osd/modules/debugger/qt]debuggerview.c
[src/osd/modules/debugger/win]uimetrics.c uimetrics.h
[src/osd/modules/font]font_none.c font_osx.c font_sdl.c font_windows.c
[src/osd/modules/lib]osdobj_common.c osdobj_common.h
[src/osd/modules/midi]none.c portmidi.c
[src/osd/modules/netdev]none.c pcap.c taptun.c
[src/osd/modules/opengl]gl_shader_mgr.c osd_opengl.h
[src/osd/modules/render]blit13.h drawbgfx.c drawogl.c drawsdl.c
[src/osd/modules/render/d3d]d3d9intf.c
[src/osd/modules/sound]coreaudio_sound.c direct_sound.c js_sound.c none.c sdl_sound.c
[src/osd/modules/sync]osdsync.h sync_ntc.c sync_os2.c sync_sdl.c sync_windows.c
[src/osd/osdmini]minimisc.c
[src/osd/sdl]aueffectutil-Info.plist aueffectutil.m main.c osdsdl.h osinline.h* sdlfile.c sdlmain.c sdlprefix.h strconv.c* strconv.h* video.h watchdog.c window.c
[src/osd/windows]eivc.h* eivcx86.h* main.c osinline.h* strconv.c* strconv.h* vconv.c* video.c winfile.c winmain.c winmain.h winprefix.h*
[src/targets]mame.lst* mess.lst* ume.lst*
[src/ume]tiny.lst ume.lst ume.mak

trunk/3rdparty/bgfx/.editorconfig
r245570r245571
88insert_final_newline     = true
99trim_trailing_whitespace = true
1010
11[*.c99.h]
12indent_style = space
13
1411[*.md]
1512trim_trailing_whitespace = false
1613max_line_length = 80
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt
r245570r245571
44include_directories(src/mesa)
55include_directories(src/mapi)
66include_directories(src/glsl)
7include_directories(src)
87
98option (DEBUG "Enable debugging" FALSE)
109
r245570r245571
1716    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
1817endif()
1918
20file(GLOB glcpp-library_sources src/glsl/glcpp/*.c src/util/*.c)
19file(GLOB glcpp-library_sources src/glsl/glcpp/*.c)
2120#file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c)
2221#list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove})
2322add_library(glcpp-library ${glcpp-library_sources})
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
r245570r245571
11GLSL optimizer Change Log
22=========================
33
42015 04
5-------
6
7Fixes:
8
9* Metal: fixed some bugs with translation of weird loops.
10
11
122015 02
13-------
14
15Tweaks:
16
17* Texture LOD sampling functions on GLES2.0 now produce a wrapper call, that does approximation
18  (mip bias) on devices that don't support GL_EXT_shader_texture_lod.
19* Undefined precision integers on GLES now default to highp.
20
21
222015 01
23-------
24
25Fixes:
26
27* Float literals are printed with 7 significant digits now.
28* Metal: GLSL mod() is properly translated into Metal's fmod().
29* Metal: Fixed some cases of reciprocal (1/x) printing missing half precision cast.
30* GLES3: textureOffset with a mipmap bias is printed correctly now.
31* Fixed a bug with loop inductor detection if the inductor was used before the loop for some things.
32* Fixed printing of int/float bitcast operations.
33* Improved precision determination of some constructs.
34
35
3642014 10
375-------
386
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/include/c99_compat.h
r245570r245571
134134 * C99 __func__ macro
135135 */
136136#ifndef __func__
137#  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(_MSC_VER)
137#  if defined(_MSC_VER)
138#    if _MSC_VER >= 1300
139#      define __func__ __FUNCTION__
140#    else
141#      define __func__ "<unknown>"
142#    endif
143#  elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
138144     /* C99 */
139145#  elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
140146     /* C99 */
r245570r245571
144150#    else
145151#      define __func__ "<unknown>"
146152#    endif
147#  elif defined(_MSC_VER)
148#    if _MSC_VER >= 1300
149#      define __func__ __FUNCTION__
150#    else
151#      define __func__ "<unknown>"
152#    endif
153153#  else
154154#    define __func__ "<unknown>"
155155#  endif
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile
r245570r245571
33CPPFLAGS += -I../talloc \
44   -I../mesa \
55   -I../mapi \
6   -I../../include \
7   -I..
6   -I../../include
87
98CXXFLAGS += -s -Wall -Os -fdata-sections -ffunction-sections
109CFLAGS += -s -Wall -Os -fdata-sections -ffunction-sections
1110
1211# This list gleaned from the VC project file. Update when needed
13SRC = ast_array_index.cpp \
14   ast_expr.cpp \
12SRC =   ast_expr.cpp \
1513   ast_function.cpp \
1614   ast_to_hir.cpp \
1715   ast_type.cpp \
1816   builtin_functions.cpp \
19   builtin_types.cpp \
20   builtin_variables.cpp \
2117   glsl_lexer.cpp \
2218   glsl_optimizer.cpp \
2319   glsl_parser.cpp \
r245570r245571
4642   ir_unused_structs.cpp \
4743   ir_validate.cpp \
4844   ir_variable_refcount.cpp \
49   link_atomics.cpp \
50   linker.cpp \
5145   link_functions.cpp \
52   link_interface_blocks.cpp \
53   link_uniform_block_active_visitor.cpp \
54   link_uniform_blocks.cpp \
55   link_uniform_initializers.cpp \
56   link_uniforms.cpp \
57   link_varyings.cpp \
46   linker.cpp \
5847   loop_analysis.cpp \
5948   loop_controls.cpp \
6049   loop_unroll.cpp \
61   lower_clip_distance.cpp \
6250   lower_discard.cpp \
63   lower_discard_flow.cpp \
6451   lower_if_to_cond_assign.cpp \
6552   lower_instructions.cpp \
6653   lower_jumps.cpp \
6754   lower_mat_op_to_vec.cpp \
68   lower_named_interface_blocks.cpp \
6955   lower_noise.cpp \
70   lower_offset_array.cpp \
71   lower_output_reads.cpp \
72   lower_packed_varyings.cpp \
73   lower_packing_builtins.cpp \
74   lower_ubo_reference.cpp \
7556   lower_variable_index_to_cond_assign.cpp \
7657   lower_vec_index_to_cond_assign.cpp \
7758   lower_vec_index_to_swizzle.cpp \
7859   lower_vector.cpp \
79   lower_vector_insert.cpp \
80   lower_vertex_id.cpp \
8160   opt_algebraic.cpp \
8261   opt_array_splitting.cpp \
8362   opt_constant_folding.cpp \
r245570r245571
8665   opt_copy_propagation.cpp \
8766   opt_copy_propagation_elements.cpp \
8867   opt_cse.cpp \
89   opt_dead_builtin_variables.cpp \
9068   opt_dead_builtin_varyings.cpp \
9169   opt_dead_code.cpp \
9270   opt_dead_code_local.cpp \
r245570r245571
9573   opt_flip_matrices.cpp \
9674   opt_function_inlining.cpp \
9775   opt_if_simplification.cpp \
98   opt_minmax.cpp \
9976   opt_noop_swizzle.cpp \
100   opt_rebalance_tree.cpp \
10177   opt_redundant_jumps.cpp \
10278   opt_structure_splitting.cpp \
10379   opt_swizzle_swizzle.cpp \
10480   opt_tree_grafting.cpp \
10581   opt_vectorize.cpp \
106   opt_vector_splitting.cpp \
82   ralloc.c \
10783   s_expression.cpp \
10884   standalone_scaffolding.cpp \
10985   strtod.c \
11086   glcpp/glcpp-lex.c \
11187   glcpp/glcpp-parse.c \
11288   glcpp/pp.c \
89   ../mesa/main/hash_table.c \
11390   ../mesa/main/imports.c \
11491   ../mesa/program/prog_hash_table.c \
115   ../mesa/program/symbol_table.c \
116   ../util/hash_table.c \
117   ../util/ralloc.c
92   ../mesa/program/symbol_table.c
11893
11994
12095OBJS1 = $(SRC:.cpp=.o)
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp
r245570r245571
5353 *    name and parameters.
5454 */
5555
56#define _USE_MATH_DEFINES
5657#include <stdarg.h>
5758#include <stdio.h>
5859#include "main/core.h" /* for struct gl_shader */
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
r245570r245571
934934      if (state->AMD_shader_stencil_export_warn)
935935         var->enable_extension_warning("GL_AMD_shader_stencil_export");
936936   }
937   
937
938938   if (state->EXT_frag_depth_enable) {
939939      ir_variable *const var =
940940      add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepthEXT", glsl_precision_high);
941941      if (state->EXT_frag_depth_warn)
942942         var->enable_extension_warning("GL_EXT_frag_depth");
943943   }
944   
944
945945   if (state->EXT_shader_framebuffer_fetch_enable) {
946946      ir_variable *const var =
947947         add_input(VARYING_SLOT_VAR0, array(vec4_t, state->Const.MaxDrawBuffers), "gl_LastFragData", glsl_precision_medium);
r245570r245571
949949         var->enable_extension_warning("GL_EXT_shader_framebuffer_fetch");
950950   }
951951
952   {
953      ir_variable *var;
954      var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID", glsl_precision_high);
955      var->data.interpolation = INTERP_QUALIFIER_FLAT;
956   }
957
952958   if (state->ARB_sample_shading_enable) {
953959      add_system_value(SYSTEM_VALUE_SAMPLE_ID, int_t, "gl_SampleID", glsl_precision_high);
954960      add_system_value(SYSTEM_VALUE_SAMPLE_POS, vec2_t, "gl_SamplePosition", glsl_precision_high);
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c
r245570r245571
2121#include <string.h>
2222#include <errno.h>
2323#include <stdlib.h>
24#include <c99_compat.h>
2425
2526/* end standard C headers. */
2627
r245570r245571
3435#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
3536
3637/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 * if you want the limit (max/min) macros for int types.
3839 */
3940#ifndef __STDC_LIMIT_MACROS
4041#define __STDC_LIMIT_MACROS 1
r245570r245571
5152typedef signed char flex_int8_t;
5253typedef short int flex_int16_t;
5354typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned char flex_uint8_t;
5556typedef unsigned short int flex_uint16_t;
5657typedef unsigned int flex_uint32_t;
5758
r245570r245571
184185#define EOB_ACT_LAST_MATCH 2
185186
186187    #define YY_LESS_LINENO(n)
187   
188
188189/* Return all but the first "n" matched characters back to the input stream. */
189190#define yyless(n) \
190191   do \
r245570r245571
246247
247248    int yy_bs_lineno; /**< The line count. */
248249    int yy_bs_column; /**< The column count. */
249   
250
250251   /* Whether to try to fill the input buffer when we reach the
251252    * end of it.
252253    */
r245570r245571
822823    /* This must go here because YYSTYPE and YYLTYPE are included
823824     * from bison output in section 1.*/
824825    #    define yylval yyg->yylval_r
825   
826
826827    #    define yylloc yyg->yylloc_r
827   
828
828829int glcpp_lex_init (yyscan_t* scanner);
829830
830831int glcpp_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
r245570r245571
863864void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
864865
865866       YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner );
866   
867
867868        void glcpp_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
868   
869
869870/* Macros after this point can all be overridden by user definitions in
870871 * section 1.
871872 */
r245570r245571
879880#endif
880881
881882    static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
882   
883
883884#ifndef yytext_ptr
884885static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
885886#endif
r245570r245571
899900#endif
900901
901902    static void yy_push_state (int new_state ,yyscan_t yyscanner);
902   
903
903904    static void yy_pop_state (yyscan_t yyscanner );
904   
905
905906    static int yy_top_state (yyscan_t yyscanner );
906   
907
907908/* Amount of stuff to slurp up with each read. */
908909#ifndef YY_READ_BUF_SIZE
909910#ifdef __ia64__
r245570r245571
13611362    * While in the <DEFINE> state we also need to explicitly
13621363    * handle a few other things that may appear before the
13631364    * identifier:
1364    *
1365    *
13651366    *    * Comments, (handled above with the main support for
13661367    *      comments).
13671368    *
r245570r245571
21842185    YY_BUFFER_STATE glcpp__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
21852186{
21862187   YY_BUFFER_STATE b;
2187   
2188
21882189   b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
21892190   if ( ! b )
21902191      YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" );
r245570r245571
22502251    }
22512252
22522253        b->yy_is_interactive = 0;
2253   
2254
22542255   errno = oerrno;
22552256}
22562257
r245570r245571
23562357                        , yyscanner);
23572358      if ( ! yyg->yy_buffer_stack )
23582359         YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" );
2359                         
2360
23602361      memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2361           
2362
23622363      yyg->yy_buffer_stack_max = num_to_alloc;
23632364      yyg->yy_buffer_stack_top = 0;
23642365      return;
r245570r245571
23872388 * @param base the character buffer
23882389 * @param size the size in bytes of the character buffer
23892390 * @param yyscanner The scanner object.
2390 * @return the newly allocated buffer state object.
2391 * @return the newly allocated buffer state object.
23912392 */
23922393YY_BUFFER_STATE glcpp__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
23932394{
23942395   YY_BUFFER_STATE b;
2395   
2396
23962397   if ( size < 2 ||
23972398        base[size-2] != YY_END_OF_BUFFER_CHAR ||
23982399        base[size-1] != YY_END_OF_BUFFER_CHAR )
r245570r245571
24282429 */
24292430YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner)
24302431{
2431   
2432
24322433   return glcpp__scan_bytes(yystr,strlen(yystr) ,yyscanner);
24332434}
24342435
r245570r245571
24452446   char *buf;
24462447   yy_size_t n;
24472448   int i;
2448   
2449
24492450   /* Get memory for full buffer, including space for trailing EOB's. */
24502451   n = _yybytes_len + 2;
24512452   buf = (char *) glcpp_alloc(n ,yyscanner );
r245570r245571
25532554int glcpp_get_lineno  (yyscan_t yyscanner)
25542555{
25552556    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2556   
2557
25572558        if (! YY_CURRENT_BUFFER)
25582559            return 0;
2559   
2560
25602561    return yylineno;
25612562}
25622563
r245570r245571
25662567int glcpp_get_column  (yyscan_t yyscanner)
25672568{
25682569    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2569   
2570
25702571        if (! YY_CURRENT_BUFFER)
25712572            return 0;
2572   
2573
25732574    return yycolumn;
25742575}
25752576
r245570r245571
26302631
26312632        /* lineno is only valid if an input buffer exists. */
26322633        if (! YY_CURRENT_BUFFER )
2633           yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner);
2634   
2634           yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner);
2635
26352636    yylineno = line_number;
26362637}
26372638
r245570r245571
26452646
26462647        /* column is only valid if an input buffer exists. */
26472648        if (! YY_CURRENT_BUFFER )
2648           yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner);
2649   
2649           yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner);
2650
26502651    yycolumn = column_no;
26512652}
26522653
r245570r245571
26992700    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
27002701    return yylloc;
27012702}
2702   
2703
27032704void glcpp_set_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
27042705{
27052706    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
27062707    yylloc = yylloc_param;
27072708}
2708   
2709
27092710/* User-visible API */
27102711
27112712/* glcpp_lex_init is special because it creates the scanner itself, so it is
r245570r245571
27532754        errno = EINVAL;
27542755        return 1;
27552756    }
2756   
2757
27572758    *ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2758   
2759
27592760    if (*ptr_yy_globals == NULL){
27602761        errno = ENOMEM;
27612762        return 1;
27622763    }
2763   
2764
27642765    /* By setting to 0xAA, we expose bugs in
27652766    yy_init_globals. Leave at 0x00 for releases. */
27662767    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2767   
2768
27682769    glcpp_set_extra (yy_user_defined, *ptr_yy_globals);
2769   
2770
27702771    return yy_init_globals ( *ptr_yy_globals );
27712772}
27722773
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l
r245570r245571
2525#include <stdio.h>
2626#include <string.h>
2727#include <ctype.h>
28#include <c99_compat.h>
2829
2930#include "glcpp.h"
3031#include "glcpp-parse.h"
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp
r245570r245571
206206   #endif
207207}
208208
209
210struct precision_ctx
211{
212   exec_list* root_ir;
213   bool res;
214};
215
216
217209static void propagate_precision_deref(ir_instruction *ir, void *data)
218210{
219211   // variable deref with undefined precision: take from variable itself
r245570r245571
221213   if (der && der->get_precision() == glsl_precision_undefined && der->var->data.precision != glsl_precision_undefined)
222214   {
223215      der->set_precision ((glsl_precision)der->var->data.precision);
224      ((precision_ctx*)data)->res = true;
216      *(bool*)data = true;
225217   }
226218   
227219   // array deref with undefined precision: take from array itself
r245570r245571
229221   if (der_arr && der_arr->get_precision() == glsl_precision_undefined && der_arr->array->get_precision() != glsl_precision_undefined)
230222   {
231223      der_arr->set_precision (der_arr->array->get_precision());
232      ((precision_ctx*)data)->res = true;
224      *(bool*)data = true;
233225   }
234226   
235227   // swizzle with undefined precision: take from swizzle argument
r245570r245571
237229   if (swz && swz->get_precision() == glsl_precision_undefined && swz->val->get_precision() != glsl_precision_undefined)
238230   {
239231      swz->set_precision (swz->val->get_precision());
240      ((precision_ctx*)data)->res = true;
232      *(bool*)data = true;
241233   }
242234   
243235}
r245570r245571
260252   if (expr->get_precision() != prec_params_max)
261253   {
262254      expr->set_precision (prec_params_max);
263      ((precision_ctx*)data)->res = true;
255      *(bool*)data = true;
264256   }
265257   
266258}
267259
268struct undefined_ass_ctx
269{
270   ir_variable* var;
271   bool res;
272};
273260
274static void has_only_undefined_precision_assignments(ir_instruction *ir, void *data)
275{
276   ir_assignment* ass = ir->as_assignment();
277   if (!ass)
278      return;
279   undefined_ass_ctx* ctx = (undefined_ass_ctx*)data;
280   if (ass->whole_variable_written() != ctx->var)
281      return;
282   glsl_precision prec = ass->rhs->get_precision();
283   if (prec == glsl_precision_undefined)
284      return;
285   ctx->res = false;
286}
287
288
289261static void propagate_precision_assign(ir_instruction *ir, void *data)
290262{
291263   ir_assignment* ass = ir->as_assignment();
292   if (!ass || !ass->lhs || !ass->rhs)
293      return;
294
295   glsl_precision lp = ass->lhs->get_precision();
296   glsl_precision rp = ass->rhs->get_precision();
297
298   // for assignments with LHS having undefined precision, take it from RHS
299   if (rp != glsl_precision_undefined)
264   if (ass && ass->lhs && ass->rhs)
300265   {
266      glsl_precision lp = ass->lhs->get_precision();
267      glsl_precision rp = ass->rhs->get_precision();
268      if (rp == glsl_precision_undefined)
269         return;
301270      ir_variable* lhs_var = ass->lhs->variable_referenced();
302271      if (lp == glsl_precision_undefined)
303272      {     
304273         if (lhs_var)
305274            lhs_var->data.precision = rp;
306275         ass->lhs->set_precision (rp);
307         ((precision_ctx*)data)->res = true;
276         *(bool*)data = true;
308277      }
309      return;
310278   }
311   
312   // for assignments where LHS has precision, but RHS is a temporary variable
313   // with undefined precision that's only assigned from other undefined precision
314   // sources -> make the RHS variable take LHS precision
315   if (lp != glsl_precision_undefined && rp == glsl_precision_undefined)
316   {
317      ir_dereference* deref = ass->rhs->as_dereference();
318      if (deref)
319      {
320         ir_variable* rhs_var = deref->variable_referenced();
321         if (rhs_var && rhs_var->data.mode == ir_var_temporary && rhs_var->data.precision == glsl_precision_undefined)
322         {
323            undefined_ass_ctx ctx;
324            ctx.var = rhs_var;
325            // find if we only assign to it from undefined precision sources
326            ctx.res = true;
327            exec_list* root_ir = ((precision_ctx*)data)->root_ir;
328            foreach_in_list(ir_instruction, inst, root_ir)
329            {
330               visit_tree (ir, has_only_undefined_precision_assignments, &ctx);
331            }
332            if (ctx.res)
333            {
334               rhs_var->data.precision = lp;
335               ass->rhs->set_precision(lp);
336               ((precision_ctx*)data)->res = true;
337            }
338         }
339      }
340      return;
341   }
342279}
343280
344
345281static void propagate_precision_call(ir_instruction *ir, void *data)
346282{
347283   ir_call* call = ir->as_call();
r245570r245571
366302      if (call->return_deref->get_precision() != prec_params_max)
367303      {
368304         call->return_deref->set_precision (prec_params_max);
369         ((precision_ctx*)data)->res = true;
305         *(bool*)data = true;
370306      }
371307   }
372308}
373309
310
374311static bool propagate_precision(exec_list* list, bool assign_high_to_undefined)
375312{
376313   bool anyProgress = false;
377   precision_ctx ctx;
378   
314   bool res;
379315   do {
380      ctx.res = false;
381      ctx.root_ir = list;
316      res = false;
382317      foreach_in_list(ir_instruction, ir, list)
383318      {
384         visit_tree (ir, propagate_precision_deref, &ctx);
385         visit_tree (ir, propagate_precision_assign, &ctx);
386         visit_tree (ir, propagate_precision_call, &ctx);
387         visit_tree (ir, propagate_precision_expr, &ctx);
319         visit_tree (ir, propagate_precision_deref, &res);
320         visit_tree (ir, propagate_precision_assign, &res);
321         visit_tree (ir, propagate_precision_call, &res);
322         visit_tree (ir, propagate_precision_expr, &res);
388323      }
389      anyProgress |= ctx.res;
390   } while (ctx.res);
391   anyProgress |= ctx.res;
324      anyProgress |= res;
325   } while (res);
326   anyProgress |= res;
392327   
393328   // for globals that have undefined precision, set it to highp
394329   if (assign_high_to_undefined)
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
r245570r245571
4747   return "";
4848}
4949
50static const int tex_sampler_type_count = 7;
51// [glsl_sampler_dim]
52static const char* tex_sampler_dim_name[tex_sampler_type_count] = {
53   "1D", "2D", "3D", "Cube", "Rect", "Buf", "External",
54};
55static int tex_sampler_dim_size[tex_sampler_type_count] = {
56   1, 2, 3, 3, 2, 2, 2,
57};
58
5950struct ga_entry : public exec_node
6051{
6152   ga_entry(ir_instruction* ir)
r245570r245571
9586      , inside_loop_body(false)
9687      , skipped_this_ir(false)
9788      , previous_skipped(false)
98      , uses_texlod_impl(0)
99      , uses_texlodproj_impl(0)
10089   {
10190      indentation = 0;
10291      expression_depth = 0;
r245570r245571
156145   bool   inside_loop_body;
157146   bool   skipped_this_ir;
158147   bool   previous_skipped;
159   int      uses_texlod_impl; // 3 bits per tex_dimension, bit set for each precision if any texture sampler needs the GLES2 lod workaround.
160   int      uses_texlodproj_impl; // 3 bits per tex_dimension, bit set for each precision if any texture sampler needs the GLES2 lod workaround.
161148};
162149
163static void print_texlod_workarounds(int usage_bitfield, int usage_proj_bitfield, string_buffer &str)
164{
165   static const char *precStrings[3] = {"lowp", "mediump", "highp"};
166   static const char *precNameStrings[3] = { "low_", "medium_", "high_" };
167   // Print out the texlod workarounds
168   for (int prec = 0; prec < 3; prec++)
169   {
170      const char *precString = precStrings[prec];
171      const char *precName = precNameStrings[prec];
172150
173      for (int dim = 0; dim < tex_sampler_type_count; dim++)
174      {
175         int mask = 1 << (dim + (prec * 8));
176         if (usage_bitfield & mask)
177         {
178            str.asprintf_append("%s vec4 impl_%stexture%sLodEXT(%s sampler%s sampler, highp vec%d coord, mediump float lod)\n", precString, precName, tex_sampler_dim_name[dim], precString, tex_sampler_dim_name[dim], tex_sampler_dim_size[dim]);
179            str.asprintf_append("{\n");
180            str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n");
181            str.asprintf_append("\treturn texture%sLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
182            str.asprintf_append("#else\n");
183            str.asprintf_append("\treturn texture%s(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
184            str.asprintf_append("#endif\n");
185            str.asprintf_append("}\n\n");
186         }
187         if (usage_proj_bitfield & mask)
188         {
189            // 2D projected read also has a vec4 UV variant
190            if (dim == GLSL_SAMPLER_DIM_2D)
191            {
192               str.asprintf_append("%s vec4 impl_%stexture2DProjLodEXT(%s sampler2D sampler, highp vec4 coord, mediump float lod)\n", precString, precName, precString);
193               str.asprintf_append("{\n");
194               str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n");
195               str.asprintf_append("\treturn texture%sProjLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
196               str.asprintf_append("#else\n");
197               str.asprintf_append("\treturn texture%sProj(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
198               str.asprintf_append("#endif\n");
199               str.asprintf_append("}\n\n");
200            }
201            str.asprintf_append("%s vec4 impl_%stexture%sProjLodEXT(%s sampler%s sampler, highp vec%d coord, mediump float lod)\n", precString, precName, tex_sampler_dim_name[dim], precString, tex_sampler_dim_name[dim], tex_sampler_dim_size[dim] + 1);
202            str.asprintf_append("{\n");
203            str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n");
204            str.asprintf_append("\treturn texture%sProjLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
205            str.asprintf_append("#else\n");
206            str.asprintf_append("\treturn texture%sProj(sampler, coord, lod);\n", tex_sampler_dim_name[dim]);
207            str.asprintf_append("#endif\n");
208            str.asprintf_append("}\n\n");
209         }
210      }
211   }
212}
213
214
215151char*
216152_mesa_print_ir_glsl(exec_list *instructions,
217153       struct _mesa_glsl_parse_state *state,
218154      char* buffer, PrintGlslMode mode)
219155{
220156   string_buffer str(buffer);
221   string_buffer body(buffer);
222157
223158   // print version & extensions
224159   if (state) {
r245570r245571
246181      }
247182      if (state->EXT_shader_framebuffer_fetch_enable)
248183         str.asprintf_append ("#extension GL_EXT_shader_framebuffer_fetch : enable\n");
249      if (state->ARB_shader_bit_encoding_enable)
250         str.asprintf_append("#extension GL_ARB_shader_bit_encoding : enable\n");
251184   }
252185   
253186   // remove unused struct declarations
254187   do_remove_unused_typedecls(instructions);
255188   
256189   global_print_tracker gtracker;
257   int uses_texlod_impl = 0;
258   int uses_texlodproj_impl = 0;
259190   
260191   loop_state* ls = analyze_loop_variables(instructions);
261192   if (ls->loop_found)
r245570r245571
270201            continue;
271202      }
272203
273      ir_print_glsl_visitor v (body, &gtracker, mode, state->es_shader, state);
204      ir_print_glsl_visitor v (str, &gtracker, mode, state->es_shader, state);
274205      v.loopstate = ls;
275206
276207      ir->accept(&v);
277208      if (ir->ir_type != ir_type_function && !v.skipped_this_ir)
278         body.asprintf_append (";\n");
279
280      uses_texlod_impl |= v.uses_texlod_impl;
281      uses_texlodproj_impl |= v.uses_texlodproj_impl;
209         str.asprintf_append (";\n");
282210   }
283211   
284212   delete ls;
285   
286   print_texlod_workarounds(uses_texlod_impl, uses_texlodproj_impl, str);
287   
288   // Add the optimized glsl code
289   str.asprintf_append("%s", body.c_str());
290213
291214   return ralloc_strdup(buffer, str.c_str());
292215}
r245570r245571
357280   if (type &&
358281      !type->is_float() &&
359282      !type->is_sampler() &&
360      !type->is_integer() &&
361      (!type->is_array() || !type->element_type()->is_float()) &&
362      (!type->is_array() || !type->element_type()->is_integer())
283      (!type->is_array() || !type->element_type()->is_float())
363284   )
364285   {
365286      return;
r245570r245571
376297   {
377298      prec = glsl_precision_high;
378299   }
379   if (type && type->is_integer())
380   {
381      if (prec == glsl_precision_undefined && type && type->is_integer())
382      {
383         // Default to highp on integers
384         prec = glsl_precision_high;
385      }
386   }
387300
388301   // skip precision for samplers that end up being lowp (default anyway) or undefined;
389302   // except always emit it for shadowmap samplers (some drivers don't implement
r245570r245571
616529   "float",   // u2f
617530   "int",      // i2u
618531   "int",      // u2i
619   "intBitsToFloat",   // bit i2f
620   "floatBitsToInt",      // bit f2i
621   "uintBitsToFloat",   // bit u2f
622   "floatBitsToUint",      // bit f2u
532   "float",   // bit i2f
533   "int",      // bit f2i
534   "float",   // bit u2f
535   "int",      // bit f2u
623536   "any",
624537   "trunc",
625538   "ceil",
r245570r245571
731644   newline_indent();
732645   
733646   if (ir->get_num_operands() == 1) {
734      if (ir->operation >= ir_unop_f2i && ir->operation <= ir_unop_u2i) {
647      if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) {
735648         print_type(buffer, ir->type, true);
736649         buffer.asprintf_append ("(");
737650      } else if (ir->operation == ir_unop_rcp) {
r245570r245571
810723   --this->expression_depth;
811724}
812725
726// [glsl_sampler_dim]
727static const char* tex_sampler_dim_name[] = {
728   "1D", "2D", "3D", "Cube", "Rect", "Buf", "External",
729};
730static int tex_sampler_dim_size[] = {
731   1, 2, 3, 3, 2, 2, 2,
732};
733
813734void ir_print_glsl_visitor::visit(ir_texture *ir)
814735{
815736   glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality;
r245570r245571
820741   if (is_shadow)
821742      sampler_uv_dim += 1;
822743   const bool is_proj = (uv_dim > sampler_uv_dim);
823   const bool is_lod = (ir->op == ir_txl);
824744   
825   if (is_lod && state->es_shader && state->language_version < 300 && state->stage == MESA_SHADER_FRAGMENT)
826   {
827      // Special workaround for GLES 2.0 LOD samplers to prevent a lot of debug spew.
828      const glsl_precision prec = ir->sampler->get_precision();
829      const char *precString = "";
830      // Sampler bitfield is 7 bits, so use 0-7 for lowp, 8-15 for mediump and 16-23 for highp.
831      int position = (int)sampler_dim;
832      switch (prec)
833      {
834      case glsl_precision_high:
835         position += 16;
836         precString = "_high_";
837         break;
838      case glsl_precision_medium:
839         position += 8;
840         precString = "_medium_";
841         break;
842      case glsl_precision_low:
843      default:
844         precString = "_low_";
845         break;
846      }
847      buffer.asprintf_append("impl%s", precString);
848      if (is_proj)
849         uses_texlodproj_impl |= (1 << position);
850      else
851         uses_texlod_impl |= (1 << position);
852   }
853
854   
855745    // texture function name
856746    //ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130
857747    if(state->language_version<130)
r245570r245571
902792   // texture coordinate
903793   ir->coordinate->accept(this);
904794   
795   // lod bias
796   if (ir->op == ir_txb)
797   {
798      buffer.asprintf_append (", ");
799      ir->lod_info.bias->accept(this);
800   }
801   
905802   // lod
906803   if (ir->op == ir_txl || ir->op == ir_txf)
907804   {
r245570r245571
917814      buffer.asprintf_append (", ");
918815      ir->lod_info.grad.dPdy->accept(this);
919816   }
920
921   // texel offset
922   if (ir->offset != NULL)
923   {
924      buffer.asprintf_append (", ");
925      ir->offset->accept(this);
926   }
927817   
928   // lod bias
929   if (ir->op == ir_txb)
930   {
931      buffer.asprintf_append (", ");
932      ir->lod_info.bias->accept(this);
933   }
934   
818   if (ir->offset != NULL) {
819      buffer.asprintf_append (", ");
820      ir->offset->accept(this);
821   }
935822    /*
936823   
937824   
r245570r245571
1002889      }
1003890      return;
1004891   }
1005   
1006   // Swizzling scalar types is not allowed so just return now.
1007   if (ir->val->type->vector_elements == 1)
1008      return;
1009892
1010893   buffer.asprintf_append (".");
1011894   for (unsigned i = 0; i < ir->mask.num_components; i++) {
r245570r245571
12571140   emit_assignment_part (ir->lhs, ir->rhs, ir->write_mask, NULL);
12581141}
12591142
1260
1261#ifdef _MSC_VER
1262#define isnan(x) _isnan(x)
1263#define isinf(x) (!_finite(x))
1264#endif
1265
1266#define fpcheck(x) (isnan(x) || isinf(x))
1267
1268void print_float (string_buffer& buffer, float f)
1143static void print_float (string_buffer& buffer, float f)
12691144{
12701145   // Kind of roundabout way, but this is to satisfy two things:
12711146   // * MSVC and gcc-based compilers differ a bit in how they treat float
r245570r245571
12731148   // * GLSL (early version at least) require floats to have ".0" or
12741149   //   exponential notation.
12751150   char tmp[64];
1276   snprintf(tmp, 64, "%.7g", f);
1151   snprintf(tmp, 64, "%.6g", f);
12771152
12781153   char* posE = NULL;
12791154   posE = strchr(tmp, 'e');
r245570r245571
13231198
13241199   if (type == glsl_type::float_type)
13251200   {
1326      if (fpcheck(ir->value.f[0]))
1327      {
1328         // Non-printable float. If we have bit conversions, we're fine. otherwise do hand-wavey things in print_float().
1329         if ((state->es_shader && (state->language_version >= 300))
1330            || (state->language_version >= 330)
1331            || (state->ARB_shader_bit_encoding_enable))
1332         {
1333            buffer.asprintf_append("uintBitsToFloat(%uu)", ir->value.u[0]);
1334            return;
1335         }
1336      }
1337     
13381201      print_float (buffer, ir->value.f[0]);
13391202      return;
13401203   }
13411204   else if (type == glsl_type::int_type)
13421205   {
1343      // Need special handling for INT_MIN
1344      if (ir->value.u[0] == 0x80000000)
1345         buffer.asprintf_append("int(0x%X)", ir->value.i[0]);
1346      else
1347         buffer.asprintf_append ("%d", ir->value.i[0]);
1206      buffer.asprintf_append ("%d", ir->value.i[0]);
13481207      return;
13491208   }
13501209   else if (type == glsl_type::uint_type)
r245570r245571
13541213         || (state->language_version < 130))
13551214         buffer.asprintf_append("%u", ir->value.u[0]);
13561215      else
1357      {
1358         // Old Adreno drivers try to be smart with '0u' and treat that as 'const int'. Sigh.
1359         if (ir->value.u[0] == 0)
1360            buffer.asprintf_append("uint(0)");
1361         else
1362            buffer.asprintf_append("%uu", ir->value.u[0]);
1363      }
1216         buffer.asprintf_append("%uu", ir->value.u[0]);
13641217      return;
13651218   }
13661219
r245570r245571
14011254          buffer.asprintf_append("%uu", ir->value.u[i]);
14021255       break;
14031256    }
1404    case GLSL_TYPE_INT:
1405    {
1406       // Need special handling for INT_MIN
1407       if (ir->value.u[i] == 0x80000000)
1408          buffer.asprintf_append("int(0x%X)", ir->value.i[i]);
1409       else
1410          buffer.asprintf_append("%d", ir->value.i[i]);
1411       break;
1412    }
1257    case GLSL_TYPE_INT:   buffer.asprintf_append ("%d", ir->value.i[i]); break;
14131258    case GLSL_TYPE_FLOAT: print_float(buffer, ir->value.f[i]); break;
14141259    case GLSL_TYPE_BOOL:  buffer.asprintf_append ("%d", ir->value.b[i]); break;
14151260    default: assert(0);
r245570r245571
15611406         if (indvar->initial_value)
15621407         {
15631408            buffer.asprintf_append (" = ");
1564            // if the var is an array add the proper initializer
1565            if(var->type->is_vector())
1566            {
1567               print_type(buffer, var->type, false);
1568               buffer.asprintf_append ("(");
1569            }
15701409            indvar->initial_value->accept(this);
1571            if(var->type->is_vector())
1572            {
1573               buffer.asprintf_append (")");
1574            }
15751410         }
15761411      }
15771412   }
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h
r245570r245571
9999};
100100
101101
102extern void print_float (string_buffer& buffer, float f);
103
104
105102#endif /* IR_PRINT_GLSL_VISITOR_H */
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
r245570r245571
179179   virtual void visit(ir_end_primitive *);
180180
181181   void emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex);
182   bool can_emit_canonical_for (loop_variable_state *ls);
183182   bool emit_canonical_for (ir_loop* ir);
184183
185184   metal_print_context& ctx;
r245570r245571
375374
376375void ir_print_metal_visitor::print_var_name (ir_variable* v)
377376{
378    long id = (long)hash_table_find (globals->var_hash, v);
377    uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, v);
379378   if (!id && v->data.mode == ir_var_temporary)
380379   {
381380        id = ++globals->var_counter;
r245570r245571
544543   // give an id to any variable defined in a function that is not an uniform
545544   if ((this->mode == kPrintGlslNone && ir->data.mode != ir_var_uniform))
546545   {
547      long id = (long)hash_table_find (globals->var_hash, ir);
546      uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, ir);
548547      if (id == 0)
549548      {
550549         id = ++globals->var_counter;
r245570r245571
566565   if (!inside_loop_body)
567566   {
568567      loop_variable_state* inductor_state = loopstate->get_for_inductor(ir);
569      if (inductor_state && inductor_state->private_induction_variable_count == 1 &&
570         can_emit_canonical_for(inductor_state))
568      if (inductor_state && inductor_state->private_induction_variable_count == 1)
571569      {
572570         skipped_this_ir = true;
573571         return;
r245570r245571
803801   "float",   // u2f
804802   "int",      // i2u
805803   "int",      // u2i
806   "as_type_",   // bit i2f
807   "as_type_",   // bit f2i
808   "as_type_",   // bit u2f
809   "as_type_",   // bit f2u
804   "float",   // bit i2f
805   "int",      // bit f2i
806   "float",   // bit u2f
807   "int",      // bit f2u
810808   "any",
811809   "trunc",
812810   "ceil",
r245570r245571
849847   "/",
850848   "carry_TODO",
851849   "borrow_TODO",
852   "fmod",
850   "mod",
853851   "<",
854852   ">",
855853   "<=",
r245570r245571
967965   {
968966      if (op0cast)
969967         print_cast (buffer, arg_prec, ir->operands[0]);
970      if (ir->operation >= ir_unop_f2i && ir->operation <= ir_unop_u2i) {
968      if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) {
971969         print_type(buffer, ir, ir->type, true);
972970         buffer.asprintf_append ("(");
973      } else if (ir->operation >= ir_unop_bitcast_i2f && ir->operation <= ir_unop_bitcast_f2u) {
974         buffer.asprintf_append("as_type<");
975         print_type(buffer, ir, ir->type, true);
976         buffer.asprintf_append(">(");
977971      } else if (ir->operation == ir_unop_rcp) {
978         const bool halfCast = (arg_prec == glsl_precision_medium || arg_prec == glsl_precision_low);
979         buffer.asprintf_append (halfCast ? "((half)1.0/(" : "(1.0/(");
972         buffer.asprintf_append ("(1.0/(");
980973      } else {
981974         buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]);
982975      }
r245570r245571
14521445      if (!ir->condition && whole_var)
14531446      {
14541447         loop_variable_state* inductor_state = loopstate->get_for_inductor(whole_var);
1455         if (inductor_state && inductor_state->private_induction_variable_count == 1 &&
1456            can_emit_canonical_for(inductor_state))
1448         if (inductor_state && inductor_state->private_induction_variable_count == 1)
14571449         {
14581450            skipped_this_ir = true;
14591451            return;
r245570r245571
15091501   emit_assignment_part (ir->lhs, ir->rhs, ir->write_mask, NULL);
15101502}
15111503
1504static void print_float (string_buffer& buffer, float f)
1505{
1506   // Kind of roundabout way, but this is to satisfy two things:
1507   // * MSVC and gcc-based compilers differ a bit in how they treat float
1508   //   widht/precision specifiers. Want to match for tests.
1509   // * GLSL (early version at least) require floats to have ".0" or
1510   //   exponential notation.
1511   char tmp[64];
1512   snprintf(tmp, 64, "%.6g", f);
1513
1514   char* posE = NULL;
1515   posE = strchr(tmp, 'e');
1516   if (!posE)
1517      posE = strchr(tmp, 'E');
1518
1519   #if defined(_MSC_VER)
1520   // While gcc would print something like 1.0e+07, MSVC will print 1.0e+007 -
1521   // only for exponential notation, it seems, will add one extra useless zero. Let's try to remove
1522   // that so compiler output matches.
1523   if (posE != NULL)
1524   {
1525      if((posE[1] == '+' || posE[1] == '-') && posE[2] == '0')
1526      {
1527         char* p = posE+2;
1528         while (p[0])
1529         {
1530            p[0] = p[1];
1531            ++p;
1532         }
1533      }
1534   }
1535   #endif
1536
1537   buffer.asprintf_append ("%s", tmp);
1538
1539   // need to append ".0"?
1540   if (!strchr(tmp,'.') && (posE == NULL))
1541      buffer.asprintf_append(".0");
1542}
1543
15121544void ir_print_metal_visitor::visit(ir_constant *ir)
15131545{
15141546   const glsl_type* type = ir->type;
r245570r245571
16831715}
16841716
16851717
1686bool ir_print_metal_visitor::can_emit_canonical_for (loop_variable_state *ls)
1718bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir)
16871719{
1720   loop_variable_state* const ls = this->loopstate->get(ir);
16881721   if (ls == NULL)
16891722      return false;
16901723
r245570r245571
16991732   if (terminatorCount != 1)
17001733      return false;
17011734
1702   return true;
1703}
1704
1705bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir)
1706{
1707   loop_variable_state* const ls = this->loopstate->get(ir);
1708
1709   if (!can_emit_canonical_for(ls))
1710      return false;
1711   
17121735   hash_table* terminator_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
17131736   hash_table* induction_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
17141737
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/linker.cpp
r245570r245571
25312531      }
25322532
25332533      prog->ARB_fragment_coord_conventions_enable |=
2534         prog->Shaders[i]->ARB_fragment_coord_conventions_enable;
2534         GLboolean(prog->Shaders[i]->ARB_fragment_coord_conventions_enable);
25352535
25362536      gl_shader_stage shader_type = prog->Shaders[i]->Stage;
25372537      shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i];
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp
r245570r245571
121121}
122122
123123void
124loop_state::insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop)
124loop_state::insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop)
125125{
126   ir_variable* var = loopvar->var;
127
128126   // Check if this variable is already marked as "sure can't be a private inductor variable"
129127   if (hash_table_find(this->ht_non_inductors, var))
130128      return;
r245570r245571
146144         return;
147145      }
148146   }
149
150   // Check if this variable is used before the loop anywhere. If it is, it can't be a
151   // variable that's private to the loop.
152   // Skip over the IR that declared the variable or assigned the initial value though.
153   for (exec_node* node = loop->prev;
154       !node->is_head_sentinel();
155       node = node->prev)
156   {
157      ir_instruction *ir = (ir_instruction *) node;
158      if (ir == loopvar->initial_value_ir)
159         continue;
160      if (ir->ir_type == ir_type_variable)
161         continue;
162
163      ir->accept (&refs);
164      if (refs.find_variable_entry(var))
165      {
166         // add to list of "non inductors", so that next loop does not try
167         // to add it as inductor again
168         hash_table_insert(this->ht_non_inductors, state, var);
169         return;
170      }
171   }
172147   
173148   state->private_induction_variable_count++;
174149   hash_table_insert(this->ht_inductors, state, var);
r245570r245571
370345   foreach_in_list_safe(loop_variable, lv, &ls->variables) {
371346       ir_variable *var = lv->var;
372347       if (var != NULL) {
373           lv->initial_value = find_initial_value(ir, var, &lv->initial_value_ir);
348           lv->initial_value = find_initial_value(ir, var);
374349       }
375350      /* Move variables that are already marked as being loop constant to
376351       * a separate list.  These trivially don't need to be tested.
r245570r245571
455430
456431    lv->remove();
457432    ls->induction_variables.push_tail(lv);
458    loops->insert_inductor(lv, ls, ir);
433    loops->insert_inductor(lv->var, ls, ir);
459434      }
460435   }
461436
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h
r245570r245571
5858             const struct gl_shader_compiler_options *options);
5959
6060ir_rvalue *
61find_initial_value(ir_loop *loop, ir_variable *var, ir_instruction **out_containing_ir);
61find_initial_value(ir_loop *loop, ir_variable *var);
6262
6363int
6464calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
r245570r245571
168168
169169   /** Reference to initial value outside of the loop. */
170170   ir_rvalue *initial_value;
171   /** IR that assigned the initial value. */
172   ir_instruction *initial_value_ir;
173171
174172   /** Number of assignments to the variable in the loop body. */
175173   unsigned num_assignments;
r245570r245571
249247   loop_variable_state *insert(ir_loop *ir);
250248   
251249   loop_variable_state* get_for_inductor (const ir_variable*);
252   void insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop);
250   void insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop);
253251
254252   bool loop_found;
255253
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp
r245570r245571
4444 * \c NULL if no initializer can be found.
4545 */
4646ir_rvalue *
47find_initial_value(ir_loop *loop, ir_variable *var, ir_instruction **out_containing_ir)
47find_initial_value(ir_loop *loop, ir_variable *var)
4848{
49   *out_containing_ir = NULL;
5049   ir_variable_refcount_visitor refs;
5150   
5251   for (exec_node *node = loop->prev;
r245570r245571
7574    ir_variable *assignee = assign->lhs->whole_variable_referenced();
7675
7776    if (assignee == var)
78    {
79       *out_containing_ir = assign;
8077       return (assign->condition != NULL) ? NULL : assign->rhs;
81    }
8278
8379    break;
8480      }
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp
r245570r245571
4040
4141static int glsl_version = 330;
4242
43//extern "C" void
44//_mesa_error_no_memory(const char *caller)
45//{
46//   fprintf(stderr, "Mesa error: out of memory in %s", caller);
47//}
43extern "C" void
44_mesa_error_no_memory(const char *caller)
45{
46   fprintf(stderr, "Mesa error: out of memory in %s", caller);
47}
4848
4949static void
5050initialize_context(struct gl_context *ctx, gl_api api)
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp
r245570r245571
129129      return false;
130130
131131   unsigned component = 0;
132   for (int c = 0; c < ir->type->vector_elements; c++) {
132   for (unsigned c = 0; c < ir->type->vector_elements; c++) {
133133      if (ir->get_float_component(c) < 1.0f)
134134         component++;
135135   }
r245570r245571
144144      return false;
145145
146146   unsigned component = 0;
147   for (int c = 0; c < ir->type->vector_elements; c++) {
147   for (unsigned c = 0; c < ir->type->vector_elements; c++) {
148148      if (ir->get_float_component(c) > 0.0f)
149149         component++;
150150   }
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp
r245570r245571
3636
3737
3838void
39_mesa_reference_shader(struct gl_context *, struct gl_shader **ptr,
39_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
4040                       struct gl_shader *sh)
4141{
42   (void) ctx;
4243   *ptr = sh;
4344}
4445
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp
r245570r245571
77      'target_name': 'glsl_optimizer_lib',
88      'type': 'static_library',
99      'include_dirs': [
10        '.',
1110        'glsl',
1211        'mesa',
1312        '../include',
r245570r245571
139138        'glsl/opt_flip_matrices.cpp',
140139        'glsl/opt_dead_builtin_varyings.cpp',
141140        'glsl/program.h',
141        'glsl/ralloc.c',
142        'glsl/ralloc.h',
142143        'glsl/s_expression.cpp',
143144        'glsl/s_expression.h',
144145        'glsl/standalone_scaffolding.cpp',
r245570r245571
152153        'mesa/main/dd.h',
153154        'mesa/main/glheader.h',
154155        'mesa/main/glminimal.h',
156        'mesa/main/hash_table.c',
157        'mesa/main/hash_table.h',
155158        'mesa/main/imports.c',
156159        'mesa/main/imports.h',
157160        'mesa/main/macros.h',
r245570r245571
164167        'mesa/program/prog_statevars.h',
165168        'mesa/program/symbol_table.c',
166169        'mesa/program/symbol_table.h',
167        'util/hash_table.c',
168        'util/hash_table.h',
169        'util/ralloc.c',
170        'util/ralloc.h',
171170      ],
172171      'conditions': [
173172        ['OS=="win"', {
174173          'include_dirs': [
175            '../include/c99',
174            '../include/c99',         
176175          ],
177176          'defines': [
178177            '_LIB',
r245570r245571
185184          ],
186185          'msvs_disabled_warnings': [4028, 4244, 4267, 4996],
187186        }],
188      ],
187      ],       
189188    }
190189  ]
191}
190}
No newline at end of file
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/compiler.h
r245570r245571
248248#endif
249249
250250#ifndef M_PI_2
251#define M_PI_2 (1.57079632679489661923)
251#define M_PI_2 1.57079632679489661923
252252#endif
253253
254254#ifndef M_PI_4
255#define M_PI_4 (0.785398163397448309616)
255#define M_PI_4 0.78539816339744830962
256256#endif
257257
258258#ifndef M_E
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt
r245570r245571
22{
33  vec4 c_1;
44  c_1.zw = vec2(0.0, 0.0);
5  c_1.xy = vec2(-0.3441301, 0.05004501);
5  c_1.xy = vec2(-0.34413, 0.050045);
66  gl_FragData[0] = c_1;
77}
88
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt
r245570r245571
22{
33  mediump vec4 c_1;
44  c_1.zw = vec2(0.0, 0.0);
5  c_1.xy = vec2(-0.3441301, 0.05004501);
5  c_1.xy = vec2(-0.34413, 0.050045);
66  gl_FragData[0] = c_1;
77}
88
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt
r245570r245571
44{
55  mediump vec4 c_1;
66  c_1.zw = vec2(0.0, 0.0);
7  c_1.xy = vec2(-0.3441301, 0.05004501);
7  c_1.xy = vec2(-0.34413, 0.050045);
88  _fragData = c_1;
99}
1010
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt
r245570r245571
1212  xlatMtlShaderOutput _mtl_o;
1313  half4 c_1;
1414  c_1.zw = half2(float2(0.0, 0.0));
15  c_1.xy = half2(float2(-0.3441301, 0.05004501));
15  c_1.xy = half2(float2(-0.34413, 0.050045));
1616  _mtl_o._fragData = c_1;
1717  return _mtl_o;
1818}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt
r245570r245571
22{
33  vec4 c_1;
44  c_1.zw = vec2(0.0, 0.0);
5  c_1.xy = vec2(-0.3441301, 0.05004501);
5  c_1.xy = vec2(-0.34413, 0.050045);
66  gl_FragData[0] = c_1;
77}
88
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt
r245570r245571
22{
33  mediump vec4 c_1;
44  c_1.zw = vec2(0.0, 0.0);
5  c_1.xy = vec2(-0.3441301, 0.05004501);
5  c_1.xy = vec2(-0.34413, 0.050045);
66  gl_FragData[0] = c_1;
77}
88
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt
r245570r245571
44{
55  mediump vec4 c_1;
66  c_1.zw = vec2(0.0, 0.0);
7  c_1.xy = vec2(-0.3441301, 0.05004501);
7  c_1.xy = vec2(-0.34413, 0.050045);
88  _fragData = c_1;
99}
1010
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt
r245570r245571
1212  xlatMtlShaderOutput _mtl_o;
1313  half4 c_1;
1414  c_1.zw = half2(float2(0.0, 0.0));
15  c_1.xy = half2(float2(-0.3441301, 0.05004501));
15  c_1.xy = half2(float2(-0.34413, 0.050045));
1616  _mtl_o._fragData = c_1;
1717  return _mtl_o;
1818}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
r245570r245571
77    discard;
88  };
99  a_2 = 4.0;
10  for (highp int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) {
10  for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) {
1111  };
1212  while (true) {
1313    a_2 += 2.0;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt
r245570r245571
1#version 300 es
2
3// from case 685794 at Unity; a particular form of a loop
4// started to generate invalid shaders around Unity 4.6.3.
5
6out mediump vec4 _fragData;
7
8
9struct v2f_surf {
10    mediump vec2 uv;
11    highp vec4 pos;
12};
13uniform sampler2D _MainTex;
14uniform mediump float _NumPasses;
15uniform mediump vec4 _ContrastShift;
16uniform mediump vec4 _SaturationShift;
17uniform lowp vec4 _HueShift;
18uniform lowp vec4 _LuminosityShift;
19
20lowp vec3 TestCycle2( in lowp vec3 res, in mediump float val )
21{
22    return ((res - 0.5) * pow( (cos(val) + 1.0), val));
23}
24
25lowp vec3 TestCycle( in lowp vec3 rgb, in mediump float passes )
26{
27    lowp vec3 res = rgb;
28    // a weird form of loop that was causing a bug
29    highp float i = 0.0;
30    for ( ; (i < 4.0); i += 1.0) {
31       
32        if ((i == passes)){
33            break;
34        }
35        if ((i == 0.0)){
36            res = TestCycle2( res, ((_ContrastShift.x * 3.0) + 12.0));
37        }
38        else{
39            if ((i == 1.0)){
40                res = TestCycle2( res, ((_SaturationShift.y * 3.0) + 12.0));
41            }
42            else{
43                if ((i == 2.0)){
44                    res = TestCycle2( res, ((_HueShift.z * 3.0) + 12.0));
45                }
46                else{
47                    res = TestCycle2( res, ((_LuminosityShift.x * 3.0) + 12.0));
48                }
49            }
50        }
51    }
52   
53    return res;
54}
55
56lowp vec3 surf( in mediump vec2 uv )
57{   
58    lowp vec4 t = texture(_MainTex, uv);
59    if (_NumPasses > 0.0)
60        t.xyz = TestCycle(t.xyz, _NumPasses);
61    return t.xyz;
62}
63
64lowp vec4 frag_surf( in v2f_surf IN )
65{   
66    lowp vec3 col = surf( IN.uv);
67    return vec4( col, 1.0);
68}
69in mediump vec2 xlv_TEXCOORD0;
70void main() {
71    lowp vec4 xl_retval;
72    v2f_surf xlt_IN;
73    xlt_IN.uv = vec2(xlv_TEXCOORD0);
74    xlt_IN.pos = vec4(0.0);
75    xl_retval = frag_surf(xlt_IN);
76    _fragData = vec4(xl_retval);
77}
78
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt
r245570r245571
1#version 300 es
2out mediump vec4 _fragData;
3uniform sampler2D _MainTex;
4uniform mediump float _NumPasses;
5uniform mediump vec4 _ContrastShift;
6uniform mediump vec4 _SaturationShift;
7uniform lowp vec4 _HueShift;
8uniform lowp vec4 _LuminosityShift;
9in mediump vec2 xlv_TEXCOORD0;
10void main ()
11{
12  lowp vec4 t_1;
13  lowp vec4 tmpvar_2;
14  tmpvar_2 = texture (_MainTex, xlv_TEXCOORD0);
15  t_1 = tmpvar_2;
16  if ((_NumPasses > 0.0)) {
17    mediump float passes_3;
18    passes_3 = _NumPasses;
19    highp float i_4;
20    lowp vec3 res_5;
21    res_5 = tmpvar_2.xyz;
22    i_4 = 0.0;
23    while (true) {
24      if ((i_4 >= 4.0)) {
25        break;
26      };
27      if ((i_4 == passes_3)) {
28        break;
29      };
30      if ((i_4 == 0.0)) {
31        lowp vec3 tmpvar_6;
32        mediump float val_7;
33        val_7 = ((_ContrastShift.x * 3.0) + 12.0);
34        mediump float tmpvar_8;
35        tmpvar_8 = pow ((cos(val_7) + 1.0), val_7);
36        tmpvar_6 = ((res_5 - 0.5) * tmpvar_8);
37        res_5 = tmpvar_6;
38      } else {
39        if ((i_4 == 1.0)) {
40          lowp vec3 tmpvar_9;
41          mediump float val_10;
42          val_10 = ((_SaturationShift.y * 3.0) + 12.0);
43          mediump float tmpvar_11;
44          tmpvar_11 = pow ((cos(val_10) + 1.0), val_10);
45          tmpvar_9 = ((res_5 - 0.5) * tmpvar_11);
46          res_5 = tmpvar_9;
47        } else {
48          if ((i_4 == 2.0)) {
49            lowp vec3 tmpvar_12;
50            mediump float val_13;
51            val_13 = ((_HueShift.z * 3.0) + 12.0);
52            mediump float tmpvar_14;
53            tmpvar_14 = pow ((cos(val_13) + 1.0), val_13);
54            tmpvar_12 = ((res_5 - 0.5) * tmpvar_14);
55            res_5 = tmpvar_12;
56          } else {
57            lowp vec3 tmpvar_15;
58            mediump float val_16;
59            val_16 = ((_LuminosityShift.x * 3.0) + 12.0);
60            mediump float tmpvar_17;
61            tmpvar_17 = pow ((cos(val_16) + 1.0), val_16);
62            tmpvar_15 = ((res_5 - 0.5) * tmpvar_17);
63            res_5 = tmpvar_15;
64          };
65        };
66      };
67      i_4 += 1.0;
68    };
69    t_1.xyz = res_5;
70  };
71  lowp vec4 tmpvar_18;
72  tmpvar_18.w = 1.0;
73  tmpvar_18.xyz = t_1.xyz;
74  _fragData = tmpvar_18;
75}
76
77
78// stats: 37 alu 1 tex 7 flow
79// inputs: 1
80//  #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
81// uniforms: 5 (total size: 0)
82//  #0: _NumPasses (medium float) 1x1 [-1]
83//  #1: _ContrastShift (medium float) 4x1 [-1]
84//  #2: _SaturationShift (medium float) 4x1 [-1]
85//  #3: _HueShift (low float) 4x1 [-1]
86//  #4: _LuminosityShift (low float) 4x1 [-1]
87// textures: 1
88//  #0: _MainTex (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  half2 xlv_TEXCOORD0;
5};
6struct xlatMtlShaderOutput {
7  half4 _fragData [[color(0)]];
8};
9struct xlatMtlShaderUniform {
10  half _NumPasses;
11  half4 _ContrastShift;
12  half4 _SaturationShift;
13  half4 _HueShift;
14  half4 _LuminosityShift;
15};
16fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
17  ,   texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
18{
19  xlatMtlShaderOutput _mtl_o;
20  half4 t_1;
21  half4 tmpvar_2;
22  tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
23  t_1 = tmpvar_2;
24  if ((_mtl_u._NumPasses > (half)0.0)) {
25    half passes_3;
26    passes_3 = _mtl_u._NumPasses;
27    float i_4;
28    half3 res_5;
29    res_5 = tmpvar_2.xyz;
30    i_4 = 0.0;
31    while (true) {
32      if ((i_4 >= 4.0)) {
33        break;
34      };
35      if ((i_4 == (float)passes_3)) {
36        break;
37      };
38      if ((i_4 == 0.0)) {
39        half3 tmpvar_6;
40        half val_7;
41        val_7 = ((_mtl_u._ContrastShift.x * (half)3.0) + (half)12.0);
42        half tmpvar_8;
43        tmpvar_8 = pow ((cos(val_7) + (half)1.0), val_7);
44        tmpvar_6 = ((res_5 - (half)0.5) * tmpvar_8);
45        res_5 = tmpvar_6;
46      } else {
47        if ((i_4 == 1.0)) {
48          half3 tmpvar_9;
49          half val_10;
50          val_10 = ((_mtl_u._SaturationShift.y * (half)3.0) + (half)12.0);
51          half tmpvar_11;
52          tmpvar_11 = pow ((cos(val_10) + (half)1.0), val_10);
53          tmpvar_9 = ((res_5 - (half)0.5) * tmpvar_11);
54          res_5 = tmpvar_9;
55        } else {
56          if ((i_4 == 2.0)) {
57            half3 tmpvar_12;
58            half val_13;
59            val_13 = ((_mtl_u._HueShift.z * (half)3.0) + (half)12.0);
60            half tmpvar_14;
61            tmpvar_14 = pow ((cos(val_13) + (half)1.0), val_13);
62            tmpvar_12 = ((res_5 - (half)0.5) * tmpvar_14);
63            res_5 = tmpvar_12;
64          } else {
65            half3 tmpvar_15;
66            half val_16;
67            val_16 = ((_mtl_u._LuminosityShift.x * (half)3.0) + (half)12.0);
68            half tmpvar_17;
69            tmpvar_17 = pow ((cos(val_16) + (half)1.0), val_16);
70            tmpvar_15 = ((res_5 - (half)0.5) * tmpvar_17);
71            res_5 = tmpvar_15;
72          };
73        };
74      };
75      i_4 += 1.0;
76    };
77    t_1.xyz = res_5;
78  };
79  half4 tmpvar_18;
80  tmpvar_18.w = half(1.0);
81  tmpvar_18.xyz = t_1.xyz;
82  _mtl_o._fragData = tmpvar_18;
83  return _mtl_o;
84}
85
86
87// stats: 37 alu 1 tex 7 flow
88// inputs: 1
89//  #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
90// uniforms: 5 (total size: 40)
91//  #0: _NumPasses (medium float) 1x1 [-1] loc 0
92//  #1: _ContrastShift (medium float) 4x1 [-1] loc 8
93//  #2: _SaturationShift (medium float) 4x1 [-1] loc 16
94//  #3: _HueShift (low float) 4x1 [-1] loc 24
95//  #4: _LuminosityShift (low float) 4x1 [-1] loc 32
96// textures: 1
97//  #0: _MainTex (low 2d) 0x0 [-1] loc 0
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt
r245570r245571
1varying vec2 uv;
2
3void main()
4{
5   vec4 c = vec4(0.0);
6   float a, b;
7
8   a = uv.y * 1.111111e+6;
9   b = uv.y * 1.111110e+6;
10   c.x = a-b;
11
12   a = uv.y * 1.23456789;
13   b = uv.y * 1.23456765;
14   c.y = a-b;
15
16   a = uv.y * -1.234567e-6;
17   b = uv.y * -1.234565e-6;
18   c.z = a-b;
19
20   gl_FragColor = c;
21}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt
r245570r245571
1varying vec2 uv;
2void main ()
3{
4  float b_1;
5  float a_2;
6  vec4 c_3;
7  c_3.w = 0.0;
8  a_2 = (uv.y * 1111111.0);
9  b_1 = (uv.y * 1111110.0);
10  c_3.x = (a_2 - b_1);
11  a_2 = (uv.y * 1.234568);
12  b_1 = (uv.y * 1.234568);
13  c_3.y = (a_2 - b_1);
14  a_2 = (uv.y * -1.234567e-06);
15  b_1 = (uv.y * -1.234565e-06);
16  c_3.z = (a_2 - b_1);
17  gl_FragColor = c_3;
18}
19
20
21// stats: 10 alu 0 tex 0 flow
22// inputs: 1
23//  #0: uv (high float) 2x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt
r245570r245571
5555  ip = vec4(i);
5656  return x-ip;
5757}
58
59mediump vec4 xlat_main (in highp vec4 uv)
60{
58mediump vec4 xlat_main( in highp vec4 uv );
59mediump vec4 xlat_main( in highp vec4 uv ) {
6160    mediump vec4 c;
6261    mediump vec4 d;
6362    c = vec4( 0.000000);
r245570r245571
6968    c.xy  += xll_modf( uv.xy , d.xy );
7069    c.xyz  += xll_modf( uv.xyz , d.xyz );
7170    c.xyzw  += xll_modf( uv.xyzw , d.xyzw );
72
73    // GLSL mod function
74    c.x += mod(uv.x, d.x);
75    c.xy += mod(uv.xy, d.xy);
76    c.xyz += mod(uv.xyz, d.xyz);
77
78    // inverse
79    c.x += 1.0/uv.x; // float
80    c.x += max(0.0, 1.0/uv.x);
81
82    c.y += 1.0/c.z; // half
83    c.y += max(0.0, 1.0/c.w);
84
85    // max with different precision arguments
86    c.x += max(uv.x, c.z);
87
8871    return c;
8972}
90
9173in highp vec4 xlv_TEXCOORD0;
9274out mediump vec4 _fragData;
9375void main() {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt
r245570r245571
9797  c_1 = (c_1 + tmpvar_22);
9898  highp float tmpvar_23;
9999  mediump float ip_24;
100  highp int tmpvar_25;
100  int tmpvar_25;
101101  tmpvar_25 = int(xlv_TEXCOORD0.x);
102102  ip_24 = float(tmpvar_25);
103103  tmpvar_23 = (xlv_TEXCOORD0.x - ip_24);
104104  c_1.x = (c_1.x + tmpvar_23);
105105  highp vec2 tmpvar_26;
106  highp ivec2 tmpvar_27;
107  tmpvar_27 = ivec2(xlv_TEXCOORD0.xy);
108  mediump vec2 tmpvar_28;
109  tmpvar_28 = vec2(tmpvar_27);
110  tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28);
106  mediump vec2 ip_27;
107  highp vec2 tmpvar_28;
108  tmpvar_28 = vec2(ivec2(xlv_TEXCOORD0.xy));
109  ip_27 = tmpvar_28;
110  tmpvar_26 = (xlv_TEXCOORD0.xy - ip_27);
111111  c_1.xy = (c_1.xy + tmpvar_26);
112112  highp vec3 tmpvar_29;
113  highp ivec3 tmpvar_30;
114  tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz);
115  mediump vec3 tmpvar_31;
116  tmpvar_31 = vec3(tmpvar_30);
117  tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31);
113  mediump vec3 ip_30;
114  highp vec3 tmpvar_31;
115  tmpvar_31 = vec3(ivec3(xlv_TEXCOORD0.xyz));
116  ip_30 = tmpvar_31;
117  tmpvar_29 = (xlv_TEXCOORD0.xyz - ip_30);
118118  c_1.xyz = (c_1.xyz + tmpvar_29);
119119  highp vec4 tmpvar_32;
120  highp ivec4 tmpvar_33;
121  tmpvar_33 = ivec4(xlv_TEXCOORD0);
122  mediump vec4 tmpvar_34;
123  tmpvar_34 = vec4(tmpvar_33);
124  tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34);
120  mediump vec4 ip_33;
121  highp vec4 tmpvar_34;
122  tmpvar_34 = vec4(ivec4(xlv_TEXCOORD0));
123  ip_33 = tmpvar_34;
124  tmpvar_32 = (xlv_TEXCOORD0 - ip_33);
125125  c_1 = (c_1 + tmpvar_32);
126126  gl_FragData[0] = c_1;
127127}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt
r245570r245571
9999  c_1 = (c_1 + tmpvar_22);
100100  highp float tmpvar_23;
101101  mediump float ip_24;
102  highp int tmpvar_25;
102  int tmpvar_25;
103103  tmpvar_25 = int(xlv_TEXCOORD0.x);
104104  ip_24 = float(tmpvar_25);
105105  tmpvar_23 = (xlv_TEXCOORD0.x - ip_24);
106106  c_1.x = (c_1.x + tmpvar_23);
107107  highp vec2 tmpvar_26;
108  highp ivec2 tmpvar_27;
109  tmpvar_27 = ivec2(xlv_TEXCOORD0.xy);
110  mediump vec2 tmpvar_28;
111  tmpvar_28 = vec2(tmpvar_27);
112  tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28);
108  mediump vec2 ip_27;
109  highp vec2 tmpvar_28;
110  tmpvar_28 = vec2(ivec2(xlv_TEXCOORD0.xy));
111  ip_27 = tmpvar_28;
112  tmpvar_26 = (xlv_TEXCOORD0.xy - ip_27);
113113  c_1.xy = (c_1.xy + tmpvar_26);
114114  highp vec3 tmpvar_29;
115  highp ivec3 tmpvar_30;
116  tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz);
117  mediump vec3 tmpvar_31;
118  tmpvar_31 = vec3(tmpvar_30);
119  tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31);
115  mediump vec3 ip_30;
116  highp vec3 tmpvar_31;
117  tmpvar_31 = vec3(ivec3(xlv_TEXCOORD0.xyz));
118  ip_30 = tmpvar_31;
119  tmpvar_29 = (xlv_TEXCOORD0.xyz - ip_30);
120120  c_1.xyz = (c_1.xyz + tmpvar_29);
121121  highp vec4 tmpvar_32;
122  highp ivec4 tmpvar_33;
123  tmpvar_33 = ivec4(xlv_TEXCOORD0);
124  mediump vec4 tmpvar_34;
125  tmpvar_34 = vec4(tmpvar_33);
126  tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34);
122  mediump vec4 ip_33;
123  highp vec4 tmpvar_34;
124  tmpvar_34 = vec4(ivec4(xlv_TEXCOORD0));
125  ip_33 = tmpvar_34;
126  tmpvar_32 = (xlv_TEXCOORD0 - ip_33);
127127  c_1 = (c_1 + tmpvar_32);
128  highp float tmpvar_35;
129  tmpvar_35 = (float(mod (xlv_TEXCOORD0.x, tmpvar_34.x)));
130  c_1.x = (c_1.x + tmpvar_35);
131  highp vec2 tmpvar_36;
132  tmpvar_36 = (vec2(mod (xlv_TEXCOORD0.xy, tmpvar_34.xy)));
133  c_1.xy = (c_1.xy + tmpvar_36);
134  highp vec3 tmpvar_37;
135  tmpvar_37 = (vec3(mod (xlv_TEXCOORD0.xyz, tmpvar_34.xyz)));
136  c_1.xyz = (c_1.xyz + tmpvar_37);
137  highp float tmpvar_38;
138  tmpvar_38 = (1.0/(xlv_TEXCOORD0.x));
139  c_1.x = (c_1.x + tmpvar_38);
140  highp float tmpvar_39;
141  tmpvar_39 = max (0.0, tmpvar_38);
142  c_1.x = (c_1.x + tmpvar_39);
143  c_1.y = (c_1.y + (1.0/(c_1.z)));
144  c_1.y = (c_1.y + max (0.0, (1.0/(c_1.w))));
145  highp float tmpvar_40;
146  tmpvar_40 = max (xlv_TEXCOORD0.x, c_1.z);
147  c_1.x = (c_1.x + tmpvar_40);
148128  _fragData = c_1;
149129}
150130
151131
152// stats: 73 alu 0 tex 10 flow
132// stats: 56 alu 0 tex 10 flow
153133// inputs: 1
154134//  #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt
r245570r245571
113113  tmpvar_23 = (_mtl_i.xlv_TEXCOORD0.x - (float)ip_24);
114114  c_1.x = ((half)((float)c_1.x + tmpvar_23));
115115  float2 tmpvar_26;
116  int2 tmpvar_27;
117  tmpvar_27 = int2(_mtl_i.xlv_TEXCOORD0.xy);
118  half2 tmpvar_28;
119  tmpvar_28 = half2(float2(tmpvar_27));
120  tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)tmpvar_28);
116  half2 ip_27;
117  float2 tmpvar_28;
118  tmpvar_28 = float2(int2(_mtl_i.xlv_TEXCOORD0.xy));
119  ip_27 = half2(tmpvar_28);
120  tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)ip_27);
121121  c_1.xy = ((half2)((float2)c_1.xy + tmpvar_26));
122122  float3 tmpvar_29;
123  int3 tmpvar_30;
124  tmpvar_30 = int3(_mtl_i.xlv_TEXCOORD0.xyz);
125  half3 tmpvar_31;
126  tmpvar_31 = half3(float3(tmpvar_30));
127  tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)tmpvar_31);
123  half3 ip_30;
124  float3 tmpvar_31;
125  tmpvar_31 = float3(int3(_mtl_i.xlv_TEXCOORD0.xyz));
126  ip_30 = half3(tmpvar_31);
127  tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)ip_30);
128128  c_1.xyz = ((half3)((float3)c_1.xyz + tmpvar_29));
129129  float4 tmpvar_32;
130  int4 tmpvar_33;
131  tmpvar_33 = int4(_mtl_i.xlv_TEXCOORD0);
132  half4 tmpvar_34;
133  tmpvar_34 = half4(float4(tmpvar_33));
134  tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)tmpvar_34);
130  half4 ip_33;
131  float4 tmpvar_34;
132  tmpvar_34 = float4(int4(_mtl_i.xlv_TEXCOORD0));
133  ip_33 = half4(tmpvar_34);
134  tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)ip_33);
135135  c_1 = ((half4)((float4)c_1 + tmpvar_32));
136  float tmpvar_35;
137  tmpvar_35 = (float(fmod (_mtl_i.xlv_TEXCOORD0.x, (float)tmpvar_34.x)));
138  c_1.x = half(((float)c_1.x + tmpvar_35));
139  float2 tmpvar_36;
140  tmpvar_36 = (float2(fmod (_mtl_i.xlv_TEXCOORD0.xy, (float2)tmpvar_34.xy)));
141  c_1.xy = half2(((float2)c_1.xy + tmpvar_36));
142  float3 tmpvar_37;
143  tmpvar_37 = (float3(fmod (_mtl_i.xlv_TEXCOORD0.xyz, (float3)tmpvar_34.xyz)));
144  c_1.xyz = half3(((float3)c_1.xyz + tmpvar_37));
145  float tmpvar_38;
146  tmpvar_38 = (1.0/(_mtl_i.xlv_TEXCOORD0.x));
147  c_1.x = half(((float)c_1.x + tmpvar_38));
148  float tmpvar_39;
149  tmpvar_39 = max (0.0, tmpvar_38);
150  c_1.x = half(((float)c_1.x + tmpvar_39));
151  c_1.y = (c_1.y + ((half)1.0/(c_1.z)));
152  c_1.y = (c_1.y + max ((half)0.0, ((half)1.0/(c_1.w))));
153  float tmpvar_40;
154  tmpvar_40 = max (_mtl_i.xlv_TEXCOORD0.x, (float)c_1.z);
155  c_1.x = half(((float)c_1.x + tmpvar_40));
156136  _mtl_o._fragData = c_1;
157137  return _mtl_o;
158138}
159139
160140
161// stats: 73 alu 0 tex 10 flow
141// stats: 56 alu 0 tex 10 flow
162142// inputs: 1
163143//  #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt
r245570r245571
88uniform mediump vec4 _TerrainTreeLightColors[4];
99lowp vec4 xlat_main (in v2f i) {
1010    highp int j = 0;
11    lowp vec4 col = texture( _MainTex, i.uv);
11    lowp vec4 col = texture2D( _MainTex, i.uv);
1212    mediump vec3 light = vec3(0.0);
1313    for ( ; (j < 3); (j++)) {
1414        light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt
r245570r245571
77uniform sampler2D _MainTex;
88uniform mediump vec4 _TerrainTreeLightColors[4];
99lowp vec4 xlat_main (in v2f i) {
10    lowp vec4 col = texture( _MainTex, i.uv);
10    lowp vec4 col = texture2D( _MainTex, i.uv);
1111    if (col.w < 0.5)
1212        discard;
1313    mediump vec3 light = vec3(0.0);
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt
r245570r245571
22{
33  highp float f_1;
44  f_1 = 0.0;
5  for (highp int i_2 = 0; i_2 < 32; i_2++) {
5  for (int i_2 = 0; i_2 < 32; i_2++) {
66    f_1 = (f_1 + (gl_FragCoord.x * float(i_2)));
77  };
88  highp vec4 tmpvar_3;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt
r245570r245571
77  lowp vec4 tmpvar_1;
88  highp vec3 tmpvar_2;
99  tmpvar_2 = xlv_nl;
10  lowp int loopCount_4;
10  int loopCount_4;
1111  mediump vec3 light_5;
1212  lowp vec4 col_6;
1313  lowp vec4 tmpvar_7;
r245570r245571
1515  col_6 = tmpvar_7;
1616  light_5 = vec3(0.0, 0.0, 0.0);
1717  loopCount_4 = int((tmpvar_7.w * 10.0));
18  for (highp int j_3 = 0; j_3 < loopCount_4; j_3++) {
18  for (int j_3 = 0; j_3 < loopCount_4; j_3++) {
1919    light_5 = (light_5 + ((col_6.xyz *
2020      tmpvar_2[j_3]
2121    ) * _TerrainTreeLightColors[j_3].xyz));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
r245570r245571
22void main ()
33{
44  lowp float c_1;
5  highp int tmpvar_3;
5  int tmpvar_3;
66  if ((xx > 0.5)) {
77    tmpvar_3 = 2;
88  } else {
r245570r245571
1212    discard;
1313  };
1414  c_1 = 0.0;
15  for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) {
15  for (int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) {
1616  };
1717  lowp vec4 tmpvar_4;
1818  tmpvar_4 = vec4(c_1);
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt
r245570r245571
88uniform float fh1;
99uniform highp float fh2;
1010uniform mediump float fm;
11uniform highp int il1;
12uniform lowp int il2;
13uniform mediump int im;
11uniform int il1;
12uniform int il2;
13uniform int im;
1414void main ()
1515{
16  highp int i_1;
16  int i_1;
1717  lowp float f_2;
1818  highp float tmpvar_3;
1919  tmpvar_3 = (((fh1 + fh2) + fm) + s1.f);
2020  f_2 = tmpvar_3;
21  mediump int tmpvar_4;
21  int tmpvar_4;
2222  tmpvar_4 = (((il1 + il2) + im) + s1.i);
2323  i_1 = tmpvar_4;
24  highp float tmpvar_5;
24  float tmpvar_5;
2525  if ((gl_FragCoord.x > 0.5)) {
2626    tmpvar_5 = 0.9;
2727  } else {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
r245570r245571
55varying mediump vec2 xlv_TEXCOORD0;
66void main ()
77{
8  mediump float x_1;
9  x_1 = ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd));
10  lowp float tmpvar_2;
11  tmpvar_2 = clamp (x_1, 0.0, 1.0);
8  lowp float t_1;
9  mediump float tmpvar_2;
10  tmpvar_2 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0);
11  t_1 = tmpvar_2;
1212  lowp vec4 tmpvar_3;
1313  tmpvar_3.w = 1.0;
14  tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(tmpvar_2));
14  tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(t_1));
1515  gl_FragColor = tmpvar_3;
1616}
1717
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt
r245570r245571
55varying mediump vec2 xlv_TEXCOORD0;
66void main ()
77{
8  mediump float tmpvar_1;
9  tmpvar_1 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0);
10  lowp vec3 tmpvar_2;
11  tmpvar_2 = vec3(tmpvar_1);
8  lowp vec3 t_1;
9  mediump vec3 tmpvar_2;
10  tmpvar_2 = vec3(clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0));
11  t_1 = tmpvar_2;
1212  lowp vec4 tmpvar_3;
1313  tmpvar_3.w = 1.0;
14  tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, tmpvar_2);
14  tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, t_1);
1515  gl_FragColor = tmpvar_3;
1616}
1717
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt
r245570r245571
1#version 300 es
2
3// A very cut down variant of Unity's directional lightmap;
4// has an inline medium precision matrix constructor,
5// but even if dirBasis is declared as mediump
6// some code was promoting it to high precision.
7
8out mediump vec4 _glesFragData;
9
10mat3 transposem3(mat3 m) {
11  return mat3( m[0][0], m[1][0], m[2][0],
12               m[0][1], m[1][1], m[2][1],
13               m[0][2], m[1][2], m[2][2]);
14}
15
16in mediump vec3 inNormal;
17
18void main()
19{
20    mediump mat3 dirBasis = transposem3(mat3(
21        vec3( 0.8164966, 0.0, 0.5773503),
22        vec3( -0.4082483, 0.7071068, 0.5773503),
23        vec3( -0.4082483, -0.7071068, 0.5773503)));
24    mediump vec4 c;
25    c.xyz = dirBasis * inNormal;
26    c.w = 0.0;
27    _glesFragData = c;
28}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt
r245570r245571
1#version 300 es
2out mediump vec4 _glesFragData;
3in mediump vec3 inNormal;
4void main ()
5{
6  mediump vec4 c_1;
7  mediump mat3 tmpvar_2;
8  tmpvar_2[uint(0)].x = 0.8164966;
9  tmpvar_2[uint(0)].y = -0.4082483;
10  tmpvar_2[uint(0)].z = -0.4082483;
11  tmpvar_2[1u].x = 0.0;
12  tmpvar_2[1u].y = 0.7071068;
13  tmpvar_2[1u].z = -0.7071068;
14  tmpvar_2[2u].x = 0.5773503;
15  tmpvar_2[2u].y = 0.5773503;
16  tmpvar_2[2u].z = 0.5773503;
17  c_1.xyz = (tmpvar_2 * inNormal);
18  c_1.w = 0.0;
19  _glesFragData = c_1;
20}
21
22
23// stats: 11 alu 0 tex 0 flow
24// inputs: 1
25//  #0: inNormal (medium float) 3x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  half3 inNormal;
5};
6struct xlatMtlShaderOutput {
7  half4 _glesFragData [[color(0)]];
8};
9struct xlatMtlShaderUniform {
10};
11fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
12{
13  xlatMtlShaderOutput _mtl_o;
14  half4 c_1;
15  half3x3 tmpvar_2;
16  tmpvar_2[0].x = half(0.8164966);
17  tmpvar_2[0].y = half(-0.4082483);
18  tmpvar_2[0].z = half(-0.4082483);
19  tmpvar_2[1].x = half(0.0);
20  tmpvar_2[1].y = half(0.7071068);
21  tmpvar_2[1].z = half(-0.7071068);
22  tmpvar_2[2].x = half(0.5773503);
23  tmpvar_2[2].y = half(0.5773503);
24  tmpvar_2[2].z = half(0.5773503);
25  c_1.xyz = (tmpvar_2 * _mtl_i.inNormal);
26  c_1.w = half(0.0);
27  _mtl_o._glesFragData = c_1;
28  return _mtl_o;
29}
30
31
32// stats: 11 alu 0 tex 0 flow
33// inputs: 1
34//  #0: inNormal (medium float) 3x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt
r245570r245571
99
1010mediump vec4 xlat_main(in highp vec4 uv) {
1111    mediump vec4 c;
12    c = texture(texlow, uv.xy);
13    c += texture(texmed, uv.xy);
14    c += texture(texhigh, uv.xy);
15    c += texture(cubelow, uv.xyz);
16    c += texture(cubemed, uv.xyz);
17    c += texture(cubehigh, uv.xyz);
12    c = texture2D(texlow, uv.xy);
13    c += texture2D(texmed, uv.xy);
14    c += texture2D(texhigh, uv.xy);
15    c += textureCube(cubelow, uv.xyz);
16    c += textureCube(cubemed, uv.xyz);
17    c += textureCube(cubehigh, uv.xyz);
1818    return c;
1919}
2020in highp vec4 varUV;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt
r245570r245571
11#extension GL_EXT_shader_texture_lod : enable
2lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
3{
4#if defined(GL_EXT_shader_texture_lod)
5   return texture2DLodEXT(sampler, coord, lod);
6#else
7   return texture2D(sampler, coord, lod);
8#endif
9}
10
112uniform sampler2D tex;
123varying highp vec4 xlv_TEXCOORD0;
134void main ()
145{
156  mediump vec4 tmpvar_1;
167  lowp vec4 tmpvar_2;
17  tmpvar_2 = impl_low_texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0);
8  tmpvar_2 = texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0);
189  tmpvar_1 = tmpvar_2;
1910  gl_FragData[0] = tmpvar_1;
2011}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt
r245570r245571
66void main ()
77{
88  lowp vec4 c_1;
9  c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, ivec2(4, 5), 0.5));
9  c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, 0.5, ivec2(4, 5)));
1010  c_1 = (c_1 + textureOffset (vol, uv, ivec3(-2, -3, -4)));
11  c_1 = (c_1 + textureOffset (vol, uv, ivec3(4, 5, 6), -0.5));
11  c_1 = (c_1 + textureOffset (vol, uv, -0.5, ivec3(4, 5, 6)));
1212  c_1 = (c_1 + texelFetch (tex, ivec2(1, 2), 1));
1313  c_1 = (c_1 + texelFetch (vol, ivec3(1, 2, 3), 2));
1414  c_1 = (c_1 + texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3)));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
r245570r245571
11#extension GL_EXT_shader_texture_lod : enable
22#extension GL_EXT_shadow_samplers : enable
3lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec4 coord, mediump float lod)
4{
5#if defined(GL_EXT_shader_texture_lod)
6   return texture2DProjLodEXT(sampler, coord, lod);
7#else
8   return texture2DProj(sampler, coord, lod);
9#endif
10}
11
12lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec3 coord, mediump float lod)
13{
14#if defined(GL_EXT_shader_texture_lod)
15   return texture2DProjLodEXT(sampler, coord, lod);
16#else
17   return texture2DProj(sampler, coord, lod);
18#endif
19}
20
213uniform sampler2D tex;
224uniform lowp sampler2DShadow shadowmap;
235varying highp vec4 uv;
r245570r245571
257{
268  lowp vec4 c_1;
279  c_1 = (texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz));
28  c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv, 1.0));
29  c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv.xyz, 1.0));
10  c_1 = (c_1 + texture2DProjLodEXT (tex, uv, 1.0));
11  c_1 = (c_1 + texture2DProjLodEXT (tex, uv.xyz, 1.0));
3012  c_1 = (c_1 + vec4(shadow2DEXT (shadowmap, uv.xyz)));
3113  c_1 = (c_1 + vec4(shadow2DProjEXT (shadowmap, uv)));
3214  gl_FragColor = c_1;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt
r245570r245571
1#version 300 es
2
3// A variant produced by Unity's directional lightmap;
4// has an inline medium precision matrix constructor,
5// but even if unity_DirBasis is declared as mediump
6// some code was promoting it to high precision.
7
8#define gl_FragColor _glesFragData[0]
9#define gl_FragData _glesFragData
10layout(location = 0)out mediump vec4 _glesFragData[4];
11
12mat3 xll_transpose_mf3x3(mat3 m) {
13  return mat3( m[0][0], m[1][0], m[2][0],
14               m[0][1], m[1][1], m[2][1],
15               m[0][2], m[1][2], m[2][2]);
16}
17vec3 xll_saturate_vf3( vec3 x) {
18  return clamp( x, 0.0, 1.0);
19}
20struct SurfaceOutput {
21    lowp vec3 Albedo;
22    lowp vec3 Normal;
23    lowp vec3 Emission;
24    mediump float Specular;
25    lowp float Gloss;
26    lowp float Alpha;
27};
28struct Input {
29    highp vec2 uv_MainTex;
30};
31struct v2f_surf {
32    highp vec4 pos;
33    highp vec2 pack0;
34    lowp vec3 tSpace0;
35    lowp vec3 tSpace1;
36    lowp vec3 tSpace2;
37    highp vec4 lmap;
38};
39uniform mediump vec4 _WorldSpaceLightPos0;
40uniform sampler2D unity_Lightmap;
41uniform sampler2D unity_LightmapInd;
42uniform lowp vec4 _LightColor0;
43uniform lowp vec4 _SpecColor;
44uniform sampler2D _MainTex;
45uniform highp vec4 _MainTex_ST;
46lowp vec3 DecodeLightmapDoubleLDR( in lowp vec4 color ) {
47    return (2.0 * color.xyz);
48}
49lowp vec3 DecodeLightmap( in lowp vec4 color ) {
50   
51    return DecodeLightmapDoubleLDR( color);
52}
53mediump vec3 DirLightmapDiffuse( in mediump mat3 dirBasis, in lowp vec4 color, in lowp vec4 scale, in mediump vec3 normal, in bool surfFuncWritesNormal, out mediump vec3 scalePerBasisVector ) {
54    mediump vec3 lm = DecodeLightmap( color);
55   
56    scalePerBasisVector = DecodeLightmap( scale);
57    if (surfFuncWritesNormal){
58       
59        mediump vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal));
60        lm *= dot( normalInRnmBasis, scalePerBasisVector);
61    }
62   
63    return lm;
64}
65mediump vec4 LightingLambert_DirLightmap( in SurfaceOutput s, in lowp vec4 color, in lowp vec4 scale, in bool surfFuncWritesNormal ) {
66    mediump mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.8164966, 0.0, 0.5773503), vec3( -0.4082483, 0.7071068, 0.5773503), vec3( -0.4082483, -0.7071068, 0.5773503)));
67    mediump vec3 scalePerBasisVector;
68   
69    mediump vec4 c;
70    c.xyz = DirLightmapDiffuse( unity_DirBasis, color, scale, s.Normal, surfFuncWritesNormal, scalePerBasisVector);
71    c.w = 0.0;
72   
73    return c;
74}
75void surf( in Input IN, inout SurfaceOutput o ) {
76    mediump vec4 c = texture( _MainTex, IN.uv_MainTex);
77    o.Albedo = c.xyz;
78    o.Alpha = c.w;
79   
80    o.Normal = ((c.xyz * 2.0) - 1.0);
81}
82lowp vec4 frag_surf( in v2f_surf IN ) {
83    Input surfIN;
84   
85    surfIN.uv_MainTex = IN.pack0.xy;
86    highp vec3 lightDir = _WorldSpaceLightPos0.xyz;
87   
88    SurfaceOutput o;
89    o.Albedo = vec3( 0.0);
90    o.Emission = vec3( 0.0);
91   
92    o.Specular = 0.0;
93    o.Alpha = 0.0;
94    o.Gloss = 0.0;
95    lowp vec3 normalWorldVertex = vec3( 0.0, 0.0, 1.0);
96   
97    surf( surfIN, o);
98    lowp float atten = 1.0;
99   
100    lowp vec4 c = vec4( 0.0);
101   
102    lowp vec4 lmtex = texture( unity_Lightmap, IN.lmap.xy);
103    lowp vec4 lmIndTex = texture( unity_LightmapInd, IN.lmap.xy);
104    mediump vec3 lm = LightingLambert_DirLightmap( o, lmtex, lmIndTex, true).xyz;
105   
106    lowp vec3 worldN;
107    worldN.x = dot( IN.tSpace0.xyz, o.Normal);
108    worldN.y = dot( IN.tSpace1.xyz, o.Normal);
109    worldN.z = dot( IN.tSpace2.xyz, o.Normal);
110   
111    o.Normal = worldN;
112   
113    c.w = o.Alpha;
114   
115    c.xyz += (o.Albedo * lm);
116   
117    c.w = 1.0;
118    return c;
119}
120in highp vec2 xlv_TEXCOORD0;
121in lowp vec3 xlv_TEXCOORD1;
122in lowp vec3 xlv_TEXCOORD2;
123in lowp vec3 xlv_TEXCOORD3;
124in highp vec4 xlv_TEXCOORD4;
125void main() {
126    lowp vec4 xl_retval;
127    v2f_surf xlt_IN;
128    xlt_IN.pos = vec4(0.0);
129    xlt_IN.pack0 = vec2(xlv_TEXCOORD0);
130    xlt_IN.tSpace0 = vec3(xlv_TEXCOORD1);
131    xlt_IN.tSpace1 = vec3(xlv_TEXCOORD2);
132    xlt_IN.tSpace2 = vec3(xlv_TEXCOORD3);
133    xlt_IN.lmap = vec4(xlv_TEXCOORD4);
134    xl_retval = frag_surf( xlt_IN);
135    gl_FragData[0] = vec4(xl_retval);
136}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt
r245570r245571
1#version 300 es
2layout(location=0) out mediump vec4 _glesFragData[4];
3uniform sampler2D unity_Lightmap;
4uniform sampler2D unity_LightmapInd;
5uniform sampler2D _MainTex;
6in highp vec2 xlv_TEXCOORD0;
7in highp vec4 xlv_TEXCOORD4;
8void main ()
9{
10  lowp vec4 c_1;
11  lowp vec3 tmpvar_2;
12  lowp vec3 tmpvar_3;
13  mediump vec4 c_4;
14  lowp vec4 tmpvar_5;
15  tmpvar_5 = texture (_MainTex, xlv_TEXCOORD0);
16  c_4 = tmpvar_5;
17  tmpvar_2 = c_4.xyz;
18  tmpvar_3 = ((c_4.xyz * 2.0) - 1.0);
19  mediump mat3 tmpvar_6;
20  tmpvar_6[uint(0)].x = 0.8164966;
21  tmpvar_6[uint(0)].y = -0.4082483;
22  tmpvar_6[uint(0)].z = -0.4082483;
23  tmpvar_6[1u].x = 0.0;
24  tmpvar_6[1u].y = 0.7071068;
25  tmpvar_6[1u].z = -0.7071068;
26  tmpvar_6[2u].x = 0.5773503;
27  tmpvar_6[2u].y = 0.5773503;
28  tmpvar_6[2u].z = 0.5773503;
29  mediump vec3 normal_7;
30  normal_7 = tmpvar_3;
31  mediump vec3 scalePerBasisVector_8;
32  mediump vec3 lm_9;
33  lowp vec3 tmpvar_10;
34  tmpvar_10 = (2.0 * texture (unity_Lightmap, xlv_TEXCOORD4.xy).xyz);
35  lm_9 = tmpvar_10;
36  lowp vec3 tmpvar_11;
37  tmpvar_11 = (2.0 * texture (unity_LightmapInd, xlv_TEXCOORD4.xy).xyz);
38  scalePerBasisVector_8 = tmpvar_11;
39  lm_9 = (lm_9 * dot (clamp (
40    (tmpvar_6 * normal_7)
41  , 0.0, 1.0), scalePerBasisVector_8));
42  c_1.xyz = (tmpvar_2 * lm_9);
43  c_1.w = 1.0;
44  _glesFragData[0] = c_1;
45}
46
47
48// stats: 19 alu 3 tex 0 flow
49// inputs: 2
50//  #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
51//  #1: xlv_TEXCOORD4 (high float) 4x1 [-1]
52// textures: 3
53//  #0: unity_Lightmap (low 2d) 0x0 [-1]
54//  #1: unity_LightmapInd (low 2d) 0x0 [-1]
55//  #2: _MainTex (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  float2 xlv_TEXCOORD0;
5  float4 xlv_TEXCOORD4;
6};
7struct xlatMtlShaderOutput {
8  half4 _glesFragData_0 [[color(0)]];
9};
10struct xlatMtlShaderUniform {
11};
12fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
13  ,   texture2d<half> unity_Lightmap [[texture(0)]], sampler _mtlsmp_unity_Lightmap [[sampler(0)]]
14  ,   texture2d<half> unity_LightmapInd [[texture(1)]], sampler _mtlsmp_unity_LightmapInd [[sampler(1)]]
15  ,   texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]])
16{
17  xlatMtlShaderOutput _mtl_o;
18  half4 c_1;
19  half3 tmpvar_2;
20  half3 tmpvar_3;
21  half4 c_4;
22  half4 tmpvar_5;
23  tmpvar_5 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
24  c_4 = tmpvar_5;
25  tmpvar_2 = c_4.xyz;
26  tmpvar_3 = ((c_4.xyz * (half)2.0) - (half)1.0);
27  half3x3 tmpvar_6;
28  tmpvar_6[0].x = half(0.8164966);
29  tmpvar_6[0].y = half(-0.4082483);
30  tmpvar_6[0].z = half(-0.4082483);
31  tmpvar_6[1].x = half(0.0);
32  tmpvar_6[1].y = half(0.7071068);
33  tmpvar_6[1].z = half(-0.7071068);
34  tmpvar_6[2].x = half(0.5773503);
35  tmpvar_6[2].y = half(0.5773503);
36  tmpvar_6[2].z = half(0.5773503);
37  half3 normal_7;
38  normal_7 = tmpvar_3;
39  half3 scalePerBasisVector_8;
40  half3 lm_9;
41  half3 tmpvar_10;
42  tmpvar_10 = ((half)2.0 * unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
43  lm_9 = tmpvar_10;
44  half3 tmpvar_11;
45  tmpvar_11 = ((half)2.0 * unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
46  scalePerBasisVector_8 = tmpvar_11;
47  lm_9 = (lm_9 * dot (clamp (
48    (tmpvar_6 * normal_7)
49  , (half)0.0, (half)1.0), scalePerBasisVector_8));
50  c_1.xyz = (tmpvar_2 * lm_9);
51  c_1.w = half(1.0);
52  _mtl_o._glesFragData_0 = c_1;
53  return _mtl_o;
54}
55
56
57// stats: 19 alu 3 tex 0 flow
58// inputs: 2
59//  #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
60//  #1: xlv_TEXCOORD4 (high float) 4x1 [-1]
61// textures: 3
62//  #0: unity_Lightmap (low 2d) 0x0 [-1] loc 0
63//  #1: unity_LightmapInd (low 2d) 0x0 [-1] loc 1
64//  #2: _MainTex (low 2d) 0x0 [-1] loc 2
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt
r245570r245571
1919  highp float tmpvar_5;
2020  tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0);
2121  sampleOnEpipolarLine_3 = tmpvar_5;
22  highp int tmpvar_6;
22  int tmpvar_6;
2323  tmpvar_6 = int(clamp (floor(
2424    (tmpvar_4 * 4.0)
2525  ), 0.0, 3.0));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt
r245570r245571
6060}
6161void surf( in Input IN, inout SurfaceOutput o ) {
6262    vec4 tex;
63    tex = texture( _MainTex, IN.uv_MainTex);
63    tex = texture2D( _MainTex, IN.uv_MainTex);
6464    o.Albedo = (tex.xyz  * _Color.xyz );
6565    o.Gloss = tex.w ;
6666    o.Alpha = (tex.w  * _Color.w );
6767    o.Specular = _Shininess;
68    o.Normal = vec3( UnpackNormal( texture( _BumpMap, IN.uv_BumpMap)));
68    o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
6969}
7070vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
7171    vec3 h;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt
r245570r245571
4545  c_8.w = (tmpvar_3 + ((_LightColor0.w * _SpecColor.w) * spec_9));
4646  c_1.xyz = (c_8.xyz + (tmpvar_2 * _uv3));
4747  c_1.w = tmpvar_3;
48  lowp vec4 tmpvar_11;
49  tmpvar_11 = c_1;
50  _fragData = tmpvar_11;
48  _fragData = c_1;
5149}
5250
5351
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt
r245570r245571
5555  c_8.w = (tmpvar_3 + ((_mtl_u._LightColor0.w * _mtl_u._SpecColor.w) * spec_9));
5656  c_1.xyz = (c_8.xyz + (tmpvar_2 * _mtl_i._uv3));
5757  c_1.w = tmpvar_3;
58  half4 tmpvar_12;
59  tmpvar_12 = c_1;
60  _mtl_o._fragData = tmpvar_12;
58  _mtl_o._fragData = c_1;
6159  return _mtl_o;
6260}
6361
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt
r245570r245571
3838    far = vec4( lessThan( vec4( z ), _LightSplitsFar) );
3939    weights = (near * far);
4040    coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000);
41    shadow = ( (texture( _ShadowMapTexture, coord.xy ).x  < coord.z ) ) ? ( _LightShadowData.x  ) : ( 1.00000 );
41    shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x  < coord.z ) ) ? ( _LightShadowData.x  ) : ( 1.00000 );
4242    return shadow;
4343}
4444highp float Linear01Depth( in highp float z ) {
r245570r245571
5858    highp vec4 vpos;
5959    mediump float shadow;
6060    highp vec4 res;
61    depth = texture( _CameraDepthTexture, i.uv).x ;
61    depth = texture2D( _CameraDepthTexture, i.uv).x ;
6262    depth = Linear01Depth( depth);
6363    vpos = vec4( (i.ray * depth), 1.00000);
6464    shadow = unitySampleShadow( vpos);
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt
r245570r245571
11#version 300 es
22out lowp vec4 _fragData;
33vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
4   return textureLod( s, coord.xy, coord.w);
4   return texture2DLod( s, coord.xy, coord.w);
55}
66uniform sampler2D _MainTex;
77uniform vec4 _MainTex_TexelSize;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt
r245570r245571
4242  vec4 tmpvar_24;
4343  tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0);
4444  float tmpvar_25;
45  tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x);
45  tmpvar_25 = ((tmpvar_17.y * 1.96321) + tmpvar_17.x);
4646  lumaN_15 = tmpvar_25;
4747  float tmpvar_26;
48  tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x);
48  tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x);
4949  float tmpvar_27;
50  tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x);
50  tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x);
5151  float tmpvar_28;
52  tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x);
52  tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x);
5353  float tmpvar_29;
54  tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x);
54  tmpvar_29 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x);
5555  lumaS_14 = tmpvar_29;
5656  float tmpvar_30;
5757  tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
r245570r245571
6060    min (tmpvar_26, tmpvar_29)
6161  , tmpvar_28)));
6262  float tmpvar_32;
63  tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125));
63  tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125));
6464  if ((tmpvar_31 < tmpvar_32)) {
6565    tmpvar_2 = tmpvar_20.xyz;
6666  } else {
r245570r245571
6969      ((abs((
7070        (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25)
7171       - tmpvar_27)) / tmpvar_31) - 0.25)
72    ) * 1.333333));
72    ) * 1.33333));
7373    vec4 tmpvar_34;
7474    tmpvar_34.zw = vec2(0.0, 0.0);
7575    tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
r245570r245571
9393    rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
9494      (tmpvar_37.xyz + tmpvar_39.xyz)
9595     + tmpvar_41.xyz)));
96    rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111));
96    rgbL_13 = (rgbL_13 * vec3(0.111111, 0.111111, 0.111111));
9797    float tmpvar_42;
98    tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x);
98    tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x);
9999    float tmpvar_43;
100    tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x);
100    tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x);
101101    float tmpvar_44;
102    tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x);
102    tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x);
103103    float tmpvar_45;
104    tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x);
104    tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x);
105105    bool tmpvar_46;
106106    tmpvar_46 = (((
107107      abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44)))
r245570r245571
186186      if (!(doneN_5)) {
187187        vec4 tmpvar_56;
188188        tmpvar_56 = texture2DLod (_MainTex, posN_10, 0.0);
189        lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x);
189        lumaEndN_7 = ((tmpvar_56.y * 1.96321) + tmpvar_56.x);
190190      };
191191      if (!(doneP_4)) {
192192        vec4 tmpvar_57;
193193        tmpvar_57 = texture2DLod (_MainTex, posP_9, 0.0);
194        lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x);
194        lumaEndP_6 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x);
195195      };
196196      bool tmpvar_58;
197197      if (doneN_5) {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt
r245570r245571
4343  lowp vec4 tmpvar_24;
4444  tmpvar_24 = textureLod (_MainTex, tmpvar_23.xy, 0.0);
4545  lowp float tmpvar_25;
46  tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x);
46  tmpvar_25 = ((tmpvar_17.y * 1.96321) + tmpvar_17.x);
4747  lumaN_15 = tmpvar_25;
4848  lowp float tmpvar_26;
49  tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x);
49  tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x);
5050  lowp float tmpvar_27;
51  tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x);
51  tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x);
5252  lowp float tmpvar_28;
53  tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x);
53  tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x);
5454  lowp float tmpvar_29;
55  tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x);
55  tmpvar_29 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x);
5656  lumaS_14 = tmpvar_29;
5757  lowp float tmpvar_30;
5858  tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
r245570r245571
6161    min (tmpvar_26, tmpvar_29)
6262  , tmpvar_28)));
6363  lowp float tmpvar_32;
64  tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125));
64  tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125));
6565  if ((tmpvar_31 < tmpvar_32)) {
6666    tmpvar_2 = tmpvar_20.xyz;
6767  } else {
r245570r245571
7070      ((abs((
7171        (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25)
7272       - tmpvar_27)) / tmpvar_31) - 0.25)
73    ) * 1.333333));
73    ) * 1.33333));
7474    highp vec4 tmpvar_34;
7575    tmpvar_34.zw = vec2(0.0, 0.0);
7676    tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
r245570r245571
9494    rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
9595      (tmpvar_37.xyz + tmpvar_39.xyz)
9696     + tmpvar_41.xyz)));
97    rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111));
97    rgbL_13 = (rgbL_13 * vec3(0.111111, 0.111111, 0.111111));
9898    lowp float tmpvar_42;
99    tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x);
99    tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x);
100100    lowp float tmpvar_43;
101    tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x);
101    tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x);
102102    lowp float tmpvar_44;
103    tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x);
103    tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x);
104104    lowp float tmpvar_45;
105    tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x);
105    tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x);
106106    bool tmpvar_46;
107107    tmpvar_46 = (((
108108      abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44)))
r245570r245571
183183    doneP_4 = bool(0);
184184    posN_10 = (posN_10 - tmpvar_53);
185185    posP_9 = (posP_9 + tmpvar_53);
186    for (highp int i_3 = 0; i_3 < 16; i_3++) {
186    for (int i_3 = 0; i_3 < 16; i_3++) {
187187      if (!(doneN_5)) {
188188        lowp vec4 tmpvar_56;
189189        tmpvar_56 = textureLod (_MainTex, posN_10, 0.0);
190        lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x);
190        lumaEndN_7 = ((tmpvar_56.y * 1.96321) + tmpvar_56.x);
191191      };
192192      if (!(doneP_4)) {
193193        lowp vec4 tmpvar_57;
194194        tmpvar_57 = textureLod (_MainTex, posP_9, 0.0);
195        lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x);
195        lumaEndP_6 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x);
196196      };
197197      bool tmpvar_58;
198198      if (doneN_5) {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt
r245570r245571
5151  half4 tmpvar_24;
5252  tmpvar_24 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
5353  half tmpvar_25;
54  tmpvar_25 = ((tmpvar_17.y * (half)1.963211) + tmpvar_17.x);
54  tmpvar_25 = ((tmpvar_17.y * (half)1.96321) + tmpvar_17.x);
5555  lumaN_15 = tmpvar_25;
5656  half tmpvar_26;
57  tmpvar_26 = ((tmpvar_19.y * (half)1.963211) + tmpvar_19.x);
57  tmpvar_26 = ((tmpvar_19.y * (half)1.96321) + tmpvar_19.x);
5858  half tmpvar_27;
59  tmpvar_27 = ((tmpvar_20.y * (half)1.963211) + tmpvar_20.x);
59  tmpvar_27 = ((tmpvar_20.y * (half)1.96321) + tmpvar_20.x);
6060  half tmpvar_28;
61  tmpvar_28 = ((tmpvar_22.y * (half)1.963211) + tmpvar_22.x);
61  tmpvar_28 = ((tmpvar_22.y * (half)1.96321) + tmpvar_22.x);
6262  half tmpvar_29;
63  tmpvar_29 = ((tmpvar_24.y * (half)1.963211) + tmpvar_24.x);
63  tmpvar_29 = ((tmpvar_24.y * (half)1.96321) + tmpvar_24.x);
6464  lumaS_14 = tmpvar_29;
6565  half tmpvar_30;
6666  tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
r245570r245571
6969    min (tmpvar_26, tmpvar_29)
7070  , tmpvar_28)));
7171  half tmpvar_32;
72  tmpvar_32 = max ((half)0.04166667, (tmpvar_30 * (half)0.125));
72  tmpvar_32 = max ((half)0.0416667, (tmpvar_30 * (half)0.125));
7373  if ((tmpvar_31 < tmpvar_32)) {
7474    tmpvar_2 = tmpvar_20.xyz;
7575  } else {
r245570r245571
7878      ((abs((
7979        (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)0.25)
8080       - tmpvar_27)) / tmpvar_31) - (half)0.25)
81    ) * (half)1.333333));
81    ) * (half)1.33333));
8282    float4 tmpvar_34;
8383    tmpvar_34.zw = float2(0.0, 0.0);
8484    tmpvar_34.xy = (_mtl_i.xlv_TEXCOORD0 - _mtl_u._MainTex_TexelSize.xy);
r245570r245571
102102    rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
103103      (tmpvar_37.xyz + tmpvar_39.xyz)
104104     + tmpvar_41.xyz)));
105    rgbL_13 = (rgbL_13 * (half3)float3(0.1111111, 0.1111111, 0.1111111));
105    rgbL_13 = (rgbL_13 * (half3)float3(0.111111, 0.111111, 0.111111));
106106    half tmpvar_42;
107    tmpvar_42 = ((tmpvar_35.y * (half)1.963211) + tmpvar_35.x);
107    tmpvar_42 = ((tmpvar_35.y * (half)1.96321) + tmpvar_35.x);
108108    half tmpvar_43;
109    tmpvar_43 = ((tmpvar_37.y * (half)1.963211) + tmpvar_37.x);
109    tmpvar_43 = ((tmpvar_37.y * (half)1.96321) + tmpvar_37.x);
110110    half tmpvar_44;
111    tmpvar_44 = ((tmpvar_39.y * (half)1.963211) + tmpvar_39.x);
111    tmpvar_44 = ((tmpvar_39.y * (half)1.96321) + tmpvar_39.x);
112112    half tmpvar_45;
113    tmpvar_45 = ((tmpvar_41.y * (half)1.963211) + tmpvar_41.x);
113    tmpvar_45 = ((tmpvar_41.y * (half)1.96321) + tmpvar_41.x);
114114    bool tmpvar_46;
115115    tmpvar_46 = (((
116116      abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_26)) + ((half)0.25 * tmpvar_44)))
r245570r245571
195195      if (!(doneN_5)) {
196196        half4 tmpvar_56;
197197        tmpvar_56 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posN_10), level(0.0));
198        lumaEndN_7 = ((tmpvar_56.y * (half)1.963211) + tmpvar_56.x);
198        lumaEndN_7 = ((tmpvar_56.y * (half)1.96321) + tmpvar_56.x);
199199      };
200200      if (!(doneP_4)) {
201201        half4 tmpvar_57;
202202        tmpvar_57 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posP_9), level(0.0));
203        lumaEndP_6 = ((tmpvar_57.y * (half)1.963211) + tmpvar_57.x);
203        lumaEndP_6 = ((tmpvar_57.y * (half)1.96321) + tmpvar_57.x);
204204      };
205205      bool tmpvar_58;
206206      if (doneN_5) {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt
r245570r245571
11#extension GL_EXT_shader_texture_lod : enable
2lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
3{
4#if defined(GL_EXT_shader_texture_lod)
5   return texture2DLodEXT(sampler, coord, lod);
6#else
7   return texture2D(sampler, coord, lod);
8#endif
9}
10
112uniform sampler2D _MainTex;
123uniform highp vec4 _MainTex_TexelSize;
134varying highp vec2 xlv_TEXCOORD0;
r245570r245571
2819  highp float lumaM_10;
2920  highp float lumaNe_11;
3021  lowp vec4 tmpvar_12;
31  tmpvar_12 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0);
22  tmpvar_12 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0);
3223  highp float tmpvar_13;
3324  tmpvar_13 = tmpvar_12.y;
3425  lowp vec4 tmpvar_14;
35  tmpvar_14 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0);
26  tmpvar_14 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0);
3627  highp float tmpvar_15;
3728  tmpvar_15 = tmpvar_14.y;
3829  lowp vec4 tmpvar_16;
39  tmpvar_16 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0);
30  tmpvar_16 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0);
4031  highp float tmpvar_17;
4132  tmpvar_17 = tmpvar_16.y;
4233  lowp vec4 tmpvar_18;
43  tmpvar_18 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0);
34  tmpvar_18 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0);
4435  highp float tmpvar_19;
4536  tmpvar_19 = tmpvar_18.y;
4637  lowp vec4 tmpvar_20;
47  tmpvar_20 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
38  tmpvar_20 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
4839  lumaM_10 = tmpvar_20.y;
4940  lumaNe_11 = (tmpvar_17 + 0.00260417);
5041  highp float tmpvar_21;
r245570r245571
7970    highp vec4 tmpvar_29;
8071    tmpvar_29.zw = vec2(0.0, 0.0);
8172    tmpvar_29.xy = (xlv_TEXCOORD0 + (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw));
82    rgbyA_5 = (impl_low_texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0));
83    rgbyB_4 = (((impl_low_texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25));
73    rgbyA_5 = (texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0));
74    rgbyB_4 = (((texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25));
8475    if (((rgbyB_4.y < tmpvar_22) || (rgbyB_4.y > tmpvar_21))) {
8576      rgbyB_4.xyz = (rgbyA_5.xyz * 0.5);
8677    };
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
r245570r245571
11#extension GL_EXT_shader_texture_lod : enable
2lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
3{
4#if defined(GL_EXT_shader_texture_lod)
5   return texture2DLodEXT(sampler, coord, lod);
6#else
7   return texture2D(sampler, coord, lod);
8#endif
9}
10
112uniform sampler2D _MainTex;
123uniform highp vec4 _MainTex_TexelSize;
134varying highp vec2 xlv_TEXCOORD0;
r245570r245571
5748  highp vec2 posM_41;
5849  posM_41 = xlv_TEXCOORD0;
5950  lowp vec4 tmpvar_42;
60  tmpvar_42 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
51  tmpvar_42 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
6152  rgbyM_40 = tmpvar_42;
6253  highp vec4 tmpvar_43;
6354  tmpvar_43.zw = vec2(0.0, 0.0);
6455  tmpvar_43.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
6556  lowp vec4 tmpvar_44;
66  tmpvar_44 = impl_low_texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0);
57  tmpvar_44 = texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0);
6758  highp vec4 rgba_45;
6859  rgba_45 = tmpvar_44;
6960  lumaS_39 = rgba_45.w;
r245570r245571
7162  tmpvar_46.zw = vec2(0.0, 0.0);
7263  tmpvar_46.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
7364  lowp vec4 tmpvar_47;
74  tmpvar_47 = impl_low_texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0);
65  tmpvar_47 = texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0);
7566  highp float tmpvar_48;
7667  highp vec4 rgba_49;
7768  rgba_49 = tmpvar_47;
r245570r245571
8071  tmpvar_50.zw = vec2(0.0, 0.0);
8172  tmpvar_50.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
8273  lowp vec4 tmpvar_51;
83  tmpvar_51 = impl_low_texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0);
74  tmpvar_51 = texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0);
8475  highp vec4 rgba_52;
8576  rgba_52 = tmpvar_51;
8677  lumaN_38 = rgba_52.w;
r245570r245571
8879  tmpvar_53.zw = vec2(0.0, 0.0);
8980  tmpvar_53.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
9081  lowp vec4 tmpvar_54;
91  tmpvar_54 = impl_low_texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0);
82  tmpvar_54 = texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0);
9283  highp float tmpvar_55;
9384  highp vec4 rgba_56;
9485  rgba_56 = tmpvar_54;
r245570r245571
10596    tmpvar_58.zw = vec2(0.0, 0.0);
10697    tmpvar_58.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
10798    lowp vec4 tmpvar_59;
108    tmpvar_59 = impl_low_texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0);
99    tmpvar_59 = texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0);
109100    highp vec4 rgba_60;
110101    rgba_60 = tmpvar_59;
111102    highp vec4 tmpvar_61;
112103    tmpvar_61.zw = vec2(0.0, 0.0);
113104    tmpvar_61.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
114105    lowp vec4 tmpvar_62;
115    tmpvar_62 = impl_low_texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0);
106    tmpvar_62 = texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0);
116107    highp vec4 rgba_63;
117108    rgba_63 = tmpvar_62;
118109    highp vec4 tmpvar_64;
119110    tmpvar_64.zw = vec2(0.0, 0.0);
120111    tmpvar_64.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
121112    lowp vec4 tmpvar_65;
122    tmpvar_65 = impl_low_texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0);
113    tmpvar_65 = texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0);
123114    highp vec4 rgba_66;
124115    rgba_66 = tmpvar_65;
125116    highp vec4 tmpvar_67;
126117    tmpvar_67.zw = vec2(0.0, 0.0);
127118    tmpvar_67.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
128119    lowp vec4 tmpvar_68;
129    tmpvar_68 = impl_low_texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0);
120    tmpvar_68 = texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0);
130121    highp vec4 rgba_69;
131122    rgba_69 = tmpvar_68;
132123    lumaNS_36 = (rgba_52.w + rgba_45.w);
r245570r245571
196187    posP_20.y = (posB_22.y + tmpvar_73);
197188    subpixD_19 = ((-2.0 * tmpvar_71) + 3.0);
198189    lowp vec4 tmpvar_74;
199    tmpvar_74 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
190    tmpvar_74 = texture2DLodEXT (_MainTex, posN_21, 0.0);
200191    highp vec4 rgba_75;
201192    rgba_75 = tmpvar_74;
202193    lumaEndN_18 = rgba_75.w;
203194    subpixE_17 = (tmpvar_71 * tmpvar_71);
204195    lowp vec4 tmpvar_76;
205    tmpvar_76 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
196    tmpvar_76 = texture2DLodEXT (_MainTex, posP_20, 0.0);
206197    highp vec4 rgba_77;
207198    rgba_77 = tmpvar_76;
208199    lumaEndP_16 = rgba_77.w;
r245570r245571
232223    if (doneNP_10) {
233224      if (!(doneN_12)) {
234225        lowp vec4 tmpvar_78;
235        tmpvar_78 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
226        tmpvar_78 = texture2DLodEXT (_MainTex, posN_21, 0.0);
236227        highp vec4 rgba_79;
237228        rgba_79 = tmpvar_78;
238229        lumaEndN_18 = rgba_79.w;
239230      };
240231      if (!(doneP_11)) {
241232        lowp vec4 tmpvar_80;
242        tmpvar_80 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
233        tmpvar_80 = texture2DLodEXT (_MainTex, posP_20, 0.0);
243234        highp vec4 rgba_81;
244235        rgba_81 = tmpvar_80;
245236        lumaEndP_16 = rgba_81.w;
r245570r245571
268259      if (doneNP_10) {
269260        if (!(doneN_12)) {
270261          lowp vec4 tmpvar_82;
271          tmpvar_82 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
262          tmpvar_82 = texture2DLodEXT (_MainTex, posN_21, 0.0);
272263          highp vec4 rgba_83;
273264          rgba_83 = tmpvar_82;
274265          lumaEndN_18 = rgba_83.w;
275266        };
276267        if (!(doneP_11)) {
277268          lowp vec4 tmpvar_84;
278          tmpvar_84 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
269          tmpvar_84 = texture2DLodEXT (_MainTex, posP_20, 0.0);
279270          highp vec4 rgba_85;
280271          rgba_85 = tmpvar_84;
281272          lumaEndP_16 = rgba_85.w;
r245570r245571
304295        if (doneNP_10) {
305296          if (!(doneN_12)) {
306297            lowp vec4 tmpvar_86;
307            tmpvar_86 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
298            tmpvar_86 = texture2DLodEXT (_MainTex, posN_21, 0.0);
308299            highp vec4 rgba_87;
309300            rgba_87 = tmpvar_86;
310301            lumaEndN_18 = rgba_87.w;
311302          };
312303          if (!(doneP_11)) {
313304            lowp vec4 tmpvar_88;
314            tmpvar_88 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
305            tmpvar_88 = texture2DLodEXT (_MainTex, posP_20, 0.0);
315306            highp vec4 rgba_89;
316307            rgba_89 = tmpvar_88;
317308            lumaEndP_16 = rgba_89.w;
r245570r245571
340331          if (doneNP_10) {
341332            if (!(doneN_12)) {
342333              lowp vec4 tmpvar_90;
343              tmpvar_90 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
334              tmpvar_90 = texture2DLodEXT (_MainTex, posN_21, 0.0);
344335              highp vec4 rgba_91;
345336              rgba_91 = tmpvar_90;
346337              lumaEndN_18 = rgba_91.w;
347338            };
348339            if (!(doneP_11)) {
349340              lowp vec4 tmpvar_92;
350              tmpvar_92 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
341              tmpvar_92 = texture2DLodEXT (_MainTex, posP_20, 0.0);
351342              highp vec4 rgba_93;
352343              rgba_93 = tmpvar_92;
353344              lumaEndP_16 = rgba_93.w;
r245570r245571
376367            if (doneNP_10) {
377368              if (!(doneN_12)) {
378369                lowp vec4 tmpvar_94;
379                tmpvar_94 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
370                tmpvar_94 = texture2DLodEXT (_MainTex, posN_21, 0.0);
380371                highp vec4 rgba_95;
381372                rgba_95 = tmpvar_94;
382373                lumaEndN_18 = rgba_95.w;
383374              };
384375              if (!(doneP_11)) {
385376                lowp vec4 tmpvar_96;
386                tmpvar_96 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
377                tmpvar_96 = texture2DLodEXT (_MainTex, posP_20, 0.0);
387378                highp vec4 rgba_97;
388379                rgba_97 = tmpvar_96;
389380                lumaEndP_16 = rgba_97.w;
r245570r245571
412403              if (doneNP_10) {
413404                if (!(doneN_12)) {
414405                  lowp vec4 tmpvar_98;
415                  tmpvar_98 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
406                  tmpvar_98 = texture2DLodEXT (_MainTex, posN_21, 0.0);
416407                  highp vec4 rgba_99;
417408                  rgba_99 = tmpvar_98;
418409                  lumaEndN_18 = rgba_99.w;
419410                };
420411                if (!(doneP_11)) {
421412                  lowp vec4 tmpvar_100;
422                  tmpvar_100 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
413                  tmpvar_100 = texture2DLodEXT (_MainTex, posP_20, 0.0);
423414                  highp vec4 rgba_101;
424415                  rgba_101 = tmpvar_100;
425416                  lumaEndP_16 = rgba_101.w;
r245570r245571
448439                if (doneNP_10) {
449440                  if (!(doneN_12)) {
450441                    lowp vec4 tmpvar_102;
451                    tmpvar_102 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
442                    tmpvar_102 = texture2DLodEXT (_MainTex, posN_21, 0.0);
452443                    highp vec4 rgba_103;
453444                    rgba_103 = tmpvar_102;
454445                    lumaEndN_18 = rgba_103.w;
455446                  };
456447                  if (!(doneP_11)) {
457448                    lowp vec4 tmpvar_104;
458                    tmpvar_104 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
449                    tmpvar_104 = texture2DLodEXT (_MainTex, posP_20, 0.0);
459450                    highp vec4 rgba_105;
460451                    rgba_105 = tmpvar_104;
461452                    lumaEndP_16 = rgba_105.w;
r245570r245571
484475                  if (doneNP_10) {
485476                    if (!(doneN_12)) {
486477                      lowp vec4 tmpvar_106;
487                      tmpvar_106 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
478                      tmpvar_106 = texture2DLodEXT (_MainTex, posN_21, 0.0);
488479                      highp vec4 rgba_107;
489480                      rgba_107 = tmpvar_106;
490481                      lumaEndN_18 = rgba_107.w;
491482                    };
492483                    if (!(doneP_11)) {
493484                      lowp vec4 tmpvar_108;
494                      tmpvar_108 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
485                      tmpvar_108 = texture2DLodEXT (_MainTex, posP_20, 0.0);
495486                      highp vec4 rgba_109;
496487                      rgba_109 = tmpvar_108;
497488                      lumaEndP_16 = rgba_109.w;
r245570r245571
520511                    if (doneNP_10) {
521512                      if (!(doneN_12)) {
522513                        lowp vec4 tmpvar_110;
523                        tmpvar_110 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
514                        tmpvar_110 = texture2DLodEXT (_MainTex, posN_21, 0.0);
524515                        highp vec4 rgba_111;
525516                        rgba_111 = tmpvar_110;
526517                        lumaEndN_18 = rgba_111.w;
527518                      };
528519                      if (!(doneP_11)) {
529520                        lowp vec4 tmpvar_112;
530                        tmpvar_112 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
521                        tmpvar_112 = texture2DLodEXT (_MainTex, posP_20, 0.0);
531522                        highp vec4 rgba_113;
532523                        rgba_113 = tmpvar_112;
533524                        lumaEndP_16 = rgba_113.w;
r245570r245571
556547                      if (doneNP_10) {
557548                        if (!(doneN_12)) {
558549                          lowp vec4 tmpvar_114;
559                          tmpvar_114 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
550                          tmpvar_114 = texture2DLodEXT (_MainTex, posN_21, 0.0);
560551                          highp vec4 rgba_115;
561552                          rgba_115 = tmpvar_114;
562553                          lumaEndN_18 = rgba_115.w;
563554                        };
564555                        if (!(doneP_11)) {
565556                          lowp vec4 tmpvar_116;
566                          tmpvar_116 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
557                          tmpvar_116 = texture2DLodEXT (_MainTex, posP_20, 0.0);
567558                          highp vec4 rgba_117;
568559                          rgba_117 = tmpvar_116;
569560                          lumaEndP_16 = rgba_117.w;
r245570r245571
635626      posM_41.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31));
636627    };
637628    lowp vec4 tmpvar_122;
638    tmpvar_122 = impl_low_texture2DLodEXT (_MainTex, posM_41, 0.0);
629    tmpvar_122 = texture2DLodEXT (_MainTex, posM_41, 0.0);
639630    highp vec4 tmpvar_123;
640631    tmpvar_123.xyz = tmpvar_122.xyz;
641632    tmpvar_123.w = rgbyM_40.w;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt
r245570r245571
6969}
7070highp float SampleCubeDistance( in highp vec3 vec ) {
7171    highp vec4 packDist;
72    packDist = texture( _ShadowMapTexture, vec);
72    packDist = textureCube( _ShadowMapTexture, vec);
7373    return DecodeFloatRGBA( packDist);
7474}
7575mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ) {
r245570r245571
111111    highp float fade;
112112    i.ray = (i.ray * (_ProjectionParams.z  / i.ray.z ));
113113    uv = (i.uv.xy  / i.uv.w );
114    nspec = texture( _CameraNormalsTexture, uv);
114    nspec = texture2D( _CameraNormalsTexture, uv);
115115    normal = ((nspec.xyz  * 2.00000) - 1.00000);
116116    normal = normalize( normal );
117    depth = texture( _CameraDepthTexture, uv).x ;
117    depth = texture2D( _CameraDepthTexture, uv).x ;
118118    depth = Linear01Depth( depth);
119119    vpos = vec4( (i.ray * depth), 1.00000);
120120    wpos = ( _CameraToWorld * vpos ).xyz ;
121121    tolight = (wpos - _LightPos.xyz );
122122    lightDir = ( -normalize( tolight ) );
123123    att = (dot( tolight, tolight) * _LightPos.w );
124    atten = texture( _LightTextureB0, vec2( vec2( att))).w ;
124    atten = texture2D( _LightTextureB0, vec2( vec2( att))).w ;
125125    atten *= ComputeShadow( tolight, vpos.z , uv);
126    atten *= texture( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ;
126    atten *= textureCube( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ;
127127    diff = max( 0.000000, dot( lightDir, normal));
128128    h = normalize( (lightDir - normalize( (wpos - _WorldSpaceCameraPos) )) );
129129    spec = pow( max( 0.000000, dot( h, normal)), (nspec.w  * 128.000));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt
r245570r245571
5656  highp float mydist_19;
5757  mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w);
5858  mydist_19 = (mydist_19 * 0.97);
59  highp vec4 shadowVals_20;
60  highp vec3 vec_21;
61  vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
62  highp vec4 packDist_22;
63  lowp vec4 tmpvar_23;
64  tmpvar_23 = textureCube (_ShadowMapTexture, vec_21);
65  packDist_22 = tmpvar_23;
66  shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
67  highp vec3 vec_24;
68  vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
69  highp vec4 packDist_25;
70  lowp vec4 tmpvar_26;
71  tmpvar_26 = textureCube (_ShadowMapTexture, vec_24);
72  packDist_25 = tmpvar_26;
73  shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
74  highp vec3 vec_27;
75  vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
76  highp vec4 packDist_28;
77  lowp vec4 tmpvar_29;
78  tmpvar_29 = textureCube (_ShadowMapTexture, vec_27);
79  packDist_28 = tmpvar_29;
80  shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
81  highp vec3 vec_30;
82  vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
83  highp vec4 packDist_31;
84  lowp vec4 tmpvar_32;
85  tmpvar_32 = textureCube (_ShadowMapTexture, vec_30);
86  packDist_31 = tmpvar_32;
87  shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
88  bvec4 tmpvar_33;
89  tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19));
90  highp vec4 tmpvar_34;
91  tmpvar_34 = _LightShadowData.xxxx;
92  highp float tmpvar_35;
93  if (tmpvar_33.x) {
94    tmpvar_35 = tmpvar_34.x;
95  } else {
96    tmpvar_35 = 1.0;
97  };
59  mediump vec4 shadows_20;
60  highp vec4 shadowVals_21;
61  highp vec3 vec_22;
62  vec_22 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
63  highp vec4 packDist_23;
64  lowp vec4 tmpvar_24;
65  tmpvar_24 = textureCube (_ShadowMapTexture, vec_22);
66  packDist_23 = tmpvar_24;
67  shadowVals_21.x = dot (packDist_23, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
68  highp vec3 vec_25;
69  vec_25 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
70  highp vec4 packDist_26;
71  lowp vec4 tmpvar_27;
72  tmpvar_27 = textureCube (_ShadowMapTexture, vec_25);
73  packDist_26 = tmpvar_27;
74  shadowVals_21.y = dot (packDist_26, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
75  highp vec3 vec_28;
76  vec_28 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
77  highp vec4 packDist_29;
78  lowp vec4 tmpvar_30;
79  tmpvar_30 = textureCube (_ShadowMapTexture, vec_28);
80  packDist_29 = tmpvar_30;
81  shadowVals_21.z = dot (packDist_29, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
82  highp vec3 vec_31;
83  vec_31 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
84  highp vec4 packDist_32;
85  lowp vec4 tmpvar_33;
86  tmpvar_33 = textureCube (_ShadowMapTexture, vec_31);
87  packDist_32 = tmpvar_33;
88  shadowVals_21.w = dot (packDist_32, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
89  bvec4 tmpvar_34;
90  tmpvar_34 = lessThan (shadowVals_21, vec4(mydist_19));
91  highp vec4 tmpvar_35;
92  tmpvar_35 = _LightShadowData.xxxx;
9893  highp float tmpvar_36;
99  if (tmpvar_33.y) {
100    tmpvar_36 = tmpvar_34.y;
94  if (tmpvar_34.x) {
95    tmpvar_36 = tmpvar_35.x;
10196  } else {
10297    tmpvar_36 = 1.0;
10398  };
10499  highp float tmpvar_37;
105  if (tmpvar_33.z) {
106    tmpvar_37 = tmpvar_34.z;
100  if (tmpvar_34.y) {
101    tmpvar_37 = tmpvar_35.y;
107102  } else {
108103    tmpvar_37 = 1.0;
109104  };
110105  highp float tmpvar_38;
111  if (tmpvar_33.w) {
112    tmpvar_38 = tmpvar_34.w;
106  if (tmpvar_34.z) {
107    tmpvar_38 = tmpvar_35.z;
113108  } else {
114109    tmpvar_38 = 1.0;
115110  };
116  mediump vec4 tmpvar_39;
117  tmpvar_39.x = tmpvar_35;
118  tmpvar_39.y = tmpvar_36;
119  tmpvar_39.z = tmpvar_37;
120  tmpvar_39.w = tmpvar_38;
121  mediump float tmpvar_40;
122  tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25));
123  atten_4 = (atten_4 * tmpvar_40);
124  highp vec4 tmpvar_41;
125  tmpvar_41.w = 1.0;
126  tmpvar_41.xyz = wpos_7;
127  lowp vec4 tmpvar_42;
128  highp vec3 P_43;
129  P_43 = (_LightMatrix0 * tmpvar_41).xyz;
130  tmpvar_42 = textureCube (_LightTexture0, P_43);
131  atten_4 = (atten_4 * tmpvar_42.w);
132  highp vec3 tmpvar_44;
133  tmpvar_44 = normalize((lightDir_5 - normalize(
111  highp float tmpvar_39;
112  if (tmpvar_34.w) {
113    tmpvar_39 = tmpvar_35.w;
114  } else {
115    tmpvar_39 = 1.0;
116  };
117  highp vec4 tmpvar_40;
118  tmpvar_40.x = tmpvar_36;
119  tmpvar_40.y = tmpvar_37;
120  tmpvar_40.z = tmpvar_38;
121  tmpvar_40.w = tmpvar_39;
122  shadows_20 = tmpvar_40;
123  mediump float tmpvar_41;
124  tmpvar_41 = dot (shadows_20, vec4(0.25, 0.25, 0.25, 0.25));
125  atten_4 = (atten_4 * tmpvar_41);
126  highp vec4 tmpvar_42;
127  tmpvar_42.w = 1.0;
128  tmpvar_42.xyz = wpos_7;
129  lowp vec4 tmpvar_43;
130  highp vec3 P_44;
131  P_44 = (_LightMatrix0 * tmpvar_42).xyz;
132  tmpvar_43 = textureCube (_LightTexture0, P_44);
133  atten_4 = (atten_4 * tmpvar_43.w);
134  highp vec3 tmpvar_45;
135  tmpvar_45 = normalize((lightDir_5 - normalize(
134136    (wpos_7 - _WorldSpaceCameraPos)
135137  )));
136  h_3 = tmpvar_44;
137  mediump float tmpvar_45;
138  tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
139  spec_2 = tmpvar_45;
138  h_3 = tmpvar_45;
139  mediump float tmpvar_46;
140  tmpvar_46 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
141  spec_2 = tmpvar_46;
140142  spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
141143  res_1.xyz = (_LightColor.xyz * (max (0.0,
142144    dot (lightDir_5, normal_9)
143145  ) * atten_4));
144  mediump vec3 c_46;
145  c_46 = _LightColor.xyz;
146  res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071)));
147  highp float tmpvar_47;
148  tmpvar_47 = clamp ((1.0 - (
146  mediump vec3 c_47;
147  c_47 = _LightColor.xyz;
148  res_1.w = (spec_2 * dot (c_47, vec3(0.22, 0.707, 0.071)));
149  highp float tmpvar_48;
150  tmpvar_48 = clamp ((1.0 - (
149151    (tmpvar_15.z * unity_LightmapFade.z)
150152   + unity_LightmapFade.w)), 0.0, 1.0);
151  res_1 = (res_1 * tmpvar_47);
153  res_1 = (res_1 * tmpvar_48);
152154  gl_FragData[0] = exp2(-(res_1));
153155}
154156
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt
r245570r245571
5858  highp float mydist_19;
5959  mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w);
6060  mydist_19 = (mydist_19 * 0.97);
61  highp vec4 shadowVals_20;
62  highp vec3 vec_21;
63  vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
64  highp vec4 packDist_22;
65  lowp vec4 tmpvar_23;
66  tmpvar_23 = texture (_ShadowMapTexture, vec_21);
67  packDist_22 = tmpvar_23;
68  shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
69  highp vec3 vec_24;
70  vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
71  highp vec4 packDist_25;
72  lowp vec4 tmpvar_26;
73  tmpvar_26 = texture (_ShadowMapTexture, vec_24);
74  packDist_25 = tmpvar_26;
75  shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
76  highp vec3 vec_27;
77  vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
78  highp vec4 packDist_28;
79  lowp vec4 tmpvar_29;
80  tmpvar_29 = texture (_ShadowMapTexture, vec_27);
81  packDist_28 = tmpvar_29;
82  shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
83  highp vec3 vec_30;
84  vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
85  highp vec4 packDist_31;
86  lowp vec4 tmpvar_32;
87  tmpvar_32 = texture (_ShadowMapTexture, vec_30);
88  packDist_31 = tmpvar_32;
89  shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
90  bvec4 tmpvar_33;
91  tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19));
92  highp vec4 tmpvar_34;
93  tmpvar_34 = _LightShadowData.xxxx;
94  highp float tmpvar_35;
95  if (tmpvar_33.x) {
96    tmpvar_35 = tmpvar_34.x;
97  } else {
98    tmpvar_35 = 1.0;
99  };
61  mediump vec4 shadows_20;
62  highp vec4 shadowVals_21;
63  highp vec3 vec_22;
64  vec_22 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
65  highp vec4 packDist_23;
66  lowp vec4 tmpvar_24;
67  tmpvar_24 = texture (_ShadowMapTexture, vec_22);
68  packDist_23 = tmpvar_24;
69  shadowVals_21.x = dot (packDist_23, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
70  highp vec3 vec_25;
71  vec_25 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
72  highp vec4 packDist_26;
73  lowp vec4 tmpvar_27;
74  tmpvar_27 = texture (_ShadowMapTexture, vec_25);
75  packDist_26 = tmpvar_27;
76  shadowVals_21.y = dot (packDist_26, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
77  highp vec3 vec_28;
78  vec_28 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
79  highp vec4 packDist_29;
80  lowp vec4 tmpvar_30;
81  tmpvar_30 = texture (_ShadowMapTexture, vec_28);
82  packDist_29 = tmpvar_30;
83  shadowVals_21.z = dot (packDist_29, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
84  highp vec3 vec_31;
85  vec_31 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
86  highp vec4 packDist_32;
87  lowp vec4 tmpvar_33;
88  tmpvar_33 = texture (_ShadowMapTexture, vec_31);
89  packDist_32 = tmpvar_33;
90  shadowVals_21.w = dot (packDist_32, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
91  bvec4 tmpvar_34;
92  tmpvar_34 = lessThan (shadowVals_21, vec4(mydist_19));
93  highp vec4 tmpvar_35;
94  tmpvar_35 = _LightShadowData.xxxx;
10095  highp float tmpvar_36;
101  if (tmpvar_33.y) {
102    tmpvar_36 = tmpvar_34.y;
96  if (tmpvar_34.x) {
97    tmpvar_36 = tmpvar_35.x;
10398  } else {
10499    tmpvar_36 = 1.0;
105100  };
106101  highp float tmpvar_37;
107  if (tmpvar_33.z) {
108    tmpvar_37 = tmpvar_34.z;
102  if (tmpvar_34.y) {
103    tmpvar_37 = tmpvar_35.y;
109104  } else {
110105    tmpvar_37 = 1.0;
111106  };
112107  highp float tmpvar_38;
113  if (tmpvar_33.w) {
114    tmpvar_38 = tmpvar_34.w;
108  if (tmpvar_34.z) {
109    tmpvar_38 = tmpvar_35.z;
115110  } else {
116111    tmpvar_38 = 1.0;
117112  };
118  mediump vec4 tmpvar_39;
119  tmpvar_39.x = tmpvar_35;
120  tmpvar_39.y = tmpvar_36;
121  tmpvar_39.z = tmpvar_37;
122  tmpvar_39.w = tmpvar_38;
123  mediump float tmpvar_40;
124  tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25));
125  atten_4 = (atten_4 * tmpvar_40);
126  highp vec4 tmpvar_41;
127  tmpvar_41.w = 1.0;
128  tmpvar_41.xyz = wpos_7;
129  lowp vec4 tmpvar_42;
130  highp vec3 P_43;
131  P_43 = (_LightMatrix0 * tmpvar_41).xyz;
132  tmpvar_42 = texture (_LightTexture0, P_43);
133  atten_4 = (atten_4 * tmpvar_42.w);
134  highp vec3 tmpvar_44;
135  tmpvar_44 = normalize((lightDir_5 - normalize(
113  highp float tmpvar_39;
114  if (tmpvar_34.w) {
115    tmpvar_39 = tmpvar_35.w;
116  } else {
117    tmpvar_39 = 1.0;
118  };
119  highp vec4 tmpvar_40;
120  tmpvar_40.x = tmpvar_36;
121  tmpvar_40.y = tmpvar_37;
122  tmpvar_40.z = tmpvar_38;
123  tmpvar_40.w = tmpvar_39;
124  shadows_20 = tmpvar_40;
125  mediump float tmpvar_41;
126  tmpvar_41 = dot (shadows_20, vec4(0.25, 0.25, 0.25, 0.25));
127  atten_4 = (atten_4 * tmpvar_41);
128  highp vec4 tmpvar_42;
129  tmpvar_42.w = 1.0;
130  tmpvar_42.xyz = wpos_7;
131  lowp vec4 tmpvar_43;
132  highp vec3 P_44;
133  P_44 = (_LightMatrix0 * tmpvar_42).xyz;
134  tmpvar_43 = texture (_LightTexture0, P_44);
135  atten_4 = (atten_4 * tmpvar_43.w);
136  highp vec3 tmpvar_45;
137  tmpvar_45 = normalize((lightDir_5 - normalize(
136138    (wpos_7 - _WorldSpaceCameraPos)
137139  )));
138  h_3 = tmpvar_44;
139  mediump float tmpvar_45;
140  tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
141  spec_2 = tmpvar_45;
140  h_3 = tmpvar_45;
141  mediump float tmpvar_46;
142  tmpvar_46 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
143  spec_2 = tmpvar_46;
142144  spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
143145  res_1.xyz = (_LightColor.xyz * (max (0.0,
144146    dot (lightDir_5, normal_9)
145147  ) * atten_4));
146  mediump vec3 c_46;
147  c_46 = _LightColor.xyz;
148  res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071)));
149  highp float tmpvar_47;
150  tmpvar_47 = clamp ((1.0 - (
148  mediump vec3 c_47;
149  c_47 = _LightColor.xyz;
150  res_1.w = (spec_2 * dot (c_47, vec3(0.22, 0.707, 0.071)));
151  highp float tmpvar_48;
152  tmpvar_48 = clamp ((1.0 - (
151153    (tmpvar_15.z * unity_LightmapFade.z)
152154   + unity_LightmapFade.w)), 0.0, 1.0);
153  res_1 = (res_1 * tmpvar_47);
155  res_1 = (res_1 * tmpvar_48);
154156  _fragData = exp2(-(res_1));
155157}
156158
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt
r245570r245571
6666  float mydist_19;
6767  mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _mtl_u._LightPositionRange.w);
6868  mydist_19 = (mydist_19 * 0.97);
69  float4 shadowVals_20;
70  float3 vec_21;
71  vec_21 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125));
72  float4 packDist_22;
73  half4 tmpvar_23;
74  tmpvar_23 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_21));
75  packDist_22 = float4(tmpvar_23);
76  shadowVals_20.x = dot (packDist_22, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
77  float3 vec_24;
78  vec_24 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125));
79  float4 packDist_25;
80  half4 tmpvar_26;
81  tmpvar_26 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_24));
82  packDist_25 = float4(tmpvar_26);
83  shadowVals_20.y = dot (packDist_25, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
84  float3 vec_27;
85  vec_27 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125));
86  float4 packDist_28;
87  half4 tmpvar_29;
88  tmpvar_29 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_27));
89  packDist_28 = float4(tmpvar_29);
90  shadowVals_20.z = dot (packDist_28, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
91  float3 vec_30;
92  vec_30 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125));
93  float4 packDist_31;
94  half4 tmpvar_32;
95  tmpvar_32 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_30));
96  packDist_31 = float4(tmpvar_32);
97  shadowVals_20.w = dot (packDist_31, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
98  bool4 tmpvar_33;
99  tmpvar_33 = bool4((shadowVals_20 < float4(mydist_19)));
100  float4 tmpvar_34;
101  tmpvar_34 = _mtl_u._LightShadowData.xxxx;
102  float tmpvar_35;
103  if (tmpvar_33.x) {
104    tmpvar_35 = tmpvar_34.x;
105  } else {
106    tmpvar_35 = 1.0;
107  };
69  half4 shadows_20;
70  float4 shadowVals_21;
71  float3 vec_22;
72  vec_22 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125));
73  float4 packDist_23;
74  half4 tmpvar_24;
75  tmpvar_24 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_22));
76  packDist_23 = float4(tmpvar_24);
77  shadowVals_21.x = dot (packDist_23, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
78  float3 vec_25;
79  vec_25 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125));
80  float4 packDist_26;
81  half4 tmpvar_27;
82  tmpvar_27 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_25));
83  packDist_26 = float4(tmpvar_27);
84  shadowVals_21.y = dot (packDist_26, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
85  float3 vec_28;
86  vec_28 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125));
87  float4 packDist_29;
88  half4 tmpvar_30;
89  tmpvar_30 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_28));
90  packDist_29 = float4(tmpvar_30);
91  shadowVals_21.z = dot (packDist_29, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
92  float3 vec_31;
93  vec_31 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125));
94  float4 packDist_32;
95  half4 tmpvar_33;
96  tmpvar_33 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_31));
97  packDist_32 = float4(tmpvar_33);
98  shadowVals_21.w = dot (packDist_32, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
99  bool4 tmpvar_34;
100  tmpvar_34 = bool4((shadowVals_21 < float4(mydist_19)));
101  float4 tmpvar_35;
102  tmpvar_35 = _mtl_u._LightShadowData.xxxx;
108103  float tmpvar_36;
109  if (tmpvar_33.y) {
110    tmpvar_36 = tmpvar_34.y;
104  if (tmpvar_34.x) {
105    tmpvar_36 = tmpvar_35.x;
111106  } else {
112107    tmpvar_36 = 1.0;
113108  };
114109  float tmpvar_37;
115  if (tmpvar_33.z) {
116    tmpvar_37 = tmpvar_34.z;
110  if (tmpvar_34.y) {
111    tmpvar_37 = tmpvar_35.y;
117112  } else {
118113    tmpvar_37 = 1.0;
119114  };
120115  float tmpvar_38;
121  if (tmpvar_33.w) {
122    tmpvar_38 = tmpvar_34.w;
116  if (tmpvar_34.z) {
117    tmpvar_38 = tmpvar_35.z;
123118  } else {
124119    tmpvar_38 = 1.0;
125120  };
126  half4 tmpvar_39;
127  tmpvar_39.x = half(tmpvar_35);
128  tmpvar_39.y = half(tmpvar_36);
129  tmpvar_39.z = half(tmpvar_37);
130  tmpvar_39.w = half(tmpvar_38);
131  half tmpvar_40;
132  tmpvar_40 = dot (tmpvar_39, (half4)float4(0.25, 0.25, 0.25, 0.25));
133  atten_4 = (atten_4 * (float)tmpvar_40);
134  float4 tmpvar_41;
135  tmpvar_41.w = 1.0;
136  tmpvar_41.xyz = wpos_7;
137  half4 tmpvar_42;
138  float3 P_43;
139  P_43 = (_mtl_u._LightMatrix0 * tmpvar_41).xyz;
140  tmpvar_42 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_43));
141  atten_4 = (atten_4 * (float)tmpvar_42.w);
142  float3 tmpvar_44;
143  tmpvar_44 = normalize(((float3)lightDir_5 - normalize(
121  float tmpvar_39;
122  if (tmpvar_34.w) {
123    tmpvar_39 = tmpvar_35.w;
124  } else {
125    tmpvar_39 = 1.0;
126  };
127  float4 tmpvar_40;
128  tmpvar_40.x = tmpvar_36;
129  tmpvar_40.y = tmpvar_37;
130  tmpvar_40.z = tmpvar_38;
131  tmpvar_40.w = tmpvar_39;
132  shadows_20 = half4(tmpvar_40);
133  half tmpvar_41;
134  tmpvar_41 = dot (shadows_20, (half4)float4(0.25, 0.25, 0.25, 0.25));
135  atten_4 = (atten_4 * (float)tmpvar_41);
136  float4 tmpvar_42;
137  tmpvar_42.w = 1.0;
138  tmpvar_42.xyz = wpos_7;
139  half4 tmpvar_43;
140  float3 P_44;
141  P_44 = (_mtl_u._LightMatrix0 * tmpvar_42).xyz;
142  tmpvar_43 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_44));
143  atten_4 = (atten_4 * (float)tmpvar_43.w);
144  float3 tmpvar_45;
145  tmpvar_45 = normalize(((float3)lightDir_5 - normalize(
144146    (wpos_7 - _mtl_u._WorldSpaceCameraPos)
145147  )));
146  h_3 = half3(tmpvar_44);
147  half tmpvar_45;
148  tmpvar_45 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)128.0));
149  spec_2 = float(tmpvar_45);
148  h_3 = half3(tmpvar_45);
149  half tmpvar_46;
150  tmpvar_46 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)128.0));
151  spec_2 = float(tmpvar_46);
150152  spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
151153  res_1.xyz = half3((_mtl_u._LightColor.xyz * ((float)max ((half)0.0,
152154    dot (lightDir_5, normal_9)
153155  ) * atten_4)));
154  half3 c_46;
155  c_46 = half3(_mtl_u._LightColor.xyz);
156  res_1.w = half((spec_2 * (float)dot (c_46, (half3)float3(0.22, 0.707, 0.071))));
157  float tmpvar_47;
158  tmpvar_47 = clamp ((1.0 - (
156  half3 c_47;
157  c_47 = half3(_mtl_u._LightColor.xyz);
158  res_1.w = half((spec_2 * (float)dot (c_47, (half3)float3(0.22, 0.707, 0.071))));
159  float tmpvar_48;
160  tmpvar_48 = clamp ((1.0 - (
159161    (tmpvar_15.z * _mtl_u.unity_LightmapFade.z)
160162   + _mtl_u.unity_LightmapFade.w)), 0.0, 1.0);
161  res_1 = ((half4)((float4)res_1 * tmpvar_47));
163  res_1 = ((half4)((float4)res_1 * tmpvar_48));
162164  _mtl_o._fragData = exp2(-(res_1));
163165  return _mtl_o;
164166}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt
r245570r245571
3535    mediump float nh;
3636    mediump float spec;
3737    lowp vec4 c;
38    col = texture( _MainTex, i.uv);
38    col = texture2D( _MainTex, i.uv);
3939    xll_clip((col.w - _Cutoff));
4040    #line 35
4141    albedo = (col.xyz * i.color);
42    specular = (texture( _BumpSpecMap, i.uv).x * 128.000);
42    specular = (texture2D( _BumpSpecMap, i.uv).x * 128.000);
4343    #line 39
44    trngls = texture( _TranslucencyMap, i.uv);
44    trngls = texture2D( _TranslucencyMap, i.uv);
4545    gloss = trngls.w;
4646    light = (vec3( UNITY_LIGHTMODEL_AMBIENT) * albedo);
4747    #line 44
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt
r245570r245571
8585uniform sampler2D _SelfIllum;
8686
8787vec3 Albedo( in vec4 texcoords ) {
88    vec3 albedo = (_Color.xyz * texture( _MainTex, texcoords.xy).xyz);
89    albedo *= (2.0 * texture( _DetailAlbedoMap, texcoords.zw).xyz);
88    vec3 albedo = (_Color.xyz * texture2D( _MainTex, texcoords.xy).xyz);
89    albedo *= (2.0 * texture2D( _DetailAlbedoMap, texcoords.zw).xyz);
9090    return albedo;
9191}
9292float Alpha( in vec2 uv ) {
93    return (texture( _AlphaMap, uv).w * _Color.w);
93    return (texture2D( _AlphaMap, uv).w * _Color.w);
9494}
9595float BlinnPhongTerm( in float roughness, in float NdotH ) {
9696    float m = (pow( roughness, 4.0) + 1e-05);
r245570r245571
177177    return fromRGBM( envTexel);
178178}
179179float Occlusion( in vec2 uv ) {
180    return texture( _Occlusion, uv).x;
180    return texture2D( _Occlusion, uv).x;
181181}
182182vec4 SpecularGloss( in vec2 uv ) {
183    vec4 specGloss = texture( _SpecGlossMap, uv);
183    vec4 specGloss = texture2D( _SpecGlossMap, uv);
184184    return vec4( specGloss.xyz, specGloss.w);
185185}
186186vec3 BlendNormals( in vec3 n1, in vec3 n2 ) {
r245570r245571
194194    return normal;
195195}
196196vec3 TangentNormal( in vec4 texcoords ) {
197    vec3 normalTangent = UnpackScaleNormal( texture( _BumpMap, texcoords.xy), _BumpScale);
198    vec3 detailNormalTangent = UnpackScaleNormal( texture( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale);
197    vec3 normalTangent = UnpackScaleNormal( texture2D( _BumpMap, texcoords.xy), _BumpScale);
198    vec3 detailNormalTangent = UnpackScaleNormal( texture2D( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale);
199199    normalTangent = BlendNormals( normalTangent, detailNormalTangent);
200200    return normalTangent;
201201}
r245570r245571
204204    return xll_transpose_mf3x3(mat3( tangent, binormal, normal));
205205}
206206float unitySampleShadow( in vec4 shadowCoord ) {
207    float shadow = textureProj( _ShadowMapTexture, shadowCoord).x;
207    float shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x;
208208    return shadow;
209209}
210210vec4 frag( in VertexOutput i ) {
r245570r245571
224224    vec3 lightDir = _WorldSpaceLightPos0.xyz;
225225    float subsurface = 1.0;
226226    vec3 ambient = vec3( 0.0);
227    vec4 lmtex = texture( unity_Lightmap, i.extra.xy);
228    vec4 lmIndTex = texture( unity_LightmapInd, i.extra.xy);
227    vec4 lmtex = texture2D( unity_Lightmap, i.extra.xy);
228    vec4 lmIndTex = texture2D( unity_LightmapInd, i.extra.xy);
229229    vec3 lightDirTangent;
230230    DecodeDirLightmap( normalTangent, lmtex, lmIndTex, lightColor, lightDirTangent);
231231    lightDir = (lightDirTangent * tanToWorld);
232232    lightDir = normalize(lightDir);
233233    vec3 baseColor = EnergyCalculator( specColor, specular, Albedo( i.tex));
234234    vec3 color = BRDF_Disney_PBS( baseColor, (atten * lightColor), specColor, specular, roughness, normalWorld, lightDir, (-eyeVec), ambient, env);
235    color += (texture( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale);
235    color += (texture2D( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale);
236236    float alpha = Alpha( i.tex.xy);
237237    return vec4( color, alpha);
238238}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt
r245570r245571
3333  tmpvar_3 = xlv_TEXCOORD3.xyz;
3434  tmpvar_4 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www);
3535  highp mat3 tmpvar_5;
36  tmpvar_5[uint(0)].x = tmpvar_3.x;
37  tmpvar_5[uint(0)].y = tmpvar_4.x;
38  tmpvar_5[uint(0)].z = xlv_TEXCOORD2.x;
36  tmpvar_5[0u].x = tmpvar_3.x;
37  tmpvar_5[0u].y = tmpvar_4.x;
38  tmpvar_5[0u].z = xlv_TEXCOORD2.x;
3939  tmpvar_5[1u].x = tmpvar_3.y;
4040  tmpvar_5[1u].y = tmpvar_4.y;
4141  tmpvar_5[1u].z = xlv_TEXCOORD2.y;
r245570r245571
8989  lowp vec4 tmpvar_20;
9090  tmpvar_20 = texture (unity_LightmapInd, xlv_TEXCOORD4.xy);
9191  highp mat3 tmpvar_21;
92  tmpvar_21[uint(0)].x = 0.816497;
93  tmpvar_21[uint(0)].y = -0.408248;
94  tmpvar_21[uint(0)].z = -0.408248;
92  tmpvar_21[0u].x = 0.816497;
93  tmpvar_21[0u].y = -0.408248;
94  tmpvar_21[0u].z = -0.408248;
9595  tmpvar_21[1u].x = 0.0;
9696  tmpvar_21[1u].y = 0.707107;
9797  tmpvar_21[1u].z = -0.707107;
r245570r245571
171171    (((1.0 - dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_14)) * pow (abs((1.0 - tmpvar_32)), 5.0))
172172   * env_2)) + (texture (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale));
173173  tmpvar_38.w = (texture (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w);
174  mediump vec4 tmpvar_39;
175  tmpvar_39 = tmpvar_38;
176  _fragData = tmpvar_39;
174  _fragData = tmpvar_38;
177175}
178176
179177
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt
r245570r245571
149149  half VdotH_34;
150150  VdotH_34 = (tmpvar_33 + (half)1e-05);
151151  half tmpvar_35;
152  tmpvar_35 = (((half)1.0/((
152  tmpvar_35 = ((1.0/((
153153    pow (tmpvar_14, (half)4.0)
154154   + (half)1e-05))) - (half)2.0);
155155  half tmpvar_36;
r245570r245571
179179    ((((half)1.0 - dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114))) * ((half)1.0 - tmpvar_14)) * pow (abs(((half)1.0 - tmpvar_32)), (half)5.0))
180180   * env_2)) + ((half3)((float3)_SelfIllum.sample(_mtlsmp__SelfIllum, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * _mtl_u._SelfIllumScale)));
181181  tmpvar_38.w = ((half)((float)_AlphaMap.sample(_mtlsmp__AlphaMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).w * _mtl_u._Color.w));
182  half4 tmpvar_39;
183  tmpvar_39 = tmpvar_38;
184  _mtl_o._fragData = tmpvar_39;
182  _mtl_o._fragData = tmpvar_38;
185183  return _mtl_o;
186184}
187185
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt
r245570r245571
3232}
3333void surf( in Input IN, inout SurfaceOutput o ) {
3434    lowp vec4 tex;
35    tex = texture( _MainTex, IN.uv_MainTex);
35    tex = texture2D( _MainTex, IN.uv_MainTex);
3636    o.Albedo = tex.xyz ;
3737    o.Gloss = tex.w ;
3838    o.Alpha = tex.w ;
3939    o.Specular = _Shininess;
40    o.Normal = UnpackNormal( texture( _BumpMap, IN.uv_MainTex));
40    o.Normal = UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex));
4141}
4242lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ) {
4343    lowp float diff;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
r245570r245571
3232  depth_6 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z);
3333  scale_5 = (_Params.x / depth_6);
3434  occ_4 = 0.0;
35  for (highp int s_3 = 0; s_3 < 8; s_3++) {
35  for (int s_3 = 0; s_3 < 8; s_3++) {
3636    mediump vec3 randomDir_14;
3737    highp vec3 tmpvar_15;
3838    highp vec3 I_16;
r245570r245571
4343    randomDir_14 = tmpvar_15;
4444    highp float tmpvar_17;
4545    tmpvar_17 = dot (viewNorm_7, randomDir_14);
46    mediump float tmpvar_18;
46    highp float tmpvar_18;
4747    if ((tmpvar_17 < 0.0)) {
4848      tmpvar_18 = 1.0;
4949    } else {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
r245570r245571
5252    randomDir_14 = half3(tmpvar_15);
5353    float tmpvar_17;
5454    tmpvar_17 = dot (viewNorm_7, (float3)randomDir_14);
55    half tmpvar_18;
55    float tmpvar_18;
5656    if ((tmpvar_17 < 0.0)) {
57      tmpvar_18 = half(1.0);
57      tmpvar_18 = 1.0;
5858    } else {
59      tmpvar_18 = half(-1.0);
59      tmpvar_18 = -1.0;
6060    };
61    randomDir_14 = (randomDir_14 * -(tmpvar_18));
61    randomDir_14 = (randomDir_14 * ((half)-(tmpvar_18)));
6262    randomDir_14 = half3(((float3)randomDir_14 + (viewNorm_7 * 0.3)));
6363    float4 tmpvar_19;
6464    tmpvar_19 = float4(_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)randomDir_14.xy * scale_5)))));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt
r245570r245571
4343  depth_8 = (dot (depthnormal_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z);
4444  scale_7 = (_Params.x / depth_8);
4545  occ_6 = 0.0;
46  for (highp int s_5 = 0; s_5 < 8; s_5++) {
46  for (int s_5 = 0; s_5 < 8; s_5++) {
4747    highp vec4 sampleND_17;
4848    mediump vec3 randomDir_18;
4949    highp vec3 tmpvar_19;
r245570r245571
5555    randomDir_18 = tmpvar_19;
5656    highp float tmpvar_21;
5757    tmpvar_21 = dot (viewNorm_9, randomDir_18);
58    mediump float tmpvar_22;
58    highp float tmpvar_22;
5959    if ((tmpvar_21 < 0.0)) {
6060      tmpvar_22 = 1.0;
6161    } else {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt
r245570r245571
1uniform highp float uni1;
2uniform mediump vec4 uni4;
3uniform sampler2D tex1;
4
5// global variables that aren't uniforms
6highp float mut_uni1;
7mediump vec4 mut_uni4;
8
9highp vec3 SampleDiffuse(in highp vec2 uv)
10{
11    mut_uni4.xy = uv;
12    return vec3(texture2D(tex1,mut_uni4.xy));
13}
14lowp vec4 xlat_main(in highp vec4 uv)
15{
16    lowp vec4 c = vec4(0.0);
17    c.x += mut_uni4.x;
18    c.xyz += SampleDiffuse(uv.xy);
19    c.z += mut_uni1;
20    mut_uni1 += 2.0;
21    c.w += mut_uni1;
22    return c;
23}
24varying highp vec4 var_uv;
25void main()
26{
27    mut_uni1 = uni1;
28    mut_uni4 = uni4;
29    lowp vec4 r = xlat_main(var_uv);
30    gl_FragData[0] = r;
31}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt
r245570r245571
1#version 300 es
2
3uniform highp float uni1;
4uniform mediump vec4 uni4;
5uniform sampler2D tex1;
6uniform lowp vec4 unity_ColorSpaceDouble;
7uniform mediump vec3 _SkyTint;
8uniform mediump float _AtmosphereThickness;
9
10
11// global variables that aren't uniforms
12highp float mut_uni1;
13mediump vec4 mut_uni4;
14// global variables that are modified in complex chains of assignments/branches
15highp vec3 kSkyTintInGammaSpace;
16highp float kKrESun;
17highp float kKr4PI;
18
19
20highp vec3 SampleDiffuse(in highp vec2 uv)
21{
22    mut_uni4.xy = uv;
23    return vec3(texture(tex1, mut_uni4.xy));
24}
25lowp vec4 xlat_main(in highp vec4 uv)
26{
27    lowp vec4 c = vec4(0.0);
28    c.x += mut_uni4.x;
29    c.xyz += SampleDiffuse(uv.xy);
30    c.z += mut_uni1;
31    mut_uni1 += 2.0;
32    c.w += mut_uni1;
33
34    mediump vec3 tmpvar_1;
35    if ((unity_ColorSpaceDouble.x > 2.0)) {
36        tmpvar_1 = pow (_SkyTint, vec3(0.454545, 0.454545, 0.454545));
37    } else {
38        tmpvar_1 = _SkyTint;
39    };
40    kSkyTintInGammaSpace = tmpvar_1;
41    highp vec3 tmpvar_2;
42    tmpvar_2 = (1.0/(pow (mix (vec3(0.5, 0.42, 0.325), vec3(0.8, 0.72, 0.625),
43        (vec3(1.0, 1.0, 1.0) - kSkyTintInGammaSpace)
44        ), vec3(4.0, 4.0, 4.0))));
45    mediump float tmpvar_3;
46    mediump float cse_4;
47    cse_4 = pow (_AtmosphereThickness, 2.5);
48    tmpvar_3 = (mix (0.0, 0.0025, cse_4) * 20.0);
49    kKrESun = tmpvar_3;
50    mediump float tmpvar_5;
51    tmpvar_5 = (12.5664 * mix (0.0, 0.0025, cse_4));
52    kKr4PI = tmpvar_5;
53
54    if (uv.x > 0.5)
55    {
56        c.x += pow(kKrESun, kKr4PI);
57    }
58    return c;
59}
60in highp vec4 var_uv;
61out mediump vec4 out_data;
62void main()
63{
64    mut_uni1 = uni1;
65    mut_uni4 = uni4;
66    lowp vec4 r = xlat_main(var_uv);
67    out_data = r;
68}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt
r245570r245571
1uniform highp float uni1;
2uniform mediump vec4 uni4;
3uniform sampler2D tex1;
4highp float mut_uni1;
5mediump vec4 mut_uni4;
6varying highp vec4 var_uv;
7void main ()
8{
9  mut_uni4.zw = uni4.zw;
10  lowp vec4 c_1;
11  c_1.yzw = vec3(0.0, 0.0, 0.0);
12  c_1.x = uni4.x;
13  highp vec3 tmpvar_2;
14  highp vec2 uv_3;
15  uv_3 = var_uv.xy;
16  mut_uni4.xy = uv_3;
17  lowp vec3 tmpvar_4;
18  tmpvar_4 = texture2D (tex1, mut_uni4.xy).xyz;
19  tmpvar_2 = tmpvar_4;
20  c_1.xyz = (c_1.xyz + tmpvar_2);
21  c_1.z = (c_1.z + uni1);
22  mut_uni1 = (uni1 + 2.0);
23  c_1.w = mut_uni1;
24  gl_FragData[0] = c_1;
25}
26
27
28// stats: 4 alu 1 tex 0 flow
29// inputs: 1
30//  #0: var_uv (high float) 4x1 [-1]
31// uniforms: 2 (total size: 0)
32//  #0: uni1 (high float) 1x1 [-1]
33//  #1: uni4 (medium float) 4x1 [-1]
34// textures: 1
35//  #0: tex1 (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt
r245570r245571
1#version 300 es
2uniform highp float uni1;
3uniform mediump vec4 uni4;
4uniform sampler2D tex1;
5uniform mediump float _AtmosphereThickness;
6highp float mut_uni1;
7mediump vec4 mut_uni4;
8highp float kKrESun;
9highp float kKr4PI;
10in highp vec4 var_uv;
11out mediump vec4 out_data;
12void main ()
13{
14  mut_uni4.zw = uni4.zw;
15  mediump float tmpvar_5_1;
16  mediump float tmpvar_3_2;
17  lowp vec4 c_3;
18  c_3.yzw = vec3(0.0, 0.0, 0.0);
19  c_3.x = uni4.x;
20  highp vec3 tmpvar_4;
21  highp vec2 uv_5;
22  uv_5 = var_uv.xy;
23  mut_uni4.xy = uv_5;
24  lowp vec3 tmpvar_6;
25  tmpvar_6 = texture (tex1, mut_uni4.xy).xyz;
26  tmpvar_4 = tmpvar_6;
27  c_3.xyz = (c_3.xyz + tmpvar_4);
28  c_3.z = (c_3.z + uni1);
29  mut_uni1 = (uni1 + 2.0);
30  c_3.w = mut_uni1;
31  mediump float tmpvar_7;
32  tmpvar_7 = pow (_AtmosphereThickness, 2.5);
33  tmpvar_3_2 = (0.05 * tmpvar_7);
34  kKrESun = tmpvar_3_2;
35  tmpvar_5_1 = (tmpvar_7 * 0.031416);
36  kKr4PI = tmpvar_5_1;
37  if ((var_uv.x > 0.5)) {
38    highp float tmpvar_8;
39    tmpvar_8 = pow (kKrESun, kKr4PI);
40    c_3.x = (c_3.x + tmpvar_8);
41  };
42  out_data = c_3;
43}
44
45
46// stats: 10 alu 1 tex 1 flow
47// inputs: 1
48//  #0: var_uv (high float) 4x1 [-1]
49// uniforms: 3 (total size: 0)
50//  #0: uni1 (high float) 1x1 [-1]
51//  #1: uni4 (medium float) 4x1 [-1]
52//  #2: _AtmosphereThickness (medium float) 1x1 [-1]
53// textures: 1
54//  #0: tex1 (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  float4 var_uv;
5};
6struct xlatMtlShaderOutput {
7  half4 out_data [[color(0)]];
8};
9struct xlatMtlShaderUniform {
10  float uni1;
11  half4 uni4;
12  half _AtmosphereThickness;
13};
14fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
15  ,   texture2d<half> tex1 [[texture(0)]], sampler _mtlsmp_tex1 [[sampler(0)]])
16{
17  xlatMtlShaderOutput _mtl_o;
18float mut_uni1_1;
19half4 mut_uni4_2;
20float kKrESun_3;
21float kKr4PI_4;
22  mut_uni4_2.zw = _mtl_u.uni4.zw;
23  half tmpvar_5_5;
24  half tmpvar_3_6;
25  half4 c_7;
26  c_7.yzw = half3(float3(0.0, 0.0, 0.0));
27  c_7.x = _mtl_u.uni4.x;
28  float3 tmpvar_8;
29  float2 uv_9;
30  uv_9 = _mtl_i.var_uv.xy;
31  mut_uni4_2.xy = half2(uv_9);
32  half3 tmpvar_10;
33  tmpvar_10 = tex1.sample(_mtlsmp_tex1, (float2)(mut_uni4_2.xy)).xyz;
34  tmpvar_8 = float3(tmpvar_10);
35  c_7.xyz = half3(((float3)c_7.xyz + tmpvar_8));
36  c_7.z = half(((float)c_7.z + _mtl_u.uni1));
37  mut_uni1_1 = (_mtl_u.uni1 + 2.0);
38  c_7.w = half(mut_uni1_1);
39  half tmpvar_11;
40  tmpvar_11 = pow (_mtl_u._AtmosphereThickness, (half)2.5);
41  tmpvar_3_6 = ((half)0.05 * tmpvar_11);
42  kKrESun_3 = float(tmpvar_3_6);
43  tmpvar_5_5 = (tmpvar_11 * (half)0.031416);
44  kKr4PI_4 = float(tmpvar_5_5);
45  if ((_mtl_i.var_uv.x > 0.5)) {
46    float tmpvar_12;
47    tmpvar_12 = pow (kKrESun_3, kKr4PI_4);
48    c_7.x = half(((float)c_7.x + tmpvar_12));
49  };
50  _mtl_o.out_data = c_7;
51  return _mtl_o;
52}
53
54
55// stats: 10 alu 1 tex 1 flow
56// inputs: 1
57//  #0: var_uv (high float) 4x1 [-1]
58// uniforms: 3 (total size: 18)
59//  #0: uni1 (high float) 1x1 [-1] loc 0
60//  #1: uni4 (medium float) 4x1 [-1] loc 8
61//  #2: _AtmosphereThickness (medium float) 1x1 [-1] loc 16
62// textures: 1
63//  #0: tex1 (low 2d) 0x0 [-1] loc 0
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
r245570r245571
256256         src += "#define gl_LastFragData _glesLastFragData\n";
257257         src += "varying lowp vec4 _glesLastFragData[4];\n";
258258      }
259      if (!need3)
260      {
261         src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n";
262         src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n";
263      }
259      src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n";
260      src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n";
264261   }
265262   src += source;
266263   if (gles)
r245570r245571
277274      replace_string (src, "precision ", "// precision ", 0);
278275      replace_string (src, "#version 300 es", "", 0);
279276   }
280   
281   // can't check FB fetch on PC
282   if (src.find("#extension GL_EXT_shader_framebuffer_fetch") != std::string::npos)
283      return true;
284
277   replace_string (src, "#extension GL_EXT_shader_framebuffer_fetch : require", "", 0);
278   replace_string (src, "#extension GL_EXT_shader_framebuffer_fetch : enable", "", 0);
285279   if (gles && need3)
286280   {
287281      src = "#version 330\n" + src;
r245570r245571
289283   const char* sourcePtr = src.c_str();
290284
291285   
292   GLuint shader = glCreateShader (vertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
293   glShaderSource (shader, 1, &sourcePtr, NULL);
294   glCompileShader (shader);
286   GLhandleARB shader = glCreateShaderObjectARB (vertex ? GL_VERTEX_SHADER_ARB : GL_FRAGMENT_SHADER_ARB);
287   glShaderSourceARB (shader, 1, &sourcePtr, NULL);
288   glCompileShaderARB (shader);
295289   GLint status;
296   
297   glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
298   
290   glGetObjectParameterivARB (shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);
299291   bool res = true;
300   if (status != GL_TRUE)
292   if (status == 0)
301293   {
302294      char log[20000];
303295      log[0] = 0;
304296      GLsizei logLength;
305      glGetShaderInfoLog (shader, sizeof(log), &logLength, log);
297      glGetInfoLogARB (shader, sizeof(log), &logLength, log);
306298      printf ("\n  %s: real glsl compiler error on %s:\n%s\n", testName.c_str(), prefix, log);
307299      res = false;
308300   }
309   glDeleteShader (shader);
301   glDeleteObjectARB (shader);
310302   return res;
311303}
312304
r245570r245571
320312   FILE* f = fopen ("metalTemp.metal", "wb");
321313   fwrite (source.c_str(), source.size(), 1, f);
322314   fclose (f);
323
324#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
315   
325316   int res = system("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal metalTemp.metal -o metalTemp.o -std=ios-metal1.0 -Wno-parentheses-equality");
326317   if (res != 0)
327318   {
328319      printf ("\n  %s: Metal compiler failed\n", testName.c_str());
329320      return false;
330321   }
331#endif //
332
333322   return true;
334323}
335324
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt
r245570r245571
5454  dir_15 = (localDir_9 / tmpvar_14);
5555  highp float tmpvar_16;
5656  tmpvar_16 = abs(dir_15.y);
57  highp vec3 tmpvar_17;
57  vec3 tmpvar_17;
5858  if ((tmpvar_16 > 0.999)) {
5959    tmpvar_17 = vec3(0.0, 0.0, 1.0);
6060  } else {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt
r245570r245571
5555  dir_15 = (localDir_9 / tmpvar_14);
5656  highp float tmpvar_16;
5757  tmpvar_16 = abs(dir_15.y);
58  highp vec3 tmpvar_17;
58  vec3 tmpvar_17;
5959  if ((tmpvar_16 > 0.999)) {
6060    tmpvar_17 = vec3(0.0, 0.0, 1.0);
6161  } else {
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt
r245570r245571
1313  tmpvar_3.w = 1.0;
1414  tmpvar_3.xyz = _WorldSpaceCameraPos;
1515  viewDir_1 = normalize(((_World2Object * tmpvar_3).xyz - _glesVertex.xyz));
16  mediump float tmpvar_4;
16  mediump float backContrib_4;
1717  highp float tmpvar_5;
1818  tmpvar_5 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[0])), 0.0, 1.0);
19  tmpvar_4 = tmpvar_5;
19  backContrib_4 = tmpvar_5;
2020  highp vec3 tmpvar_6;
2121  tmpvar_6.yz = tmpvar_2.yz;
22  tmpvar_6.x = (tmpvar_4 * 2.0);
23  mediump float tmpvar_7;
22  tmpvar_6.x = (backContrib_4 * 2.0);
23  mediump float backContrib_7;
2424  highp float tmpvar_8;
2525  tmpvar_8 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[1])), 0.0, 1.0);
26  tmpvar_7 = tmpvar_8;
26  backContrib_7 = tmpvar_8;
2727  highp vec3 tmpvar_9;
2828  tmpvar_9.xz = tmpvar_6.xz;
29  tmpvar_9.y = (tmpvar_7 * 2.0);
30  mediump float tmpvar_10;
29  tmpvar_9.y = (backContrib_7 * 2.0);
30  mediump float backContrib_10;
3131  highp float tmpvar_11;
3232  tmpvar_11 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[2])), 0.0, 1.0);
33  tmpvar_10 = tmpvar_11;
33  backContrib_10 = tmpvar_11;
3434  highp vec3 tmpvar_12;
3535  tmpvar_12.xy = tmpvar_9.xy;
36  tmpvar_12.z = (tmpvar_10 * 2.0);
36  tmpvar_12.z = (backContrib_10 * 2.0);
3737  tmpvar_2 = tmpvar_12;
3838  gl_Position = (glstate_matrix_mvp * _glesVertex);
3939  xlv_TEXCOORD2 = tmpvar_12;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt
r245570r245571
2222  tmpvar_3.w = 1.0;
2323  tmpvar_3.xyz = _mtl_u._WorldSpaceCameraPos;
2424  viewDir_1 = normalize(((_mtl_u._World2Object * tmpvar_3).xyz - _mtl_i._glesVertex.xyz));
25  half tmpvar_4;
25  half backContrib_4;
2626  float tmpvar_5;
2727  tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0);
28  tmpvar_4 = half(tmpvar_5);
28  backContrib_4 = half(tmpvar_5);
2929  float3 tmpvar_6;
3030  tmpvar_6.yz = tmpvar_2.yz;
31  tmpvar_6.x = float((tmpvar_4 * (half)2.0));
32  half tmpvar_7;
31  tmpvar_6.x = float((backContrib_4 * (half)2.0));
32  half backContrib_7;
3333  float tmpvar_8;
3434  tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0);
35  tmpvar_7 = half(tmpvar_8);
35  backContrib_7 = half(tmpvar_8);
3636  float3 tmpvar_9;
3737  tmpvar_9.xz = tmpvar_6.xz;
38  tmpvar_9.y = float((tmpvar_7 * (half)2.0));
39  half tmpvar_10;
38  tmpvar_9.y = float((backContrib_7 * (half)2.0));
39  half backContrib_10;
4040  float tmpvar_11;
4141  tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0);
42  tmpvar_10 = half(tmpvar_11);
42  backContrib_10 = half(tmpvar_11);
4343  float3 tmpvar_12;
4444  tmpvar_12.xy = tmpvar_9.xy;
45  tmpvar_12.z = float((tmpvar_10 * (half)2.0));
45  tmpvar_12.z = float((backContrib_10 * (half)2.0));
4646  tmpvar_2 = tmpvar_12;
4747  _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
4848  _mtl_o.xlv_TEXCOORD2 = tmpvar_12;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt
r245570r245571
77out lowp vec4 xlv_TEXCOORD1;
88void main ()
99{
10  highp vec4 tmpvar_1;
10  vec4 tmpvar_1;
1111  tmpvar_1.xyz = normalize(_glesTANGENT.xyz);
1212  tmpvar_1.w = _glesTANGENT.w;
1313  lowp vec4 tmpvar_2;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt
r245570r245571
1616vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
1717{
1818  xlatMtlShaderOutput _mtl_o;
19  half2 tmpvar_1;
20  tmpvar_1 = half2(_mtl_i._glesMultiTexCoord0.xy);
19  float2 tmpvar_1;
20  tmpvar_1 = _mtl_i._glesMultiTexCoord0.xy;
2121  float4 tmpvar_2;
2222  tmpvar_2.xyz = normalize(_mtl_i._glesTANGENT.xyz);
2323  tmpvar_2.w = _mtl_i._glesTANGENT.w;
24  half4 tmpvar_3;
25  tmpvar_3.xy = (tmpvar_1 * (half)0.3);
26  tmpvar_3.xyz = half3(((float3)tmpvar_3.xyz + ((tmpvar_2.xyz * 0.5) + 0.5)));
27  tmpvar_3.w = half(0.0);
24  half2 uv_3;
25  uv_3 = half2(tmpvar_1);
26  half4 tmpvar_4;
27  tmpvar_4.xy = ((half2)(_mtl_i._glesMultiTexCoord0.xy * 0.3));
28  tmpvar_4.xyz = half3(((float3)tmpvar_4.xyz + ((tmpvar_2.xyz * 0.5) + 0.5)));
29  tmpvar_4.w = half(0.0);
2830  _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
29  _mtl_o.xlv_TEXCOORD0 = tmpvar_1;
30  _mtl_o.xlv_TEXCOORD1 = tmpvar_3;
31  _mtl_o.xlv_TEXCOORD0 = uv_3;
32  _mtl_o.xlv_TEXCOORD1 = tmpvar_4;
3133  return _mtl_o;
3234}
3335
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
r245570r245571
4040vec4 Temp_1;
4141vec4 Temp_2;
4242vec4 Temp_3;
43highp int tmpvar_1;
43int tmpvar_1;
4444void main ()
4545{
4646  Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]);
4747  Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0);
4848  Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0);
49  highp vec4 tmpvar_2;
49  vec4 tmpvar_2;
5050  tmpvar_2 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
5151  VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy;
5252  Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt
r245570r245571
1#version 300 es
2
3// This was produced at one point from Unity's Reflect/VertexLit
4// shader's "Vertex Lit, emulated in shaders" pass by hlslcc.
5// Loop analysis was not detecting that Temp_int[0] is used as
6// both a loop induction variable (.w component) and for other uses
7// outside the loop.
8
9precision highp float;
10
11uniform     vec4 unity_LightColor[8];
12uniform     vec4 unity_LightPosition[8];
13uniform     vec4 unity_LightAtten[8];
14uniform     vec4 unity_SpotDirection[8];
15uniform     mat4 glstate_matrix_mvp;
16uniform     mat4 glstate_matrix_modelview0;
17uniform     mat4 glstate_matrix_invtrans_modelview0;
18uniform     mat4 _Object2World;
19uniform     mat4 _World2Object;
20uniform     vec4 glstate_lightmodel_ambient;
21uniform     vec4 _MainTex_ST;
22uniform     vec4 _Color;
23uniform     vec4 _ReflectColor;
24 in highp vec4 in_POSITION0;
25vec4 Input0;
26 in highp vec4 in_NORMAL0;
27vec4 Input1;
28 in highp vec4 in_TEXCOORD0;
29vec4 Input2;
30 out highp vec4 TEXCOORD0;
31#define Output0 TEXCOORD0
32 out highp vec4 COLOR0;
33#define Output1 COLOR0
34#undef Output2
35#define Output2 phase0_Output2
36vec4 phase0_Output2;
37vec4 Temp[4];
38ivec4 Temp_int[4];
39void main()
40{
41    Input0 = in_POSITION0;
42    Input1 = in_NORMAL0;
43    Input2 = in_TEXCOORD0;
44    Temp_int[0] = floatBitsToInt(Input0.yyyy * glstate_matrix_mvp[1]);
45    Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[0] * Input0.xxxx + intBitsToFloat(Temp_int[0]));
46    Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[2] * Input0.zzzz + intBitsToFloat(Temp_int[0]));
47    Output2 = glstate_matrix_mvp[3] * Input0.wwww + intBitsToFloat(Temp_int[0]);
48    Output0.xy = Input2.xy * _MainTex_ST.xy + _MainTex_ST.zw;
49    Temp_int[0].xyz = floatBitsToInt(Input0.yyy * glstate_matrix_modelview0[1].xyz);
50    Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[0].xyz * Input0.xxx + intBitsToFloat(Temp_int[0]).xyz);
51    Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[2].xyz * Input0.zzz + intBitsToFloat(Temp_int[0]).xyz);
52    Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[3].xyz * Input0.www + intBitsToFloat(Temp_int[0]).xyz);
53    Temp_int[1].xyz = floatBitsToInt(Input1.yyy * glstate_matrix_invtrans_modelview0[1].xyz);
54    Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[0].xyz * Input1.xxx + intBitsToFloat(Temp_int[1]).xyz);
55    Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[2].xyz * Input1.zzz + intBitsToFloat(Temp_int[1]).xyz);
56    Temp_int[0].w = floatBitsToInt(dot(intBitsToFloat(Temp_int[1]).xyz, intBitsToFloat(Temp_int[1]).xyz));
57    Temp_int[0].w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int[0]).w));
58    Temp_int[1].xyz = floatBitsToInt(intBitsToFloat(Temp_int[0]).www * intBitsToFloat(Temp_int[1]).xyz);
59    Temp[2].xyz = glstate_lightmodel_ambient.xyz;
60    Temp_int[0].w = 0x0;
61    while(true){
62        if ((Temp_int[0].w>= 0x4)) { break; }
63        Temp_int[1].w = int((Temp_int[0].w>=0x4) ? 0xFFFFFFFFu : 0u);
64        Temp[3].xyz = (-intBitsToFloat(Temp_int[0]).xyz) * unity_LightPosition[Temp_int[0].w + 0].www + unity_LightPosition[Temp_int[0].w + 0].xyz;
65        Temp_int[1].w = floatBitsToInt(dot(Temp[3].xyz, Temp[3].xyz));
66        Temp[2].w = inversesqrt(intBitsToFloat(Temp_int[1]).w);
67        Temp[3].xyz = Temp[2].www * Temp[3].xyz;
68        Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * unity_LightAtten[Temp_int[0].w + 0].z + intBitsToFloat(0x3F800000));
69        Temp_int[1].w = floatBitsToInt(float(intBitsToFloat(0x3F800000)) / intBitsToFloat(Temp_int[1]).w);
70        Temp[2].w = dot(Temp[3].xyz, unity_SpotDirection[Temp_int[0].w + 0].xyz);
71        Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0));
72        Temp[2].w = Temp[2].w + (-unity_LightAtten[Temp_int[0].w + 0].x);
73        Temp[2].w = Temp[2].w * unity_LightAtten[Temp_int[0].w + 0].y;
74        Temp[2].w = clamp(Temp[2].w, 0.0, 1.0);
75        Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w);
76        Temp[2].w = dot(intBitsToFloat(Temp_int[1]).xyz, Temp[3].xyz);
77        Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0));
78        Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w);
79        Temp[2].xyz = unity_LightColor[Temp_int[0].w + 0].xyz * intBitsToFloat(Temp_int[1]).www + Temp[2].xyz;
80        Temp_int[0].w = Temp_int[0].w + 0x1;
81    }
82    Output1.xyz = Temp[2].xyz * _Color.xyz;
83    Output1.w = _Color.w * _ReflectColor.w;
84    gl_Position = vec4(phase0_Output2);
85    return;
86}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
r245570r245571
1#version 300 es
2precision highp float;
3uniform vec4 unity_LightColor[8];
4uniform vec4 unity_LightPosition[8];
5uniform vec4 unity_LightAtten[8];
6uniform vec4 unity_SpotDirection[8];
7uniform mat4 glstate_matrix_mvp;
8uniform mat4 glstate_matrix_modelview0;
9uniform mat4 glstate_matrix_invtrans_modelview0;
10uniform vec4 glstate_lightmodel_ambient;
11uniform vec4 _MainTex_ST;
12uniform vec4 _Color;
13uniform vec4 _ReflectColor;
14in highp vec4 in_POSITION0;
15in highp vec4 in_NORMAL0;
16in highp vec4 in_TEXCOORD0;
17out highp vec4 TEXCOORD0;
18out highp vec4 COLOR0;
19highp vec4 phase0_Output2;
20highp vec4 Temp_2;
21highp vec4 Temp_3;
22highp ivec4 Temp_int_0;
23highp ivec4 Temp_int_1;
24void main ()
25{
26  Temp_int_0 = floatBitsToInt((in_POSITION0.yyyy * glstate_matrix_mvp[1]));
27  Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[0] * in_POSITION0.xxxx) + intBitsToFloat(Temp_int_0)));
28  Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[2] * in_POSITION0.zzzz) + intBitsToFloat(Temp_int_0)));
29  phase0_Output2 = ((glstate_matrix_mvp[3] * in_POSITION0.wwww) + intBitsToFloat(Temp_int_0));
30  TEXCOORD0.xy = ((in_TEXCOORD0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
31  Temp_int_0.xyz = floatBitsToInt((in_POSITION0.yyy * glstate_matrix_modelview0[1].xyz));
32  Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[0].xyz * in_POSITION0.xxx) + intBitsToFloat(Temp_int_0).xyz));
33  Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[2].xyz * in_POSITION0.zzz) + intBitsToFloat(Temp_int_0).xyz));
34  Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[3].xyz * in_POSITION0.www) + intBitsToFloat(Temp_int_0).xyz));
35  Temp_int_1.xyz = floatBitsToInt((in_NORMAL0.yyy * glstate_matrix_invtrans_modelview0[1].xyz));
36  Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[0].xyz * in_NORMAL0.xxx) + intBitsToFloat(Temp_int_1).xyz));
37  Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[2].xyz * in_NORMAL0.zzz) + intBitsToFloat(Temp_int_1).xyz));
38  Temp_int_0.w = floatBitsToInt(dot (intBitsToFloat(Temp_int_1).xyz, intBitsToFloat(Temp_int_1).xyz));
39  Temp_int_0.w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int_0).w));
40  Temp_int_1.xyz = floatBitsToInt((intBitsToFloat(Temp_int_0).www * intBitsToFloat(Temp_int_1).xyz));
41  Temp_2.xyz = glstate_lightmodel_ambient.xyz;
42  Temp_int_0.w = 0;
43  for (; Temp_int_0.w < 4; Temp_int_0.w = (Temp_int_0.w + 1)) {
44    Temp_3.xyz = ((-(
45      intBitsToFloat(Temp_int_0)
46    .xyz) * unity_LightPosition[Temp_int_0.w].www) + unity_LightPosition[Temp_int_0.w].xyz);
47    Temp_int_1.w = floatBitsToInt(dot (Temp_3.xyz, Temp_3.xyz));
48    Temp_2.w = inversesqrt(intBitsToFloat(Temp_int_1).w);
49    Temp_3.xyz = (Temp_2.www * Temp_3.xyz);
50    Temp_int_1.w = floatBitsToInt(((
51      intBitsToFloat(Temp_int_1)
52    .w * unity_LightAtten[Temp_int_0.w].z) + 1.0));
53    Temp_int_1.w = floatBitsToInt((1.0/(intBitsToFloat(Temp_int_1).w)));
54    Temp_2.w = dot (Temp_3.xyz, unity_SpotDirection[Temp_int_0.w].xyz);
55    Temp_2.w = max (Temp_2.w, 0.0);
56    Temp_2.w = (Temp_2.w - unity_LightAtten[Temp_int_0.w].x);
57    Temp_2.w = (Temp_2.w * unity_LightAtten[Temp_int_0.w].y);
58    Temp_2.w = clamp (Temp_2.w, 0.0, 1.0);
59    Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w));
60    Temp_2.w = dot (intBitsToFloat(Temp_int_1).xyz, Temp_3.xyz);
61    Temp_2.w = max (Temp_2.w, 0.0);
62    Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w));
63    Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyz * intBitsToFloat(Temp_int_1).www) + Temp_2.xyz);
64  };
65  COLOR0.xyz = (Temp_2.xyz * _Color.xyz);
66  COLOR0.w = (_Color.w * _ReflectColor.w);
67  gl_Position = phase0_Output2;
68}
69
70
71// stats: 88 alu 0 tex 2 flow
72// inputs: 3
73//  #0: in_POSITION0 (high float) 4x1 [-1]
74//  #1: in_NORMAL0 (high float) 4x1 [-1]
75//  #2: in_TEXCOORD0 (high float) 4x1 [-1]
76// uniforms: 11 (total size: 0)
77//  #0: unity_LightColor (high float) 4x1 [8]
78//  #1: unity_LightPosition (high float) 4x1 [8]
79//  #2: unity_LightAtten (high float) 4x1 [8]
80//  #3: unity_SpotDirection (high float) 4x1 [8]
81//  #4: glstate_matrix_mvp (high float) 4x4 [-1]
82//  #5: glstate_matrix_modelview0 (high float) 4x4 [-1]
83//  #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
84//  #7: glstate_lightmodel_ambient (high float) 4x1 [-1]
85//  #8: _MainTex_ST (high float) 4x1 [-1]
86//  #9: _Color (high float) 4x1 [-1]
87//  #10: _ReflectColor (high float) 4x1 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  float4 in_POSITION0 [[attribute(0)]];
5  float4 in_NORMAL0 [[attribute(1)]];
6  float4 in_TEXCOORD0 [[attribute(2)]];
7};
8struct xlatMtlShaderOutput {
9  float4 gl_Position [[position]];
10  float4 TEXCOORD0;
11  float4 COLOR0;
12};
13struct xlatMtlShaderUniform {
14  float4 unity_LightColor[8];
15  float4 unity_LightPosition[8];
16  float4 unity_LightAtten[8];
17  float4 unity_SpotDirection[8];
18  float4x4 glstate_matrix_mvp;
19  float4x4 glstate_matrix_modelview0;
20  float4x4 glstate_matrix_invtrans_modelview0;
21  float4 glstate_lightmodel_ambient;
22  float4 _MainTex_ST;
23  float4 _Color;
24  float4 _ReflectColor;
25};
26;
27vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
28{
29  xlatMtlShaderOutput _mtl_o;
30float4 phase0_Output2_1;
31float4 Temp_2_2;
32float4 Temp_3_3;
33int4 Temp_int_0_4;
34int4 Temp_int_1_5;
35  Temp_int_0_4 = as_type<int4>((_mtl_i.in_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]));
36  Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.in_POSITION0.xxxx) + as_type<float4>(Temp_int_0_4)));
37  Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.in_POSITION0.zzzz) + as_type<float4>(Temp_int_0_4)));
38  phase0_Output2_1 = ((_mtl_u.glstate_matrix_mvp[3] * _mtl_i.in_POSITION0.wwww) + as_type<float4>(Temp_int_0_4));
39  _mtl_o.TEXCOORD0.xy = ((_mtl_i.in_TEXCOORD0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw);
40  Temp_int_0_4.xyz = as_type<int3>((_mtl_i.in_POSITION0.yyy * _mtl_u.glstate_matrix_modelview0[1].xyz));
41  Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[0].xyz * _mtl_i.in_POSITION0.xxx) + as_type<float4>(Temp_int_0_4).xyz));
42  Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[2].xyz * _mtl_i.in_POSITION0.zzz) + as_type<float4>(Temp_int_0_4).xyz));
43  Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[3].xyz * _mtl_i.in_POSITION0.www) + as_type<float4>(Temp_int_0_4).xyz));
44  Temp_int_1_5.xyz = as_type<int3>((_mtl_i.in_NORMAL0.yyy * _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz));
45  Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[0].xyz * _mtl_i.in_NORMAL0.xxx) + as_type<float4>(Temp_int_1_5).xyz));
46  Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[2].xyz * _mtl_i.in_NORMAL0.zzz) + as_type<float4>(Temp_int_1_5).xyz));
47  Temp_int_0_4.w = as_type<int>(dot (as_type<float4>(Temp_int_1_5).xyz, as_type<float4>(Temp_int_1_5).xyz));
48  Temp_int_0_4.w = as_type<int>(rsqrt(as_type<float4>(Temp_int_0_4).w));
49  Temp_int_1_5.xyz = as_type<int3>((as_type<float4>(Temp_int_0_4).www * as_type<float4>(Temp_int_1_5).xyz));
50  Temp_2_2.xyz = _mtl_u.glstate_lightmodel_ambient.xyz;
51  Temp_int_0_4.w = 0;
52  for (; Temp_int_0_4.w < 4; Temp_int_0_4.w = (Temp_int_0_4.w + 1)) {
53    Temp_3_3.xyz = ((-(
54      as_type<float4>(Temp_int_0_4)
55    .xyz) * _mtl_u.unity_LightPosition[Temp_int_0_4.w].www) + _mtl_u.unity_LightPosition[Temp_int_0_4.w].xyz);
56    Temp_int_1_5.w = as_type<int>(dot (Temp_3_3.xyz, Temp_3_3.xyz));
57    Temp_2_2.w = rsqrt(as_type<float4>(Temp_int_1_5).w);
58    Temp_3_3.xyz = (Temp_2_2.www * Temp_3_3.xyz);
59    Temp_int_1_5.w = as_type<int>(((
60      as_type<float4>(Temp_int_1_5)
61    .w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].z) + 1.0));
62    Temp_int_1_5.w = as_type<int>((1.0/(as_type<float4>(Temp_int_1_5).w)));
63    Temp_2_2.w = dot (Temp_3_3.xyz, _mtl_u.unity_SpotDirection[Temp_int_0_4.w].xyz);
64    Temp_2_2.w = max (Temp_2_2.w, 0.0);
65    Temp_2_2.w = (Temp_2_2.w - _mtl_u.unity_LightAtten[Temp_int_0_4.w].x);
66    Temp_2_2.w = (Temp_2_2.w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].y);
67    Temp_2_2.w = clamp (Temp_2_2.w, 0.0, 1.0);
68    Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w));
69    Temp_2_2.w = dot (as_type<float4>(Temp_int_1_5).xyz, Temp_3_3.xyz);
70    Temp_2_2.w = max (Temp_2_2.w, 0.0);
71    Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w));
72    Temp_2_2.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_4.w].xyz * as_type<float4>(Temp_int_1_5).www) + Temp_2_2.xyz);
73  };
74  _mtl_o.COLOR0.xyz = (Temp_2_2.xyz * _mtl_u._Color.xyz);
75  _mtl_o.COLOR0.w = (_mtl_u._Color.w * _mtl_u._ReflectColor.w);
76  _mtl_o.gl_Position = phase0_Output2_1;
77  return _mtl_o;
78}
79
80
81// stats: 88 alu 0 tex 2 flow
82// inputs: 3
83//  #0: in_POSITION0 (high float) 4x1 [-1] loc 0
84//  #1: in_NORMAL0 (high float) 4x1 [-1] loc 1
85//  #2: in_TEXCOORD0 (high float) 4x1 [-1] loc 2
86// uniforms: 11 (total size: 768)
87//  #0: unity_LightColor (high float) 4x1 [8] loc 0
88//  #1: unity_LightPosition (high float) 4x1 [8] loc 128
89//  #2: unity_LightAtten (high float) 4x1 [8] loc 256
90//  #3: unity_SpotDirection (high float) 4x1 [8] loc 384
91//  #4: glstate_matrix_mvp (high float) 4x4 [-1] loc 512
92//  #5: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 576
93//  #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 640
94//  #7: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 704
95//  #8: _MainTex_ST (high float) 4x1 [-1] loc 720
96//  #9: _Color (high float) 4x1 [-1] loc 736
97//  #10: _ReflectColor (high float) 4x1 [-1] loc 752
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt
r245570r245571
1919  lowp vec3 tmpvar_4;
2020  lowp vec3 tmpvar_5;
2121  highp mat3 tmpvar_6;
22  tmpvar_6[uint(0)] = _Object2World[0].xyz;
22  tmpvar_6[0u] = _Object2World[0].xyz;
2323  tmpvar_6[1u] = _Object2World[1].xyz;
2424  tmpvar_6[2u] = _Object2World[2].xyz;
2525  mediump vec3 tmpvar_7;
r245570r245571
3131  tmpvar_8 = attrTangent.xyz;
3232  tmpvar_9 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w);
3333  mediump mat3 tmpvar_10;
34  tmpvar_10[uint(0)].x = tmpvar_8.x;
35  tmpvar_10[uint(0)].y = tmpvar_9.x;
36  tmpvar_10[uint(0)].z = attrNormal.x;
34  tmpvar_10[0u].x = tmpvar_8.x;
35  tmpvar_10[0u].y = tmpvar_9.x;
36  tmpvar_10[0u].z = attrNormal.x;
3737  tmpvar_10[1u].x = tmpvar_8.y;
3838  tmpvar_10[1u].y = tmpvar_9.y;
3939  tmpvar_10[1u].z = attrNormal.y;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt
r245570r245571
11varying vec3 var_a;
22void main ()
33{
4  gl_Position = (gl_Vertex * vec4(0.1825742, 0.3651484, 0.5477225, 0.7302967));
4  gl_Position = (gl_Vertex * vec4(0.182574, 0.365148, 0.547723, 0.730297));
55  var_a = (gl_Vertex.xyz * normalize(vec3(0.0, 0.0, 0.0)));
66}
77
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt
r245570r245571
3030  tmpvar_8.xyz = tmpvar_1;
3131  viewpos_7 = (glstate_matrix_modelview0 * tmpvar_8).xyz;
3232  highp mat3 tmpvar_9;
33  tmpvar_9[uint(0)] = glstate_matrix_invtrans_modelview0[uint(0)].xyz;
33  tmpvar_9[0u] = glstate_matrix_invtrans_modelview0[0u].xyz;
3434  tmpvar_9[1u] = glstate_matrix_invtrans_modelview0[1u].xyz;
3535  tmpvar_9[2u] = glstate_matrix_invtrans_modelview0[2u].xyz;
3636  viewN_6 = (tmpvar_9 * n_2);
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt
r245570r245571
1// stripped down version of Nicholas' Static Sky
2// hybrid lighting shader that exposed vector_insert_todo
3// bug
4
5vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
6   return texture2DLod( s, coord.xy, coord.w);
7}
8mat3 xll_constructMat3_mf4x4( mat4 m) {
9  return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
10}
11struct Lamp {
12    vec4 posRange;
13    vec4 colorImp;
14};
15struct v2f {
16    vec4 pos;
17    vec3 diffuse;
18};
19struct HybridAppData {
20    vec4 vertex;
21    vec4 tangent;
22    vec3 normal;
23    vec4 texcoord;
24    vec4 bakedCol;
25    vec2 bakedDir;
26};
27uniform vec3 _WorldSpaceCameraPos;
28uniform vec4 _ProjectionParams;
29uniform vec4 _ScreenParams;
30uniform vec4 _ZBufferParams;
31uniform vec4 _WorldSpaceLightPos0;
32
33uniform mat4 _Object2World;
34uniform mat4 _World2Object;
35
36
37
38uniform float _RenderExposure;
39uniform vec2 _DynLampInfo_bufferSize;
40uniform sampler2D _DynLampInfo;
41uniform float LightVertOffset;
42uniform sampler2D LightVertTexture;
43uniform vec4 LightVertTextureSize;
44void CalcDynamicLight( in vec3 worldVert, in vec3 worldNorm, in Lamp lamp[4], inout vec3 hybridDir, inout vec3 hybridCol ) {
45    vec4 atten;
46    int i = 0;
47    for ( ; (i < 4); (i++)) {
48       
49        vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
50        float lengthSq = dot( lightToVert, lightToVert);
51        vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
52       
53        atten[i] = (lengthSq * lamp[i].posRange.w);
54        float nDotL = dot( lightToVertNorm, worldNorm);
55        float weight = (atten[i] * nDotL);
56    }
57   
58    int j = 0;
59    for ( ; (j < 4); (j++)) {
60        hybridCol += (lamp[j].colorImp.xyz * atten[j]);
61    }
62}
63void LoadBakedLight( out vec3 hybridCol, out vec3 hybridDir ) {
64}
65vec4 DoSampleGPUBuffer( in sampler2D buffer, in vec2 coord, in vec2 dimensions ) {
66    return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
67}
68void ReadLightArray3( in ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
69   
70    l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
71    l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
72    l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
73   
74    l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
75    l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
76    l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
77   
78    l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
79    l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
80}
81void DoCalcHybridLight2( in vec3 worldVert, in vec3 worldNorm, out vec3 hybridCol, in vec4 bakedColor, in vec2 bakedDir ) {
82    vec3 hybridDir;
83    LoadBakedLight( hybridCol, hybridDir);
84   
85    ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
86    Lamp l[4];
87    ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
88   
89    CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
90}
91vec3 CalcDiffuseHybridLight( in vec3 worldVert, in vec3 worldNorm, in vec4 bakedColor, in vec2 bakedDir ) {
92    vec3 hybridCol;
93    DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
94   
95    return hybridCol;
96}
97v2f vert( in HybridAppData v ) {
98    v2f o;
99   
100    vec3 worldVert = (_Object2World * v.vertex).xyz;
101    vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz));
102    o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
103   
104    o.pos = (gl_ModelViewProjectionMatrix * v.vertex);
105    return o;
106}
107attribute vec4 TANGENT;
108varying vec3 xlv_TEXCOORD2;
109void main() {
110    v2f xl_retval;
111    HybridAppData xlt_v;
112    xlt_v.vertex = vec4(gl_Vertex);
113    xlt_v.tangent = vec4(TANGENT);
114    xlt_v.normal = vec3(gl_Normal);
115    xlt_v.texcoord = vec4(gl_MultiTexCoord0);
116    xlt_v.bakedCol = vec4(gl_Color);
117    xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
118    xl_retval = vert( xlt_v);
119    gl_Position = vec4(xl_retval.pos);
120    xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
121}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt
r245570r245571
1// stripped down version of Nicholas' Static Sky
2// hybrid lighting shader that exposed vector_insert_todo
3// bug
4
5#define gl_Vertex _glesVertex
6attribute vec4 _glesVertex;
7#define gl_Color _glesColor
8attribute vec4 _glesColor;
9#define gl_Normal _glesNormal
10attribute vec3 _glesNormal;
11#define gl_MultiTexCoord0 _glesMultiTexCoord0
12attribute vec4 _glesMultiTexCoord0;
13#define gl_MultiTexCoord1 _glesMultiTexCoord1
14attribute vec4 _glesMultiTexCoord1;
15#define TANGENT _glesTANGENT
16attribute vec4 _glesTANGENT;
17vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
18   return texture2DLod( s, coord.xy, coord.w);
19}
20mat3 xll_constructMat3_mf4x4( mat4 m) {
21  return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
22}
23struct Lamp {
24    mediump vec4 posRange;
25    mediump vec4 colorImp;
26};
27struct v2f {
28    highp vec4 pos;
29    mediump vec3 diffuse;
30};
31struct HybridAppData {
32    highp vec4 vertex;
33    highp vec4 tangent;
34    highp vec3 normal;
35    highp vec4 texcoord;
36    lowp vec4 bakedCol;
37    mediump vec2 bakedDir;
38};
39uniform highp vec4 _Time;
40uniform highp vec4 _SinTime;
41uniform highp vec4 _CosTime;
42uniform highp vec3 _WorldSpaceCameraPos;
43uniform highp vec4 _ProjectionParams;
44uniform highp vec4 _ScreenParams;
45uniform highp vec4 _ZBufferParams;
46uniform highp vec4 _WorldSpaceLightPos0;
47uniform highp vec4 _LightPositionRange;
48uniform highp mat4 glstate_matrix_mvp;
49uniform highp mat4 glstate_matrix_modelview0;
50uniform highp mat4 glstate_matrix_invtrans_modelview0;
51uniform highp mat4 _Object2World;
52uniform highp mat4 _World2Object;
53uniform highp mat4 glstate_matrix_transpose_modelview0;
54uniform highp mat4 glstate_matrix_projection;
55uniform lowp vec4 glstate_lightmodel_ambient;
56uniform highp float _RenderExposure;
57uniform mediump vec2 _DynLampInfo_bufferSize;
58uniform sampler2D _DynLampInfo;
59uniform highp float LightVertOffset;
60uniform sampler2D LightVertTexture;
61uniform highp vec4 LightVertTextureSize;
62void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) {
63    mediump vec4 atten;
64    highp int i = 0;
65    for ( ; (i < 4); (i++)) {
66   
67        highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
68        highp float lengthSq = dot( lightToVert, lightToVert);
69        highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
70   
71        atten[i] = (lengthSq * lamp[i].posRange.w);
72        mediump float nDotL = dot( lightToVertNorm, worldNorm);
73        mediump float weight = (atten[i] * nDotL);
74    }
75
76    highp int j = 0;
77    for ( ; (j < 4); (j++)) {
78        hybridCol += (lamp[j].colorImp.xyz * atten[j]);
79    }
80}
81void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) {
82}
83mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) {
84    return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
85}
86void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
87
88    l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
89    l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
90    l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
91
92    l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
93    l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
94    l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
95
96    l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
97    l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
98}
99void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) {
100    mediump vec3 hybridDir;
101    LoadBakedLight( hybridCol, hybridDir);
102
103    highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
104    Lamp l[4];
105    ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
106
107    CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
108}
109highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) {
110    mediump vec3 hybridCol;
111    DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
112
113    return hybridCol;
114}
115v2f vert( in HybridAppData v ) {
116    v2f o;
117
118    highp vec3 worldVert = (_Object2World * v.vertex).xyz;
119    highp vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz));
120    o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
121
122    o.pos = (glstate_matrix_mvp * v.vertex);
123    return o;
124}
125
126varying mediump vec3 xlv_TEXCOORD2;
127void main() {
128    v2f xl_retval;
129    HybridAppData xlt_v;
130    xlt_v.vertex = vec4(gl_Vertex);
131    xlt_v.tangent = vec4(TANGENT);
132    xlt_v.normal = vec3(gl_Normal);
133    xlt_v.texcoord = vec4(gl_MultiTexCoord0);
134    xlt_v.bakedCol = vec4(gl_Color);
135    xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
136    xl_retval = vert( xlt_v);
137    gl_Position = vec4(xl_retval.pos);
138    xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
139}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt
r245570r245571
1#version 300 es
2
3// stripped down version of Nicholas' Static Sky
4// hybrid lighting shader that exposed vector_insert_todo
5// bug
6
7#define gl_Vertex _glesVertex
8in vec4 _glesVertex;
9#define gl_Color _glesColor
10in vec4 _glesColor;
11#define gl_Normal _glesNormal
12in vec3 _glesNormal;
13#define gl_MultiTexCoord0 _glesMultiTexCoord0
14in vec4 _glesMultiTexCoord0;
15#define gl_MultiTexCoord1 _glesMultiTexCoord1
16in vec4 _glesMultiTexCoord1;
17#define TANGENT _glesTANGENT
18in vec4 _glesTANGENT;
19vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
20   return textureLod( s, coord.xy, coord.w);
21}
22struct Lamp {
23    mediump vec4 posRange;
24    mediump vec4 colorImp;
25};
26struct v2f {
27    highp vec4 pos;
28    mediump vec3 diffuse;
29};
30struct HybridAppData {
31    highp vec4 vertex;
32    highp vec4 tangent;
33    highp vec3 normal;
34    highp vec4 texcoord;
35    lowp vec4 bakedCol;
36    mediump vec2 bakedDir;
37};
38uniform highp vec3 _WorldSpaceCameraPos;
39uniform highp vec4 _ProjectionParams;
40uniform highp vec4 _ScreenParams;
41uniform highp vec4 _ZBufferParams;
42uniform highp vec4 _WorldSpaceLightPos0;
43uniform highp mat4 glstate_matrix_mvp;
44uniform highp mat4 glstate_matrix_modelview0;
45uniform highp mat4 glstate_matrix_invtrans_modelview0;
46uniform highp mat4 _Object2World;
47uniform highp mat4 _World2Object;
48uniform highp mat4 glstate_matrix_transpose_modelview0;
49uniform highp mat4 glstate_matrix_projection;
50uniform lowp vec4 glstate_lightmodel_ambient;
51uniform highp float _RenderExposure;
52uniform mediump vec2 _DynLampInfo_bufferSize;
53uniform sampler2D _DynLampInfo;
54uniform highp float LightVertOffset;
55uniform sampler2D LightVertTexture;
56uniform highp vec4 LightVertTextureSize;
57void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) {
58    mediump vec4 atten;
59    highp int i = 0;
60    for ( ; (i < 4); (i++)) {
61   
62        highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
63        highp float lengthSq = dot( lightToVert, lightToVert);
64        highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
65   
66        atten[i] = (lengthSq * lamp[i].posRange.w);
67        mediump float nDotL = dot( lightToVertNorm, worldNorm);
68        mediump float weight = (atten[i] * nDotL);
69    }
70
71    highp int j = 0;
72    for ( ; (j < 4); (j++)) {
73        hybridCol += (lamp[j].colorImp.xyz * atten[j]);
74    }
75}
76void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) {
77}
78mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) {
79    return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
80}
81void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
82
83    l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
84    l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
85    l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
86
87    l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
88    l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
89    l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
90
91    l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
92    l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
93}
94void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) {
95    mediump vec3 hybridDir;
96    LoadBakedLight( hybridCol, hybridDir);
97
98    highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
99    Lamp l[4];
100    ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
101
102    CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
103}
104highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) {
105    mediump vec3 hybridCol;
106    DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
107
108    return hybridCol;
109}
110v2f vert( in HybridAppData v ) {
111    v2f o;
112
113    highp vec3 worldVert = (_Object2World * v.vertex).xyz;
114    highp vec3 worldNorm = normalize((mat3( _Object2World) * v.normal.xyz));
115    o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
116
117    o.pos = (glstate_matrix_mvp * v.vertex);
118    return o;
119}
120
121out mediump vec3 xlv_TEXCOORD2;
122void main() {
123    v2f xl_retval;
124    HybridAppData xlt_v;
125    xlt_v.vertex = vec4(gl_Vertex);
126    xlt_v.tangent = vec4(TANGENT);
127    xlt_v.normal = vec3(gl_Normal);
128    xlt_v.texcoord = vec4(gl_MultiTexCoord0);
129    xlt_v.bakedCol = vec4(gl_Color);
130    xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
131    xl_retval = vert( xlt_v);
132    gl_Position = vec4(xl_retval.pos);
133    xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
134}
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt
r245570r245571
1uniform mat4 _Object2World;
2uniform vec2 _DynLampInfo_bufferSize;
3uniform sampler2D _DynLampInfo;
4varying vec3 xlv_TEXCOORD2;
5void main ()
6{
7  vec3 tmpvar_1;
8  tmpvar_1 = (_Object2World * gl_Vertex).xyz;
9  vec3 hybridCol_2;
10  ivec4 tmpvar_3;
11  tmpvar_3.xyz = ivec3(tmpvar_1);
12  tmpvar_3.w = int(-(tmpvar_1.x));
13  vec4 tmpvar_4;
14  vec4 tmpvar_5;
15  vec4 tmpvar_6;
16  vec4 tmpvar_7;
17  vec2 tmpvar_8;
18  tmpvar_8.y = 1.0;
19  tmpvar_8.x = float(tmpvar_3.x);
20  vec4 tmpvar_9;
21  tmpvar_9.zw = vec2(0.0, 0.0);
22  tmpvar_9.xy = (tmpvar_8 / _DynLampInfo_bufferSize);
23  tmpvar_4 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0);
24  vec2 tmpvar_10;
25  tmpvar_10.y = 2.0;
26  tmpvar_10.x = float(tmpvar_3.x);
27  vec4 tmpvar_11;
28  tmpvar_11.zw = vec2(0.0, 0.0);
29  tmpvar_11.xy = (tmpvar_10 / _DynLampInfo_bufferSize);
30  vec2 tmpvar_12;
31  tmpvar_12.y = 1.0;
32  tmpvar_12.x = float(tmpvar_3.y);
33  vec4 tmpvar_13;
34  tmpvar_13.zw = vec2(0.0, 0.0);
35  tmpvar_13.xy = (tmpvar_12 / _DynLampInfo_bufferSize);
36  tmpvar_5 = texture2DLod (_DynLampInfo, tmpvar_13.xy, 0.0);
37  vec2 tmpvar_14;
38  tmpvar_14.y = 2.0;
39  tmpvar_14.x = float(tmpvar_3.y);
40  vec4 tmpvar_15;
41  tmpvar_15.zw = vec2(0.0, 0.0);
42  tmpvar_15.xy = (tmpvar_14 / _DynLampInfo_bufferSize);
43  vec2 tmpvar_16;
44  tmpvar_16.y = 1.0;
45  tmpvar_16.x = float(tmpvar_3.z);
46  vec4 tmpvar_17;
47  tmpvar_17.zw = vec2(0.0, 0.0);
48  tmpvar_17.xy = (tmpvar_16 / _DynLampInfo_bufferSize);
49  tmpvar_6 = texture2DLod (_DynLampInfo, tmpvar_17.xy, 0.0);
50  vec2 tmpvar_18;
51  tmpvar_18.y = 2.0;
52  tmpvar_18.x = float(tmpvar_3.z);
53  vec4 tmpvar_19;
54  tmpvar_19.zw = vec2(0.0, 0.0);
55  tmpvar_19.xy = (tmpvar_18 / _DynLampInfo_bufferSize);
56  vec2 tmpvar_20;
57  tmpvar_20.y = 1.0;
58  tmpvar_20.x = float(tmpvar_3.w);
59  vec4 tmpvar_21;
60  tmpvar_21.zw = vec2(0.0, 0.0);
61  tmpvar_21.xy = (tmpvar_20 / _DynLampInfo_bufferSize);
62  tmpvar_7 = texture2DLod (_DynLampInfo, tmpvar_21.xy, 0.0);
63  vec2 tmpvar_22;
64  tmpvar_22.y = 2.0;
65  tmpvar_22.x = float(tmpvar_3.w);
66  vec4 tmpvar_23;
67  tmpvar_23.zw = vec2(0.0, 0.0);
68  tmpvar_23.xy = (tmpvar_22 / _DynLampInfo_bufferSize);
69  vec3 hybridCol_24;
70  vec4 atten_25;
71  vec3 tmpvar_26;
72  tmpvar_26 = (tmpvar_4.xyz - tmpvar_1);
73  vec4 tmpvar_27;
74  tmpvar_27.yzw = atten_25.yzw;
75  tmpvar_27.x = (dot (tmpvar_26, tmpvar_26) * tmpvar_4.w);
76  vec3 tmpvar_28;
77  tmpvar_28 = (tmpvar_5.xyz - tmpvar_1);
78  vec4 tmpvar_29;
79  tmpvar_29.xzw = tmpvar_27.xzw;
80  tmpvar_29.y = (dot (tmpvar_28, tmpvar_28) * tmpvar_5.w);
81  vec3 tmpvar_30;
82  tmpvar_30 = (tmpvar_6.xyz - tmpvar_1);
83  vec4 tmpvar_31;
84  tmpvar_31.xyw = tmpvar_29.xyw;
85  tmpvar_31.z = (dot (tmpvar_30, tmpvar_30) * tmpvar_6.w);
86  vec3 tmpvar_32;
87  tmpvar_32 = (tmpvar_7.xyz - tmpvar_1);
88  vec4 tmpvar_33;
89  tmpvar_33.xyz = tmpvar_31.xyz;
90  tmpvar_33.w = (dot (tmpvar_32, tmpvar_32) * tmpvar_7.w);
91  atten_25 = tmpvar_33;
92  hybridCol_24 = (hybridCol_2 + (texture2DLod (_DynLampInfo, tmpvar_11.xy, 0.0).xyz * tmpvar_27.x));
93  hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_15.xy, 0.0).xyz * tmpvar_29.y));
94  hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0).xyz * tmpvar_31.z));
95  hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_23.xy, 0.0).xyz * tmpvar_33.w));
96  gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
97  xlv_TEXCOORD2 = hybridCol_24;
98}
99
100
101// stats: 57 alu 8 tex 0 flow
102// inputs: 1
103//  #0: gl_Vertex (high float) 4x1 [-1] loc 0
104// uniforms: 3 (total size: 0)
105//  #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
106//  #1: _Object2World (high float) 4x4 [-1]
107//  #2: _DynLampInfo_bufferSize (high float) 2x1 [-1]
108// textures: 1
109//  #0: _DynLampInfo (high 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
r245570r245571
1attribute vec4 _glesVertex;
2uniform highp mat4 glstate_matrix_mvp;
3uniform highp mat4 _Object2World;
4uniform mediump vec2 _DynLampInfo_bufferSize;
5uniform sampler2D _DynLampInfo;
6varying mediump vec3 xlv_TEXCOORD2;
7void main ()
8{
9  mediump vec3 tmpvar_1;
10  highp vec3 tmpvar_2;
11  tmpvar_2 = (_Object2World * _glesVertex).xyz;
12  highp vec3 tmpvar_3;
13  mediump vec3 hybridCol_4;
14  highp ivec4 tmpvar_5;
15  tmpvar_5.xyz = ivec3(tmpvar_2);
16  tmpvar_5.w = int(-(tmpvar_2.x));
17  highp vec2 tmpvar_6;
18  tmpvar_6.y = 1.0;
19  tmpvar_6.x = float(tmpvar_5.x);
20  mediump vec4 tmpvar_7;
21  mediump vec2 coord_8;
22  coord_8 = tmpvar_6;
23  mediump vec4 tmpvar_9;
24  tmpvar_9.zw = vec2(0.0, 0.0);
25  tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize);
26  lowp vec4 tmpvar_10;
27  tmpvar_10 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0);
28  tmpvar_7 = tmpvar_10;
29  highp vec2 tmpvar_11;
30  tmpvar_11.y = 2.0;
31  tmpvar_11.x = float(tmpvar_5.x);
32  mediump vec4 tmpvar_12;
33  mediump vec2 coord_13;
34  coord_13 = tmpvar_11;
35  mediump vec4 tmpvar_14;
36  tmpvar_14.zw = vec2(0.0, 0.0);
37  tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize);
38  lowp vec4 tmpvar_15;
39  tmpvar_15 = texture2DLod (_DynLampInfo, tmpvar_14.xy, 0.0);
40  tmpvar_12 = tmpvar_15;
41  highp vec2 tmpvar_16;
42  tmpvar_16.y = 1.0;
43  tmpvar_16.x = float(tmpvar_5.y);
44  mediump vec4 tmpvar_17;
45  mediump vec2 coord_18;
46  coord_18 = tmpvar_16;
47  mediump vec4 tmpvar_19;
48  tmpvar_19.zw = vec2(0.0, 0.0);
49  tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize);
50  lowp vec4 tmpvar_20;
51  tmpvar_20 = texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0);
52  tmpvar_17 = tmpvar_20;
53  highp vec2 tmpvar_21;
54  tmpvar_21.y = 2.0;
55  tmpvar_21.x = float(tmpvar_5.y);
56  mediump vec4 tmpvar_22;
57  mediump vec2 coord_23;
58  coord_23 = tmpvar_21;
59  mediump vec4 tmpvar_24;
60  tmpvar_24.zw = vec2(0.0, 0.0);
61  tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize);
62  lowp vec4 tmpvar_25;
63  tmpvar_25 = texture2DLod (_DynLampInfo, tmpvar_24.xy, 0.0);
64  tmpvar_22 = tmpvar_25;
65  highp vec2 tmpvar_26;
66  tmpvar_26.y = 1.0;
67  tmpvar_26.x = float(tmpvar_5.z);
68  mediump vec4 tmpvar_27;
69  mediump vec2 coord_28;
70  coord_28 = tmpvar_26;
71  mediump vec4 tmpvar_29;
72  tmpvar_29.zw = vec2(0.0, 0.0);
73  tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize);
74  lowp vec4 tmpvar_30;
75  tmpvar_30 = texture2DLod (_DynLampInfo, tmpvar_29.xy, 0.0);
76  tmpvar_27 = tmpvar_30;
77  highp vec2 tmpvar_31;
78  tmpvar_31.y = 2.0;
79  tmpvar_31.x = float(tmpvar_5.z);
80  mediump vec4 tmpvar_32;
81  mediump vec2 coord_33;
82  coord_33 = tmpvar_31;
83  mediump vec4 tmpvar_34;
84  tmpvar_34.zw = vec2(0.0, 0.0);
85  tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize);
86  lowp vec4 tmpvar_35;
87  tmpvar_35 = texture2DLod (_DynLampInfo, tmpvar_34.xy, 0.0);
88  tmpvar_32 = tmpvar_35;
89  highp vec2 tmpvar_36;
90  tmpvar_36.y = 1.0;
91  tmpvar_36.x = float(tmpvar_5.w);
92  mediump vec4 tmpvar_37;
93  mediump vec2 coord_38;
94  coord_38 = tmpvar_36;
95  mediump vec4 tmpvar_39;
96  tmpvar_39.zw = vec2(0.0, 0.0);
97  tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize);
98  lowp vec4 tmpvar_40;
99  tmpvar_40 = texture2DLod (_DynLampInfo, tmpvar_39.xy, 0.0);
100  tmpvar_37 = tmpvar_40;
101  highp vec2 tmpvar_41;
102  tmpvar_41.y = 2.0;
103  tmpvar_41.x = float(tmpvar_5.w);
104  mediump vec4 tmpvar_42;
105  mediump vec2 coord_43;
106  coord_43 = tmpvar_41;
107  mediump vec4 tmpvar_44;
108  tmpvar_44.zw = vec2(0.0, 0.0);
109  tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize);
110  lowp vec4 tmpvar_45;
111  tmpvar_45 = texture2DLod (_DynLampInfo, tmpvar_44.xy, 0.0);
112  tmpvar_42 = tmpvar_45;
113  mediump vec3 hybridCol_46;
114  mediump vec4 atten_47;
115  highp vec3 tmpvar_48;
116  tmpvar_48 = (tmpvar_7.xyz - tmpvar_2);
117  highp float tmpvar_49;
118  tmpvar_49 = dot (tmpvar_48, tmpvar_48);
119  mediump vec4 tmpvar_50;
120  tmpvar_50.yzw = atten_47.yzw;
121  tmpvar_50.x = (tmpvar_49 * tmpvar_7.w);
122  highp vec3 tmpvar_51;
123  tmpvar_51 = (tmpvar_17.xyz - tmpvar_2);
124  highp float tmpvar_52;
125  tmpvar_52 = dot (tmpvar_51, tmpvar_51);
126  mediump vec4 tmpvar_53;
127  tmpvar_53.xzw = tmpvar_50.xzw;
128  tmpvar_53.y = (tmpvar_52 * tmpvar_17.w);
129  highp vec3 tmpvar_54;
130  tmpvar_54 = (tmpvar_27.xyz - tmpvar_2);
131  highp float tmpvar_55;
132  tmpvar_55 = dot (tmpvar_54, tmpvar_54);
133  mediump vec4 tmpvar_56;
134  tmpvar_56.xyw = tmpvar_53.xyw;
135  tmpvar_56.z = (tmpvar_55 * tmpvar_27.w);
136  highp vec3 tmpvar_57;
137  tmpvar_57 = (tmpvar_37.xyz - tmpvar_2);
138  highp float tmpvar_58;
139  tmpvar_58 = dot (tmpvar_57, tmpvar_57);
140  mediump vec4 tmpvar_59;
141  tmpvar_59.xyz = tmpvar_56.xyz;
142  tmpvar_59.w = (tmpvar_58 * tmpvar_37.w);
143  atten_47 = tmpvar_59;
144  hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
145  hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
146  hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
147  hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
148  tmpvar_3 = hybridCol_46;
149  tmpvar_1 = tmpvar_3;
150  gl_Position = (glstate_matrix_mvp * _glesVertex);
151  xlv_TEXCOORD2 = tmpvar_1;
152}
153
154
155// stats: 57 alu 8 tex 0 flow
156// inputs: 1
157//  #0: _glesVertex (high float) 4x1 [-1]
158// uniforms: 3 (total size: 0)
159//  #0: glstate_matrix_mvp (high float) 4x4 [-1]
160//  #1: _Object2World (high float) 4x4 [-1]
161//  #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1]
162// textures: 1
163//  #0: _DynLampInfo (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
r245570r245571
1#version 300 es
2in vec4 _glesVertex;
3uniform highp mat4 glstate_matrix_mvp;
4uniform highp mat4 _Object2World;
5uniform mediump vec2 _DynLampInfo_bufferSize;
6uniform sampler2D _DynLampInfo;
7out mediump vec3 xlv_TEXCOORD2;
8void main ()
9{
10  mediump vec3 tmpvar_1;
11  highp vec3 tmpvar_2;
12  tmpvar_2 = (_Object2World * _glesVertex).xyz;
13  highp vec3 tmpvar_3;
14  mediump vec3 hybridCol_4;
15  highp ivec4 tmpvar_5;
16  tmpvar_5.xyz = ivec3(tmpvar_2);
17  tmpvar_5.w = int(-(tmpvar_2.x));
18  highp vec2 tmpvar_6;
19  tmpvar_6.y = 1.0;
20  tmpvar_6.x = float(tmpvar_5.x);
21  mediump vec4 tmpvar_7;
22  mediump vec2 coord_8;
23  coord_8 = tmpvar_6;
24  mediump vec4 tmpvar_9;
25  tmpvar_9.zw = vec2(0.0, 0.0);
26  tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize);
27  lowp vec4 tmpvar_10;
28  tmpvar_10 = textureLod (_DynLampInfo, tmpvar_9.xy, 0.0);
29  tmpvar_7 = tmpvar_10;
30  highp vec2 tmpvar_11;
31  tmpvar_11.y = 2.0;
32  tmpvar_11.x = float(tmpvar_5.x);
33  mediump vec4 tmpvar_12;
34  mediump vec2 coord_13;
35  coord_13 = tmpvar_11;
36  mediump vec4 tmpvar_14;
37  tmpvar_14.zw = vec2(0.0, 0.0);
38  tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize);
39  lowp vec4 tmpvar_15;
40  tmpvar_15 = textureLod (_DynLampInfo, tmpvar_14.xy, 0.0);
41  tmpvar_12 = tmpvar_15;
42  highp vec2 tmpvar_16;
43  tmpvar_16.y = 1.0;
44  tmpvar_16.x = float(tmpvar_5.y);
45  mediump vec4 tmpvar_17;
46  mediump vec2 coord_18;
47  coord_18 = tmpvar_16;
48  mediump vec4 tmpvar_19;
49  tmpvar_19.zw = vec2(0.0, 0.0);
50  tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize);
51  lowp vec4 tmpvar_20;
52  tmpvar_20 = textureLod (_DynLampInfo, tmpvar_19.xy, 0.0);
53  tmpvar_17 = tmpvar_20;
54  highp vec2 tmpvar_21;
55  tmpvar_21.y = 2.0;
56  tmpvar_21.x = float(tmpvar_5.y);
57  mediump vec4 tmpvar_22;
58  mediump vec2 coord_23;
59  coord_23 = tmpvar_21;
60  mediump vec4 tmpvar_24;
61  tmpvar_24.zw = vec2(0.0, 0.0);
62  tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize);
63  lowp vec4 tmpvar_25;
64  tmpvar_25 = textureLod (_DynLampInfo, tmpvar_24.xy, 0.0);
65  tmpvar_22 = tmpvar_25;
66  highp vec2 tmpvar_26;
67  tmpvar_26.y = 1.0;
68  tmpvar_26.x = float(tmpvar_5.z);
69  mediump vec4 tmpvar_27;
70  mediump vec2 coord_28;
71  coord_28 = tmpvar_26;
72  mediump vec4 tmpvar_29;
73  tmpvar_29.zw = vec2(0.0, 0.0);
74  tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize);
75  lowp vec4 tmpvar_30;
76  tmpvar_30 = textureLod (_DynLampInfo, tmpvar_29.xy, 0.0);
77  tmpvar_27 = tmpvar_30;
78  highp vec2 tmpvar_31;
79  tmpvar_31.y = 2.0;
80  tmpvar_31.x = float(tmpvar_5.z);
81  mediump vec4 tmpvar_32;
82  mediump vec2 coord_33;
83  coord_33 = tmpvar_31;
84  mediump vec4 tmpvar_34;
85  tmpvar_34.zw = vec2(0.0, 0.0);
86  tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize);
87  lowp vec4 tmpvar_35;
88  tmpvar_35 = textureLod (_DynLampInfo, tmpvar_34.xy, 0.0);
89  tmpvar_32 = tmpvar_35;
90  highp vec2 tmpvar_36;
91  tmpvar_36.y = 1.0;
92  tmpvar_36.x = float(tmpvar_5.w);
93  mediump vec4 tmpvar_37;
94  mediump vec2 coord_38;
95  coord_38 = tmpvar_36;
96  mediump vec4 tmpvar_39;
97  tmpvar_39.zw = vec2(0.0, 0.0);
98  tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize);
99  lowp vec4 tmpvar_40;
100  tmpvar_40 = textureLod (_DynLampInfo, tmpvar_39.xy, 0.0);
101  tmpvar_37 = tmpvar_40;
102  highp vec2 tmpvar_41;
103  tmpvar_41.y = 2.0;
104  tmpvar_41.x = float(tmpvar_5.w);
105  mediump vec4 tmpvar_42;
106  mediump vec2 coord_43;
107  coord_43 = tmpvar_41;
108  mediump vec4 tmpvar_44;
109  tmpvar_44.zw = vec2(0.0, 0.0);
110  tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize);
111  lowp vec4 tmpvar_45;
112  tmpvar_45 = textureLod (_DynLampInfo, tmpvar_44.xy, 0.0);
113  tmpvar_42 = tmpvar_45;
114  mediump vec3 hybridCol_46;
115  mediump vec4 atten_47;
116  highp vec3 tmpvar_48;
117  tmpvar_48 = (tmpvar_7.xyz - tmpvar_2);
118  highp float tmpvar_49;
119  tmpvar_49 = dot (tmpvar_48, tmpvar_48);
120  mediump vec4 tmpvar_50;
121  tmpvar_50.yzw = atten_47.yzw;
122  tmpvar_50.x = (tmpvar_49 * tmpvar_7.w);
123  highp vec3 tmpvar_51;
124  tmpvar_51 = (tmpvar_17.xyz - tmpvar_2);
125  highp float tmpvar_52;
126  tmpvar_52 = dot (tmpvar_51, tmpvar_51);
127  mediump vec4 tmpvar_53;
128  tmpvar_53.xzw = tmpvar_50.xzw;
129  tmpvar_53.y = (tmpvar_52 * tmpvar_17.w);
130  highp vec3 tmpvar_54;
131  tmpvar_54 = (tmpvar_27.xyz - tmpvar_2);
132  highp float tmpvar_55;
133  tmpvar_55 = dot (tmpvar_54, tmpvar_54);
134  mediump vec4 tmpvar_56;
135  tmpvar_56.xyw = tmpvar_53.xyw;
136  tmpvar_56.z = (tmpvar_55 * tmpvar_27.w);
137  highp vec3 tmpvar_57;
138  tmpvar_57 = (tmpvar_37.xyz - tmpvar_2);
139  highp float tmpvar_58;
140  tmpvar_58 = dot (tmpvar_57, tmpvar_57);
141  mediump vec4 tmpvar_59;
142  tmpvar_59.xyz = tmpvar_56.xyz;
143  tmpvar_59.w = (tmpvar_58 * tmpvar_37.w);
144  atten_47 = tmpvar_59;
145  hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
146  hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
147  hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
148  hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
149  tmpvar_3 = hybridCol_46;
150  tmpvar_1 = tmpvar_3;
151  gl_Position = (glstate_matrix_mvp * _glesVertex);
152  xlv_TEXCOORD2 = tmpvar_1;
153}
154
155
156// stats: 57 alu 8 tex 0 flow
157// inputs: 1
158//  #0: _glesVertex (high float) 4x1 [-1]
159// uniforms: 3 (total size: 0)
160//  #0: glstate_matrix_mvp (high float) 4x4 [-1]
161//  #1: _Object2World (high float) 4x4 [-1]
162//  #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1]
163// textures: 1
164//  #0: _DynLampInfo (low 2d) 0x0 [-1]
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
r245570r245571
1#include <metal_stdlib>
2using namespace metal;
3struct xlatMtlShaderInput {
4  float4 _glesVertex [[attribute(0)]];
5};
6struct xlatMtlShaderOutput {
7  float4 gl_Position [[position]];
8  half3 xlv_TEXCOORD2;
9};
10struct xlatMtlShaderUniform {
11  float4x4 glstate_matrix_mvp;
12  float4x4 _Object2World;
13  half2 _DynLampInfo_bufferSize;
14};
15vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
16  ,   texture2d<half> _DynLampInfo [[texture(0)]], sampler _mtlsmp__DynLampInfo [[sampler(0)]])
17{
18  xlatMtlShaderOutput _mtl_o;
19  half3 tmpvar_1;
20  float3 tmpvar_2;
21  tmpvar_2 = (_mtl_u._Object2World * _mtl_i._glesVertex).xyz;
22  float3 tmpvar_3;
23  half3 hybridCol_4;
24  int4 tmpvar_5;
25  tmpvar_5.xyz = int3(tmpvar_2);
26  tmpvar_5.w = int(-(tmpvar_2.x));
27  float2 tmpvar_6;
28  tmpvar_6.y = 1.0;
29  tmpvar_6.x = float(tmpvar_5.x);
30  half4 tmpvar_7;
31  half2 coord_8;
32  coord_8 = half2(tmpvar_6);
33  half4 tmpvar_9;
34  tmpvar_9.zw = half2(float2(0.0, 0.0));
35  tmpvar_9.xy = (coord_8 / _mtl_u._DynLampInfo_bufferSize);
36  half4 tmpvar_10;
37  tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_9.xy), level(0.0));
38  tmpvar_7 = tmpvar_10;
39  float2 tmpvar_11;
40  tmpvar_11.y = 2.0;
41  tmpvar_11.x = float(tmpvar_5.x);
42  half4 tmpvar_12;
43  half2 coord_13;
44  coord_13 = half2(tmpvar_11);
45  half4 tmpvar_14;
46  tmpvar_14.zw = half2(float2(0.0, 0.0));
47  tmpvar_14.xy = (coord_13 / _mtl_u._DynLampInfo_bufferSize);
48  half4 tmpvar_15;
49  tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_14.xy), level(0.0));
50  tmpvar_12 = tmpvar_15;
51  float2 tmpvar_16;
52  tmpvar_16.y = 1.0;
53  tmpvar_16.x = float(tmpvar_5.y);
54  half4 tmpvar_17;
55  half2 coord_18;
56  coord_18 = half2(tmpvar_16);
57  half4 tmpvar_19;
58  tmpvar_19.zw = half2(float2(0.0, 0.0));
59  tmpvar_19.xy = (coord_18 / _mtl_u._DynLampInfo_bufferSize);
60  half4 tmpvar_20;
61  tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_19.xy), level(0.0));
62  tmpvar_17 = tmpvar_20;
63  float2 tmpvar_21;
64  tmpvar_21.y = 2.0;
65  tmpvar_21.x = float(tmpvar_5.y);
66  half4 tmpvar_22;
67  half2 coord_23;
68  coord_23 = half2(tmpvar_21);
69  half4 tmpvar_24;
70  tmpvar_24.zw = half2(float2(0.0, 0.0));
71  tmpvar_24.xy = (coord_23 / _mtl_u._DynLampInfo_bufferSize);
72  half4 tmpvar_25;
73  tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_24.xy), level(0.0));
74  tmpvar_22 = tmpvar_25;
75  float2 tmpvar_26;
76  tmpvar_26.y = 1.0;
77  tmpvar_26.x = float(tmpvar_5.z);
78  half4 tmpvar_27;
79  half2 coord_28;
80  coord_28 = half2(tmpvar_26);
81  half4 tmpvar_29;
82  tmpvar_29.zw = half2(float2(0.0, 0.0));
83  tmpvar_29.xy = (coord_28 / _mtl_u._DynLampInfo_bufferSize);
84  half4 tmpvar_30;
85  tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_29.xy), level(0.0));
86  tmpvar_27 = tmpvar_30;
87  float2 tmpvar_31;
88  tmpvar_31.y = 2.0;
89  tmpvar_31.x = float(tmpvar_5.z);
90  half4 tmpvar_32;
91  half2 coord_33;
92  coord_33 = half2(tmpvar_31);
93  half4 tmpvar_34;
94  tmpvar_34.zw = half2(float2(0.0, 0.0));
95  tmpvar_34.xy = (coord_33 / _mtl_u._DynLampInfo_bufferSize);
96  half4 tmpvar_35;
97  tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_34.xy), level(0.0));
98  tmpvar_32 = tmpvar_35;
99  float2 tmpvar_36;
100  tmpvar_36.y = 1.0;
101  tmpvar_36.x = float(tmpvar_5.w);
102  half4 tmpvar_37;
103  half2 coord_38;
104  coord_38 = half2(tmpvar_36);
105  half4 tmpvar_39;
106  tmpvar_39.zw = half2(float2(0.0, 0.0));
107  tmpvar_39.xy = (coord_38 / _mtl_u._DynLampInfo_bufferSize);
108  half4 tmpvar_40;
109  tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_39.xy), level(0.0));
110  tmpvar_37 = tmpvar_40;
111  float2 tmpvar_41;
112  tmpvar_41.y = 2.0;
113  tmpvar_41.x = float(tmpvar_5.w);
114  half4 tmpvar_42;
115  half2 coord_43;
116  coord_43 = half2(tmpvar_41);
117  half4 tmpvar_44;
118  tmpvar_44.zw = half2(float2(0.0, 0.0));
119  tmpvar_44.xy = (coord_43 / _mtl_u._DynLampInfo_bufferSize);
120  half4 tmpvar_45;
121  tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_44.xy), level(0.0));
122  tmpvar_42 = tmpvar_45;
123  half3 hybridCol_46;
124  half4 atten_47;
125  float3 tmpvar_48;
126  tmpvar_48 = ((float3)tmpvar_7.xyz - tmpvar_2);
127  float tmpvar_49;
128  tmpvar_49 = dot (tmpvar_48, tmpvar_48);
129  half4 tmpvar_50;
130  tmpvar_50.yzw = atten_47.yzw;
131  tmpvar_50.x = half((tmpvar_49 * (float)tmpvar_7.w));
132  float3 tmpvar_51;
133  tmpvar_51 = ((float3)tmpvar_17.xyz - tmpvar_2);
134  float tmpvar_52;
135  tmpvar_52 = dot (tmpvar_51, tmpvar_51);
136  half4 tmpvar_53;
137  tmpvar_53.xzw = tmpvar_50.xzw;
138  tmpvar_53.y = half((tmpvar_52 * (float)tmpvar_17.w));
139  float3 tmpvar_54;
140  tmpvar_54 = ((float3)tmpvar_27.xyz - tmpvar_2);
141  float tmpvar_55;
142  tmpvar_55 = dot (tmpvar_54, tmpvar_54);
143  half4 tmpvar_56;
144  tmpvar_56.xyw = tmpvar_53.xyw;
145  tmpvar_56.z = half((tmpvar_55 * (float)tmpvar_27.w));
146  float3 tmpvar_57;
147  tmpvar_57 = ((float3)tmpvar_37.xyz - tmpvar_2);
148  float tmpvar_58;
149  tmpvar_58 = dot (tmpvar_57, tmpvar_57);
150  half4 tmpvar_59;
151  tmpvar_59.xyz = tmpvar_56.xyz;
152  tmpvar_59.w = half((tmpvar_58 * (float)tmpvar_37.w));
153  atten_47 = tmpvar_59;
154  hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
155  hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
156  hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
157  hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
158  tmpvar_3 = float3(hybridCol_46);
159  tmpvar_1 = half3(tmpvar_3);
160  _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
161  _mtl_o.xlv_TEXCOORD2 = tmpvar_1;
162  return _mtl_o;
163}
164
165
166// stats: 57 alu 8 tex 0 flow
167// inputs: 1
168//  #0: _glesVertex (high float) 4x1 [-1] loc 0
169// uniforms: 3 (total size: 132)
170//  #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
171//  #1: _Object2World (high float) 4x4 [-1] loc 64
172//  #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1] loc 128
173// textures: 1
174//  #0: _DynLampInfo (low 2d) 0x0 [-1] loc 0
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt
r245570r245571
103103  tmpvar_6.xyz = normalize(tmpvar_14.xyz);
104104  binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w);
105105  highp mat3 tmpvar_27;
106  tmpvar_27[uint(0)].x = tmpvar_6.x;
107  tmpvar_27[uint(0)].y = binormal_4.x;
108  tmpvar_27[uint(0)].z = tmpvar_26.x;
106  tmpvar_27[0u].x = tmpvar_6.x;
107  tmpvar_27[0u].y = binormal_4.x;
108  tmpvar_27[0u].z = tmpvar_26.x;
109109  tmpvar_27[1u].x = tmpvar_6.y;
110110  tmpvar_27[1u].y = binormal_4.y;
111111  tmpvar_27[1u].z = tmpvar_26.y;
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt
r245570r245571
6868  ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841));
6969  s_11 = (s_15 * s_15);
7070  s_11 = (s_11 * s_11);
71  lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
71  lighting_10 = (dot (s_11, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
7272  s_11 = (s_11 * TANGENT.y);
7373  waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096));
7474  waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt
r245570r245571
5353  ) + (r2_14 * 0.0083333)) + ((r2_14 * r5_16) * -0.00019841));
5454  s_9 = (s_13 * s_13);
5555  s_9 = (s_9 * s_9);
56  lighting_8 = (dot (s_9, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
56  lighting_8 = (dot (s_9, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
5757  s_9 = (s_9 * TANGENT.y);
5858  waveMove_7.x = dot (s_9, vec4(0.024, 0.04, -0.12, 0.096));
5959  waveMove_7.z = dot (s_9, vec4(0.006, 0.02, -0.02, 0.1));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt
r245570r245571
5151  ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841));
5252  s_11 = (s_15 * s_15);
5353  s_11 = (s_11 * s_11);
54  lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
54  lighting_10 = (dot (s_11, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
5555  s_11 = (s_11 * TANGENT.y);
5656  waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096));
5757  waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1));
trunk/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
r245570r245571
3636  ) + (r2_10 * 0.0083333)) + ((r2_10 * r5_12) * -0.00019841));
3737  s_5 = (s_9 * s_9);
3838  s_5 = (s_5 * s_5);
39  lighting_4 = (dot (s_5, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
39  lighting_4 = (dot (s_5, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
4040  s_5 = (s_5 * (gl_Color.w * _WaveAndDistance.z));
4141  waveMove_3.x = dot (s_5, vec4(0.024, 0.04, -0.12, 0.096));
4242  waveMove_3.z = dot (s_5, vec4(0.006, 0.02, -0.02, 0.1));
trunk/3rdparty/bgfx/3rdparty/khronos/gl/glext.h
r245570r245571
465465#ifndef GL_VERSION_1_5
466466#define GL_VERSION_1_5 1
467467#include <stddef.h>
468#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1090)
468#if 0 //defined(__APPLE__) && defined(__i386__)
469469typedef long GLsizeiptr;
470470typedef long GLintptr;
471471#else
r245570r245571
41354135
41364136#ifndef GL_ARB_vertex_buffer_object
41374137#define GL_ARB_vertex_buffer_object 1
4138#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1090)
4138#if 0 // defined(__APPLE__) && defined(__i386__)
41394139typedef long GLsizeiptrARB;
41404140typedef long GLintptrARB;
41414141#else
trunk/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
r245570r245571
4444typedef int ImGuiWindowFlags;       // enum ImGuiWindowFlags_
4545typedef int ImGuiSetCond;           // enum ImGuiSetCondition_
4646typedef int ImGuiInputTextFlags;    // enum ImGuiInputTextFlags_
47struct ImGuiTextEditCallbackData;   // for advanced uses of InputText()
47struct ImGuiTextEditCallbackData;   // for advanced uses of InputText()
4848typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
4949
5050struct ImVec2
r245570r245571
7676    IMGUI_API void        MemFree(void* ptr);
7777}
7878
79// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
79// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
8080// Use '#define ImVector std::vector' if you want to use the STL type or your own type.
8181// Our implementation does NOT call c++ constructors! because the data types we use don't need them (but that could be added as well). Only provide the minimum functionalities we need.
8282#ifndef ImVector
r245570r245571
117117    inline void                 swap(ImVector<T>& rhs)          { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
118118
119119    inline void                 resize(size_t new_size)         { if (new_size > Capacity) reserve(new_size); Size = new_size; }
120    inline void                 reserve(size_t new_capacity)
121    {
120    inline void                 reserve(size_t new_capacity)   
121    {
122122        if (new_capacity <= Capacity) return;
123123        T* new_data = (value_type*)ImGui::MemAlloc(new_capacity * sizeof(value_type));
124124        memcpy(new_data, Data, Size * sizeof(value_type));
125125        ImGui::MemFree(Data);
126126        Data = new_data;
127        Capacity = new_capacity;
127        Capacity = new_capacity;
128128    }
129129
130130    inline void                 push_back(const value_type& v)  { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
r245570r245571
262262    IMGUI_API void          TextWrapped(const char* fmt, ...);                                  // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
263263    IMGUI_API void          TextWrappedV(const char* fmt, va_list args);
264264    IMGUI_API void          TextUnformatted(const char* text, const char* text_end = NULL);     // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text.
265    IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets
265    IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets
266266    IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args);
267267    IMGUI_API void          Bullet();
268268    IMGUI_API void          BulletText(const char* fmt, ...);
r245570r245571
343343    // Utilities
344344    IMGUI_API bool          IsItemHovered();                                                    // was the last item hovered by mouse?
345345    IMGUI_API bool          IsItemActive();                                                     // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
346    IMGUI_API bool          IsAnyItemActive();                                                  //
346    IMGUI_API bool          IsAnyItemActive();                                                  //
347347    IMGUI_API ImVec2        GetItemBoxMin();                                                    // get bounding box of last item
348348    IMGUI_API ImVec2        GetItemBoxMax();                                                    // get bounding box of last item
349349    IMGUI_API bool          IsClipped(const ImVec2& item_size);                                 // to perform coarse clipping on user's side (as an optimization)
r245570r245571
569569    // User Functions
570570    //------------------------------------------------------------------
571571
572    // REQUIRED: rendering function.
572    // REQUIRED: rendering function.
573573    // See example code if you are unsure of how to implement this.
574    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
574    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);     
575575
576576    // Optional: access OS clipboard
577577    // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
r245570r245571
594594
595595    ImVec2      MousePos;                   // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
596596    bool        MouseDown[5];               // Mouse buttons. ImGui itself only uses button 0 (left button). Others buttons allows to track if mouse is being used by your application + available to user as a convenience via IsMouse** API.
597    float       MouseWheel;                 // Mouse wheel: 1 unit scrolls about 5 lines text.
597    float       MouseWheel;                 // Mouse wheel: 1 unit scrolls about 5 lines text.
598598    bool        MouseDrawCursor;            // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
599599    bool        KeyCtrl;                    // Keyboard modifier pressed: Control
600600    bool        KeyShift;                   // Keyboard modifier pressed: Shift
r245570r245571
706706// - You want to store custom debug data easily without adding or editing structures in your code.
707707struct ImGuiStorage
708708{
709    struct Pair
710    {
711        ImGuiID key;
712        union { int val_i; float val_f; void* val_p; };
713        Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
714        Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
715        Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
709    struct Pair
710    {
711        ImGuiID key;
712        union { int val_i; float val_f; void* val_p; };       
713        Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
714        Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
715        Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
716716    };
717717    ImVector<Pair>    Data;
718718
r245570r245571
727727    IMGUI_API void*   GetVoidPtr(ImGuiID key) const; // default_val is NULL
728728    IMGUI_API void    SetVoidPtr(ImGuiID key, void* val);
729729
730    // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
730    // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
731731    // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
732732    // - A typical use case where this is convenient:
733733    //      float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar;
r245570r245571
833833
834834    // [Internal to ImGui]
835835    ImVector<ImVec4>        clip_rect_stack;    // [Internal]
836    ImVector<ImTextureID>   texture_id_stack;   // [Internal]
836    ImVector<ImTextureID>   texture_id_stack;   // [Internal]
837837    ImDrawVert*             vtx_write;          // [Internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
838838
839839    ImDrawList() { Clear(); }
r245570r245571
843843    IMGUI_API void  PushTextureID(const ImTextureID& texture_id);
844844    IMGUI_API void  PopTextureID();
845845
846    // Primitives
846    // Primitives   
847847    IMGUI_API void  AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
848848    IMGUI_API void  AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
849849    IMGUI_API void  AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
trunk/3rdparty/bgfx/3rdparty/sdf/sdf.h
r245570r245571
9292      } else if (a < (1.0-a1)) { // a1 <= a <= 1-a1
9393         df = (0.5f-a)*gx;
9494      } else { // 1-a1 < a <= 1
95         df = -0.5f*(gx + gy) + sqrtf(2.0f*gx*gy*(1.0f-a));
95         df = -0.5f*(gx + gy) + sqrt(2.0f*gx*gy*(1.0f-a));
9696      }
9797   }   
9898   return df;
trunk/3rdparty/bgfx/3rdparty/stb/stb_image.c
r245570r245571
187187
188188#ifndef STBI_NO_STDIO
189189
190#if defined(_MSC_VER) && _MSC_VER >= 1400
191#   if !defined(_CRT_SECURE_NO_WARNINGS)
192#      define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
193#   endif
194#   pragma warning(push)
195#   pragma warning(disable:4996)   // suppress even more warnings about fopen()
196#   pragma warning(disable:4312)   // warning C4312: 'type cast': conversion from 'int' to 'unsigned char *' of greater size
197#   pragma warning(disable:4456)   // warning C4456: declaration of 'k' hides previous local declaration
198#   pragma warning(disable:4457)   // warning C4457: declaration of 'y' hides function parameter
190#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_CRT_SECURE_NO_WARNINGS)
191#define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
192#pragma warning(push)
193#pragma warning(disable:4996)   // suppress even more warnings about fopen()
199194#endif
200195#include <stdio.h>
201196#endif // STBI_NO_STDIO
r245570r245571
32543249   unsigned char *tga_data;
32553250   unsigned char *tga_palette = NULL;
32563251   int i, j;
3257   unsigned char raw_data[4] = {};
3252   unsigned char raw_data[4];
32583253   int RLE_count = 0;
32593254   int RLE_repeating = 0;
32603255   int read_next_pixel = 1;
trunk/3rdparty/bgfx/README.md
r245570r245571
309309
310310![example-24-nbody](https://github.com/bkaradzic/bgfx/raw/master/examples/24-nbody/screenshot.png)
311311
312### [25-c99](https://github.com/bkaradzic/bgfx/tree/master/examples/25-c99)
313
314Initialization and debug text with C99 API.
315
316312Dependencies
317313------------
318314
trunk/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
r245570r245571
1static const uint8_t fs_metaballs_glsl[398] =
1static const uint8_t fs_metaballs_glsl[393] =
22{
3   0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?......va
3   0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?..z...va
44   0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
55   0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, //  v_color0;.varyi
66   0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, // ng highp vec3 v_
r245570r245571
1010   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, //  tmpvar_1 = dot
1111   0x28, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // (normalize(v_nor
1212   0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, // mal), vec3(0.0,
13   0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, // 0.0, -1.0));.  m
14   0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // ediump vec4 tmpv
15   0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // ar_2;.  tmpvar_2
16   0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .w = 1.0;.  tmpv
17   0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, // ar_2.xyz = pow (
18   0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, // ((.    pow (v_co
19   0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, // lor0.xyz, vec3(2
20   0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, // .2, 2.2, 2.2)).
21   0x20, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, //   * tmpvar_1) +
22   0x70, 0x6f, 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, // pow (tmpvar_1, 3
23   0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, // 0.0)), vec3(0.45
24   0x34, 0x35, 0x34, 0x35, 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, // 45454, 0.4545454
25   0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, 0x29, 0x29, 0x3b, 0x0a, 0x20, // , 0.4545454));.
26   0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, //  gl_FragColor =
27   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,             // tmpvar_2;.}...
13   0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // 0.0, -1.0));.  h
14   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ighp vec4 tmpvar
15   0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, // _2;.  tmpvar_2.w
16   0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, //  = 1.0;.  tmpvar
17   0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, 0x28, // _2.xyz = pow (((
18   0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // .    pow (v_colo
19   0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, 0x2e, 0x32, // r0.xyz, vec3(2.2
20   0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // , 2.2, 2.2)).   
21   0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, // * tmpvar_1) + po
22   0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, // w (tmpvar_1, 30.
23   0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, // 0)), vec3(0.4545
24   0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, // 45, 0.454545, 0.
25   0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // 454545));.  gl_F
26   0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
27   0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                           // r_2;.}...
2828};
2929static const uint8_t fs_metaballs_dx9[429] =
3030{
trunk/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
r245570r245571
592592      float sphere[numSpheres][4];
593593      for (uint32_t ii = 0; ii < numSpheres; ++ii)
594594      {
595         sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f);
596         sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f);
597         sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f);
598         sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f);
595         sphere[ii][0] = sin(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f);
596         sphere[ii][1] = sin(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f);
597         sphere[ii][2] = cos(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f);
598         sphere[ii][3] = 1.0f/(2.0f + (sin(time*(ii*0.13f) )*0.5f+0.5f)*2.0f);
599599      }
600600
601601      profUpdate = bx::getHPCounter();
trunk/3rdparty/bgfx/examples/05-instancing/instancing.cpp
r245570r245571
182182                  mtx[14] = 0.0f;
183183
184184                  float* color = (float*)&data[64];
185                  color[0] = sinf(time+float(xx)/11.0f)*0.5f+0.5f;
186                  color[1] = cosf(time+float(yy)/11.0f)*0.5f+0.5f;
187                  color[2] = sinf(time*3.0f)*0.5f+0.5f;
185                  color[0] = sin(time+float(xx)/11.0f)*0.5f+0.5f;
186                  color[1] = cos(time+float(yy)/11.0f)*0.5f+0.5f;
187                  color[2] = sin(time*3.0f)*0.5f+0.5f;
188188                  color[3] = 1.0f;
189189
190190                  data += instanceStride;
trunk/3rdparty/bgfx/examples/06-bump/bump.cpp
r245570r245571
192192
193193      float at[3]  = { 0.0f, 0.0f,  0.0f };
194194      float eye[3] = { 0.0f, 0.0f, -7.0f };
195
195     
196196      // Set view and projection matrix for view 0.
197197      const bgfx::HMD* hmd = bgfx::getHMD();
198198      if (NULL != hmd)
r245570r245571
227227      float lightPosRadius[4][4];
228228      for (uint32_t ii = 0; ii < numLights; ++ii)
229229      {
230         lightPosRadius[ii][0] = sinf( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f;
231         lightPosRadius[ii][1] = cosf( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f;
230         lightPosRadius[ii][0] = sin( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f;
231         lightPosRadius[ii][1] = cos( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f;
232232         lightPosRadius[ii][2] = -2.5f;
233233         lightPosRadius[ii][3] = 3.0f;
234234      }
r245570r245571
338338         }
339339      }
340340
341      // Advance to next frame. Rendering thread will be kicked to
341      // Advance to next frame. Rendering thread will be kicked to
342342      // process submitted rendering primitives.
343343      bgfx::frame();
344344   }
trunk/3rdparty/bgfx/examples/07-callback/callback.cpp
r245570r245571
372372
373373   bgfx::init(
374374        renderers[bx::getHPCounter() % numRenderers] /* randomize renderer */
375      , BGFX_PCI_ID_NONE
376      , 0
377375      , &callback  // custom callback handler
378376      , &allocator // custom allocator
379377      );
r245570r245571
444442
445443      float at[3] = { 0.0f, 0.0f, 0.0f };
446444      float eye[3] = { 0.0f, 0.0f, -35.0f };
447
445     
448446      float view[16];
449447      float proj[16];
450448      bx::mtxLookAt(view, eye, at);
r245570r245571
490488         bgfx::saveScreenShot("temp/frame150");
491489      }
492490
493      // Advance to next frame. Rendering thread will be kicked to
491      // Advance to next frame. Rendering thread will be kicked to
494492      // process submitted rendering primitives.
495493      bgfx::frame();
496494   }
trunk/3rdparty/bgfx/examples/08-update/update.cpp
r245570r245571
167167      }
168168   }
169169
170   const bgfx::Caps* caps = bgfx::getCaps();
171   const bool texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D);
172
173   uint32_t numTextures3d = 0;
174   bgfx::TextureHandle textures3d[3] = {};
175
176   if (texture3DSupported)
170   bgfx::TextureHandle textures3d[] =
177171   {
178      if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R8]) )
179      {
180         textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8,   BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8);
181      }
172      bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8,   BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8),
173      bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f),
174      bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f),
175   };
182176
183      if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R16F]) )
184      {
185         textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f);
186      }
187
188      if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R32F]) )
189      {
190         textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f);
191      }
192   }
193
194177   // Create static vertex buffer.
195178   bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) ), PosTexcoordVertex::ms_decl);
196179
r245570r245571
205188
206189   bgfx::ProgramHandle program     = loadProgram("vs_update", "fs_update");
207190   bgfx::ProgramHandle programCmp  = loadProgram("vs_update", "fs_update_cmp");
208   bgfx::ProgramHandle program3d   = BGFX_INVALID_HANDLE;
209   if (texture3DSupported)
210   {
211      program3d = loadProgram("vs_update", "fs_update_3d");
212   }
191   bgfx::ProgramHandle program3d   = loadProgram("vs_update", "fs_update_3d");
213192
214193   const uint32_t textureSide = 2048;
215194
r245570r245571
292271
293272            for (uint32_t ii = 0, num = bx::uint32_min(10, (uint32_t)quads.size() ); ii < num; ++ii)
294273            {
295               cube.clear(quads.front() );
274               const PackCube& face = quads.front();
275               cube.clear(face);
296276               quads.pop_front();
297277            }
298278         }
r245570r245571
419399         bgfx::submit(1);
420400      }
421401
422      for (uint32_t ii = 0; ii < numTextures3d; ++ii)
402      for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii)
423403      {
424404         bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f);
425405
r245570r245571
485465      bgfx::destroyTexture(textures[ii]);
486466   }
487467
488   for (uint32_t ii = 0; ii < numTextures3d; ++ii)
468   for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii)
489469   {
490470      bgfx::destroyTexture(textures3d[ii]);
491471   }
r245570r245571
494474   bgfx::destroyTexture(textureCube);
495475   bgfx::destroyIndexBuffer(ibh);
496476   bgfx::destroyVertexBuffer(vbh);
497   if (bgfx::isValid(program3d) )
498   {
499      bgfx::destroyProgram(program3d);
500   }
477   bgfx::destroyProgram(program3d);
501478   bgfx::destroyProgram(programCmp);
502479   bgfx::destroyProgram(program);
503480   bgfx::destroyUniform(u_time);
trunk/3rdparty/bgfx/examples/09-hdr/hdr.cpp
r245570r245571
174174   bgfx::setViewName(8, "Blur vertical");
175175   bgfx::setViewName(9, "Blur horizontal + tonemap");
176176
177   bgfx::TextureHandle uffizi = loadTexture("uffizi.dds"
178         , 0
179         | BGFX_TEXTURE_U_CLAMP
180         | BGFX_TEXTURE_V_CLAMP
181         | BGFX_TEXTURE_W_CLAMP
182         );
177   bgfx::TextureHandle uffizi = loadTexture("uffizi.dds", BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP);
183178
184179   bgfx::ProgramHandle skyProgram     = loadProgram("vs_hdr_skybox",  "fs_hdr_skybox");
185180   bgfx::ProgramHandle lumProgram     = loadProgram("vs_hdr_lum",     "fs_hdr_lum");
r245570r245571
376371
377372      // Render skybox into view 0.
378373      bgfx::setTexture(0, u_texCube, uffizi);
379
380374      bgfx::setProgram(skyProgram);
381375      bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
382376      screenSpaceQuad( (float)width, (float)height, true);
trunk/3rdparty/bgfx/examples/12-lod/lod.cpp
r245570r245571
2020   {0,0}, {1,2}, {3,3}, {4,1}, {5,3}, {7,2}, {6,0}, {5,2},
2121   {7,3}, {6,1}, {4,0}, {3,2}, {2,0}, {0,1}, {1,3}, {2,1},
2222   {0,2}, {1,0}, {2,2}, {0,3}, {1,1}, {3,0}, {4,2}, {5,0},
23   {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3},
23   {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3}
2424};
2525
2626int _main_(int /*_argc*/, char** /*_argv*/)
r245570r245571
5555
5656   bgfx::TextureHandle textureStipple;
5757
58   const bgfx::Memory* stippleTex = bgfx::alloc(8*4);
59   memset(stippleTex->data, 0, stippleTex->size);
58   const bgfx::Memory* stipple = bgfx::alloc(8*4);
59   memset(stipple->data, 0, stipple->size);
6060
6161   for (uint32_t ii = 0; ii < 32; ++ii)
6262   {
63      stippleTex->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4;
63      stipple->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4;
6464   }
6565
66   textureStipple = bgfx::createTexture2D(8, 4, 1
67         , bgfx::TextureFormat::R8
68         , BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT
69         , stippleTex
70         );
66   textureStipple = bgfx::createTexture2D(8, 4, 1, bgfx::TextureFormat::R8, BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT, stipple);
7167
7268   Mesh* meshTop[3] =
7369   {
trunk/3rdparty/bgfx/examples/13-stencil/stencil.cpp
r245570r245571
10401040      const float radius = (scene == StencilReflectionScene) ? 15.0f : 25.0f;
10411041      for (uint8_t ii = 0; ii < numLights; ++ii)
10421042      {
1043         lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f;
1044         lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f;
1045         lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f;
1043         lightPosRadius[ii][0] = sin( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f;
1044         lightPosRadius[ii][1] = 8.0f + (1.0f - cos( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f;
1045         lightPosRadius[ii][2] = cos( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f;
10461046         lightPosRadius[ii][3] = radius;
10471047      }
10481048      memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
r245570r245571
11121112            , 0.0f
11131113            , 0.0f
11141114            , 0.0f
1115            , sinf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f
1115            , sin(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f
11161116            , 4.0f
1117            , cosf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f
1117            , cos(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f
11181118            );
11191119      }
11201120
r245570r245571
11881188
11891189            // Set lights back.
11901190            memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
1191
11911192            // Third pass - Blend plane.
11921193
11931194            // Floor.
r245570r245571
12161217                  , s_renderStates[RenderState::StencilReflection_DrawScene]
12171218                  );
12181219            }
1219
12201220         }
12211221         break;
12221222
r245570r245571
13191319                  );
13201320
13211321               // Cubes.
1322               for (uint8_t jj = 0; jj < numCubes; ++jj)
1322               for (uint8_t ii = 0; ii < numCubes; ++ii)
13231323               {
13241324                  cubeMesh.submit(viewId
1325                     , cubeMtx[jj]
1325                     , cubeMtx[ii]
13261326                     , programTextureLightning
13271327                     , s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
13281328                     , figureTex
trunk/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
r245570r245571
675675         m_offsets[ii] = uint32_t(he - m_data);
676676
677677         std::vector<uint16_t>& row = edges[ii];
678         for (uint32_t jj = 0, size = (uint32_t)row.size(); jj < size; ++jj)
678         for (uint32_t jj = 0, end = (uint32_t)row.size(); jj < end; ++jj)
679679         {
680680            he->m_secondIndex = row[jj];
681681            he->m_marked = false;
r245570r245571
880880      for (uint32_t ii = 0, size = m_numIndices/3; ii < size; ++ii)
881881      {
882882         const uint16_t* indices = &m_indices[ii*3];
883         uint16_t i0 = indices[0];
884         uint16_t i1 = indices[1];
885         uint16_t i2 = indices[2];
883         const uint16_t i0 = indices[0];
884         const uint16_t i1 = indices[1];
885         const uint16_t i2 = indices[2];
886886         const float* v0 = (float*)&m_vertices[i0*stride];
887887         const float* v1 = (float*)&m_vertices[i1*stride];
888888         const float* v2 = (float*)&m_vertices[i2*stride];
r245570r245571
899899
900900         //Use unique indices for EdgeMap.
901901         const uint16_t* uindices = &uniqueIndices[ii*3];
902         i0 = uindices[0];
903         i1 = uindices[1];
904         i2 = uindices[2];
902         const uint16_t ui0 = uindices[0];
903         const uint16_t ui1 = uindices[1];
904         const uint16_t ui2 = uindices[2];
905905
906906         const uint16_t triangleEdge[3][2] =
907907         {
908            { i0, i1 },
909            { i1, i2 },
910            { i2, i0 },
908            {ui0, ui1},
909            {ui1, ui2},
910            {ui2, ui0},
911911         };
912912
913913         for (uint8_t jj = 0; jj < 3; ++jj)
r245570r245571
15111511   }
15121512   else // ShadowVolumeAlgorithm::EdgeBased:
15131513   {
1514      {
1515         uint32_t ii = 0;
1514      uint32_t ii = 0;
15161515
15171516#if SV_USE_SIMD
1518         uint32_t numEdgesRounded = numEdges & (~0x1);
1517      uint32_t numEdgesRounded = numEdges & (~0x1);
15191518
1520         using namespace bx;
1519      using namespace bx;
15211520
1522         const float4_t lx = float4_splat(_light[0]);
1523         const float4_t ly = float4_splat(_light[1]);
1524         const float4_t lz = float4_splat(_light[2]);
1521      const float4_t lx = float4_splat(_light[0]);
1522      const float4_t ly = float4_splat(_light[1]);
1523      const float4_t lz = float4_splat(_light[2]);
15251524
1526         for (; ii < numEdgesRounded; ii+=2)
1527         {
1528            const Edge& edge0 = edges[ii];
1529            const Edge& edge1 = edges[ii+1];
1530            const Plane* edgePlane0 = &edgePlanes[ii*2];
1531            const Plane* edgePlane1 = &edgePlanes[ii*2 + 2];
1525      for (; ii < numEdgesRounded; ii+=2)
1526      {
1527         const Edge& edge0 = edges[ii];
1528         const Edge& edge1 = edges[ii+1];
1529         const Plane* edgePlane0 = &edgePlanes[ii*2];
1530         const Plane* edgePlane1 = &edgePlanes[ii*2 + 2];
15321531
1533            const float4_t reverse =
1534               float4_ild(edge0.m_faceReverseOrder[0]
1535                     , edge1.m_faceReverseOrder[0]
1536                     , edge0.m_faceReverseOrder[1]
1537                     , edge1.m_faceReverseOrder[1]
1538                     );
1532         const float4_t reverse = float4_ild(edge0.m_faceReverseOrder[0]
1533                   , edge1.m_faceReverseOrder[0]
1534                   , edge0.m_faceReverseOrder[1]
1535                   , edge1.m_faceReverseOrder[1]
1536                   );
15391537
1540            const float4_t p00 = float4_ld(edgePlane0[0].m_plane);
1541            const float4_t p10 = float4_ld(edgePlane1[0].m_plane);
1542            const float4_t p01 = float4_ld(edgePlane0[1].m_plane);
1543            const float4_t p11 = float4_ld(edgePlane1[1].m_plane);
1538         const float4_t v0 = float4_ld(edgePlane0[0].m_plane);
1539         const float4_t v1 = float4_ld(edgePlane1[0].m_plane);
1540         const float4_t v2 = float4_ld(edgePlane0[1].m_plane);
1541         const float4_t v3 = float4_ld(edgePlane1[1].m_plane);
15441542
1545            const float4_t xxyy0 = float4_shuf_xAyB(p00, p01);
1546            const float4_t zzww0 = float4_shuf_zCwD(p00, p01);
1547            const float4_t xxyy1 = float4_shuf_xAyB(p10, p11);
1548            const float4_t zzww1 = float4_shuf_zCwD(p10, p11);
1543         const float4_t xxyy0 = float4_shuf_xAyB(v0, v2);
1544         const float4_t zzww0 = float4_shuf_zCwD(v0, v2);
1545         const float4_t xxyy1 = float4_shuf_xAyB(v1, v3);
1546         const float4_t zzww1 = float4_shuf_zCwD(v1, v3);
15491547
1550            const float4_t vX = float4_shuf_xAyB(xxyy0, xxyy1);
1551            const float4_t vY = float4_shuf_zCwD(xxyy0, xxyy1);
1552            const float4_t vZ = float4_shuf_xAyB(zzww0, zzww1);
1553            const float4_t vW = float4_shuf_zCwD(zzww0, zzww1);
1548         const float4_t vX = float4_shuf_xAyB(xxyy0, xxyy1);
1549         const float4_t vY = float4_shuf_zCwD(xxyy0, xxyy1);
1550         const float4_t vZ = float4_shuf_xAyB(zzww0, zzww1);
1551         const float4_t vW = float4_shuf_zCwD(zzww0, zzww1);
15541552
1555            const float4_t r0 = float4_mul(vX, lx);
1556            const float4_t r1 = float4_mul(vY, ly);
1557            const float4_t r2 = float4_mul(vZ, lz);
1553         const float4_t r0 = float4_mul(vX, lx);
1554         const float4_t r1 = float4_mul(vY, ly);
1555         const float4_t r2 = float4_mul(vZ, lz);
15581556
1559            const float4_t dot = float4_add(r0, float4_add(r1, r2));
1560            const float4_t f = float4_add(dot, vW);
1557         const float4_t dot = float4_add(r0, float4_add(r1, r2));
1558         const float4_t f = float4_add(dot, vW);
15611559
1562            const float4_t zero = float4_zero();
1563            const float4_t mask = float4_cmpgt(f, zero);
1564            const float4_t onef = float4_splat(1.0f);
1565            const float4_t tmp0 = float4_and(mask, onef);
1566            const float4_t tmp1 = float4_ftoi(tmp0);
1567            const float4_t tmp2 = float4_xor(tmp1, reverse);
1568            const float4_t tmp3 = float4_sll(tmp2, 1);
1569            const float4_t onei = float4_isplat(1);
1570            const float4_t tmp4 = float4_isub(tmp3, onei);
1560         const float4_t zero = float4_zero();
1561         const float4_t mask = float4_cmpgt(f, zero);
1562         const float4_t onef = float4_splat(1.0f);
1563         const float4_t tmp0 = float4_and(mask, onef);
1564         const float4_t tmp1 = float4_ftoi(tmp0);
1565         const float4_t tmp2 = float4_xor(tmp1, reverse);
1566         const float4_t tmp3 = float4_sll(tmp2, 1);
1567         const float4_t onei = float4_isplat(1);
1568         const float4_t tmp4 = float4_isub(tmp3, onei);
15711569
1572            BX_ALIGN_DECL_16(int32_t res[4]);
1573            float4_st(&res, tmp4);
1570         BX_ALIGN_DECL_16(int32_t res[4]);
1571         float4_st(&res, tmp4);
15741572
1575            for (uint16_t jj = 0; jj < 2; ++jj)
1576            {
1577               int16_t kk = res[jj] + res[jj+2];
1578               if (kk != 0)
1579               {
1580                  float* v0 = (float*)&vertices[edges[ii+jj].m_i0*_stride];
1581                  float* v1 = (float*)&vertices[edges[ii+jj].m_i1*_stride];
1582                  verticesSide[vsideI++] = VertexData(v0, 0.0f, float(kk) );
1583                  verticesSide[vsideI++] = VertexData(v0, 1.0f, float(kk) );
1584                  verticesSide[vsideI++] = VertexData(v1, 0.0f, float(kk) );
1585                  verticesSide[vsideI++] = VertexData(v1, 1.0f, float(kk) );
1586
1587                  kk = _textureAsStencil ? 1 : kk;
1588                  uint16_t winding = uint16_t(kk > 0);
1589                  for (uint8_t ll = 0, end = abs(kk); ll < end; ++ll)
1590                  {
1591                     indicesSide[sideI++] = indexSide;
1592                     indicesSide[sideI++] = indexSide + 2 - winding;
1593                     indicesSide[sideI++] = indexSide + 1 + winding;
1594
1595                     indicesSide[sideI++] = indexSide + 2;
1596                     indicesSide[sideI++] = indexSide + 3 - winding*2;
1597                     indicesSide[sideI++] = indexSide + 1 + winding*2;
1598                  }
1599
1600                  indexSide += 4;
1601               }
1602            }
1603         }
1604#endif
1605
1606         for (; ii < numEdges; ++ii)
1573         for (uint16_t jj = 0; jj < 2; ++jj)
16071574         {
1608            const Edge& edge = edges[ii];
1609            const Plane* edgePlane = &edgePlanes[ii*2];
1610
1611            int16_t s0 = ( (vec3Dot(edgePlane[0].m_plane, _light) + edgePlane[0].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[0];
1612            int16_t s1 = ( (vec3Dot(edgePlane[1].m_plane, _light) + edgePlane[1].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[1];
1613            int16_t kk = ( (s0 + s1) << 1) - 2;
1614
1615            if (kk != 0)
1575            int16_t k = res[jj] + res[jj+2];
1576            if (k != 0)
16161577            {
1617               float* v0 = (float*)&vertices[edge.m_i0*_stride];
1618               float* v1 = (float*)&vertices[edge.m_i1*_stride];
1619               verticesSide[vsideI++] = VertexData(v0, 0.0f, kk);
1620               verticesSide[vsideI++] = VertexData(v0, 1.0f, kk);
1621               verticesSide[vsideI++] = VertexData(v1, 0.0f, kk);
1622               verticesSide[vsideI++] = VertexData(v1, 1.0f, kk);
1578               float* v0 = (float*)&vertices[edges[ii+jj].m_i0*_stride];
1579               float* v1 = (float*)&vertices[edges[ii+jj].m_i1*_stride];
1580               verticesSide[vsideI++] = VertexData(v0, 0.0f, float(k));
1581               verticesSide[vsideI++] = VertexData(v0, 1.0f, float(k));
1582               verticesSide[vsideI++] = VertexData(v1, 0.0f, float(k));
1583               verticesSide[vsideI++] = VertexData(v1, 1.0f, float(k));
16231584
1624               kk = _textureAsStencil ? 1 : kk;
1625               uint16_t winding = uint16_t(kk > 0);
1626               for (uint8_t jj = 0, end = abs(kk); jj < end; ++jj)
1585               k = _textureAsStencil ? 1 : k;
1586               uint16_t winding = uint16_t(k > 0);
1587               for (uint8_t ii = 0, end = abs(k); ii < end; ++ii)
16271588               {
16281589                  indicesSide[sideI++] = indexSide;
16291590                  indicesSide[sideI++] = indexSide + 2 - winding;
r245570r245571
16381599            }
16391600         }
16401601      }
1602#endif
16411603
1604      for (; ii < numEdges; ++ii)
1605      {
1606         const Edge& edge = edges[ii];
1607         const Plane* edgePlane = &edgePlanes[ii*2];
1608
1609         int16_t s0 = ( (vec3Dot(edgePlane[0].m_plane, _light) + edgePlane[0].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[0];
1610         int16_t s1 = ( (vec3Dot(edgePlane[1].m_plane, _light) + edgePlane[1].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[1];
1611         int16_t k = ( (s0 + s1) << 1) - 2;
1612
1613         if (k != 0)
1614         {
1615            float* v0 = (float*)&vertices[edge.m_i0*_stride];
1616            float* v1 = (float*)&vertices[edge.m_i1*_stride];
1617            verticesSide[vsideI++] = VertexData(v0, 0.0f, k);
1618            verticesSide[vsideI++] = VertexData(v0, 1.0f, k);
1619            verticesSide[vsideI++] = VertexData(v1, 0.0f, k);
1620            verticesSide[vsideI++] = VertexData(v1, 1.0f, k);
1621
1622            k = _textureAsStencil ? 1 : k;
1623            uint16_t winding = uint16_t(k > 0);
1624            for (uint8_t ii = 0, end = abs(k); ii < end; ++ii)
1625            {
1626               indicesSide[sideI++] = indexSide;
1627               indicesSide[sideI++] = indexSide + 2 - winding;
1628               indicesSide[sideI++] = indexSide + 1 + winding;
1629
1630               indicesSide[sideI++] = indexSide + 2;
1631               indicesSide[sideI++] = indexSide + 3 - winding*2;
1632               indicesSide[sideI++] = indexSide + 1 + winding*2;
1633            }
1634
1635            indexSide += 4;
1636         }
1637      }
1638
16421639      if (cap)
16431640      {
16441641         // This could/should be done on GPU!
r245570r245571
16461643         {
16471644            const Face& face = *iter;
16481645
1649            float f = bx::vec3Dot(face.m_plane, _light) + face.m_plane[3];
1646            float f = vec3Dot(face.m_plane, _light) + face.m_plane[3];
16501647            bool frontFacing = (f > 0.0f);
16511648
1652            for (uint8_t ii = 0, num = 1 + uint8_t(!_textureAsStencil); ii < num; ++ii)
1649            for (uint8_t ii = 0, end = 1 + uint8_t(!_textureAsStencil); ii < end; ++ii)
16531650            {
16541651               if (frontFacing)
16551652               {
r245570r245571
22792276      {
22802277         for (uint8_t ii = 0; ii < settings_numLights; ++ii)
22812278         {
2282            lightPosRadius[ii][0] = cosf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f;
2279            lightPosRadius[ii][0] = cos(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f;
22832280            lightPosRadius[ii][1] = 20.0f;
2284            lightPosRadius[ii][2] = sinf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f;
2281            lightPosRadius[ii][2] = sin(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f;
22852282            lightPosRadius[ii][3] = 20.0f;
22862283         }
22872284      }
r245570r245571
22892286      {
22902287         for (uint8_t ii = 0; ii < settings_numLights; ++ii)
22912288         {
2292            lightPosRadius[ii][0] = cosf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f;
2289            lightPosRadius[ii][0] = cos(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f;
22932290            lightPosRadius[ii][1] = 20.0f;
2294            lightPosRadius[ii][2] = sinf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f;
2291            lightPosRadius[ii][2] = sin(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f;
22952292            lightPosRadius[ii][3] = 20.0f;
22962293         }
22972294      }
r245570r245571
23652362         inst.m_rotation[0] = 0.0f;
23662363         inst.m_rotation[1] = 0.0f;
23672364         inst.m_rotation[2] = 0.0f;
2368         inst.m_pos[0]      = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
2365         inst.m_pos[0]      = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
23692366         inst.m_pos[1]      = 6.0f;
2370         inst.m_pos[2]      = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
2367         inst.m_pos[2]      = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
23712368         inst.m_model       = &cubeModel;
23722369      }
23732370
r245570r245571
23822379         inst.m_rotation[0] = 0.0f;
23832380         inst.m_rotation[1] = 0.0f;
23842381         inst.m_rotation[2] = 0.0f;
2385         inst.m_pos[0]      = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
2382         inst.m_pos[0]      = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
23862383         inst.m_pos[1]      = 22.0f;
2387         inst.m_pos[2]      = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
2384         inst.m_pos[2]      = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f;
23882385         inst.m_model       = &cubeModel;
23892386      }
23902387
r245570r245571
27942791         viewId += uint8_t(settings_useStencilTexture);
27952792
27962793         // Draw shadow casters.
2797         for (uint8_t jj = 0; jj < shadowCastersCount[currentScene]; ++jj)
2794         for (uint8_t ii = 0; ii < shadowCastersCount[currentScene]; ++ii)
27982795         {
2799            shadowCasters[currentScene][jj].submit(viewId, drawDiffuse);
2796            shadowCasters[currentScene][ii].submit(viewId, drawDiffuse);
28002797         }
28012798
28022799         // Draw shadow receivers.
2803         for (uint8_t jj = 0; jj < shadowReceiversCount[currentScene]; ++jj)
2800         for (uint8_t ii = 0; ii < shadowReceiversCount[currentScene]; ++ii)
28042801         {
2805            shadowReceivers[currentScene][jj].submit(viewId, drawDiffuse);
2802            shadowReceivers[currentScene][ii].submit(viewId, drawDiffuse);
28062803         }
28072804      }
28082805
trunk/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
r245570r245571
186186   float view[16];
187187   float proj[16];
188188
189   float eye[3] = { 0.0f, 30.0f, -60.0f };
190   float at[3]  = { 0.0f,  5.0f,   0.0f };
189   const float eye[3] = { 0.0f, 30.0f, -60.0f };
190   const float at[3]  = { 0.0f, 5.0f, 0.0f };
191191   bx::mtxLookAt(view, eye, at);
192192
193193   const float aspect = float(int32_t(width) ) / float(int32_t(height) );
r245570r245571
221221
222222      // Setup lights.
223223      float lightPos[4];
224      lightPos[0] = -cosf(timeAccumulatorLight);
224      lightPos[0] = -cos(timeAccumulatorLight);
225225      lightPos[1] = -1.0f;
226      lightPos[2] = -sinf(timeAccumulatorLight);
226      lightPos[2] = -sin(timeAccumulatorLight);
227227      lightPos[3] = 0.0f;
228228
229229      bgfx::setUniform(u_lightPos, lightPos);
r245570r245571
261261      float lightView[16];
262262      float lightProj[16];
263263
264      eye[0] = -lightPos[0];
265      eye[0] = -lightPos[1];
266      eye[0] = -lightPos[2];
267
268      at[0] = 0.0f;
269      at[1] = 0.0f;
270      at[2] = 0.0f;
271
264      const float eye[3] =
265      {
266         -lightPos[0],
267         -lightPos[1],
268         -lightPos[2],
269      };
270      const float at[3] = { 0.0f, 0.0f, 0.0f };
272271      bx::mtxLookAt(lightView, eye, at);
273272
274273      const float area = 30.0f;
trunk/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
r245570r245571
21652165      if (settings.m_updateScene)  { timeAccumulatorScene += deltaTime; }
21662166
21672167      // Setup lights.
2168      pointLight.m_position.m_x = cosf(timeAccumulatorLight) * 20.0f;
2168      pointLight.m_position.m_x = cos(timeAccumulatorLight) * 20.0f;
21692169      pointLight.m_position.m_y = 26.0f;
2170      pointLight.m_position.m_z = sinf(timeAccumulatorLight) * 20.0f;
2170      pointLight.m_position.m_z = sin(timeAccumulatorLight) * 20.0f;
21712171      pointLight.m_spotDirectionInner.m_x = -pointLight.m_position.m_x;
21722172      pointLight.m_spotDirectionInner.m_y = -pointLight.m_position.m_y;
21732173      pointLight.m_spotDirectionInner.m_z = -pointLight.m_position.m_z;
21742174
2175      directionalLight.m_position.m_x = -cosf(timeAccumulatorLight);
2175      directionalLight.m_position.m_x = -cos(timeAccumulatorLight);
21762176      directionalLight.m_position.m_y = -1.0f;
2177      directionalLight.m_position.m_z = -sinf(timeAccumulatorLight);
2177      directionalLight.m_position.m_z = -sin(timeAccumulatorLight);
21782178
21792179      // Setup instance matrices.
21802180      float mtxFloor[16];
r245570r245571
24522452      }
24532453
24542454      // Determine on-screen rectangle size where depth buffer will be drawn.
2455      uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f);
2456      uint16_t depthRectWidth  = depthRectHeight;
2457      uint16_t depthRectX = 0;
2458      uint16_t depthRectY = viewState.m_height - depthRectHeight;
2455      const uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f);
2456      const uint16_t depthRectWidth  = depthRectHeight;
2457      const uint16_t depthRectX = 0;
2458      const uint16_t depthRectY = viewState.m_height - depthRectHeight;
24592459
24602460      // Setup views and render targets.
24612461      bgfx::setViewRect(0, 0, 0, viewState.m_width, viewState.m_height);
r245570r245571
25832583          * RENDERVIEW_DRAWDEPTH_3_ID - Draw depth buffer for fourth split.
25842584          */
25852585
2586         depthRectHeight = viewState.m_height / 3;
2587         depthRectWidth  = depthRectHeight;
2588         depthRectX = 0;
2589         depthRectY = viewState.m_height - depthRectHeight;
2586         const uint16_t depthRectHeight = viewState.m_height / 3;
2587         const uint16_t depthRectWidth  = depthRectHeight;
2588         const uint16_t depthRectX = 0;
2589         const uint16_t depthRectY = viewState.m_height - depthRectHeight;
25902590
25912591         bgfx::setViewRect(RENDERVIEW_SHADOWMAP_1_ID, 0, 0, currentShadowMapSize, currentShadowMapSize);
25922592         bgfx::setViewRect(RENDERVIEW_SHADOWMAP_2_ID, 0, 0, currentShadowMapSize, currentShadowMapSize);
r245570r245571
27952795                  );
27962796
27972797            // Trees.
2798            for (uint8_t jj = 0; jj < numTrees; ++jj)
2798            for (uint8_t ii = 0; ii < numTrees; ++ii)
27992799            {
28002800               treeMesh.submit(viewId
2801                     , mtxTrees[jj]
2801                     , mtxTrees[ii]
28022802                     , *currentSmSettings->m_progPack
28032803                     , s_renderStates[renderStateIndex]
28042804                     );
r245570r245571
28512851         float mtxShadow[16];
28522852
28532853         const float ymul = (s_flipV) ? 0.5f : -0.5f;
2854         float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
2854         const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
28552855
28562856         const float mtxBias[16] =
28572857         {
r245570r245571
28702870         else if (LightType::PointLight == settings.m_lightType)
28712871         {
28722872            const float s = (s_flipV) ? 1.0f : -1.0f; //sign
2873            zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
2873            const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
28742874
28752875            const float mtxCropBias[2][TetrahedronFaces::Count][16] =
28762876            {
trunk/3rdparty/bgfx/examples/20-nanovg/blendish.h
r245570r245571
11091109    #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
11101110    #pragma warning (disable: 4244)
11111111    #pragma warning (disable: 4305)
1112    #pragma warning (disable: 4838) // warning C4838: conversion from 'double' to 'float' requires a narrowing conversion
11131112    #ifdef __cplusplus
11141113    #define BND_INLINE inline
11151114    #else
trunk/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
r245570r245571
387387   float ry = y + ey;
388388   float dx,dy,d;
389389   float br = (ex < ey ? ex : ey) * 0.5f;
390   float blink = 1 - powf(sinf(t*0.5f),200)*0.8f;
390   float blink = 1 - pow(sinf(t*0.5f),200)*0.8f;
391391
392392   bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16));
393393   nvgBeginPath(vg);
r245570r245571
10421042            for (j = 0; j < nglyphs; j++) {
10431043               float x0 = glyphs[j].x;
10441044               float x1 = (j+1 < nglyphs) ? glyphs[j+1].x : x+row->width;
1045               float tgx = x0 * 0.3f + x1 * 0.7f;
1046               if (mx >= px && mx < tgx)
1045               float gx = x0 * 0.3f + x1 * 0.7f;
1046               if (mx >= px && mx < gx)
10471047                  caretx = glyphs[j].x;
1048               px = tgx;
1048               px = gx;
10491049            }
10501050            nvgBeginPath(vg);
10511051            nvgFillColor(vg, nvgRGBA(255,192,0,255));
r245570r245571
10751075      nvgBeginPath(vg);
10761076      nvgFillColor(vg, nvgRGBA(255,192,0,255));
10771077      nvgRoundedRect(vg
1078         , roundf(bounds[0])-4.0f
1079         , roundf(bounds[1])-2.0f
1080         , roundf(bounds[2]-bounds[0])+8.0f
1081         , roundf(bounds[3]-bounds[1])+4.0f
1082         , (roundf(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f
1078         , round(bounds[0])-4.0f
1079         , round(bounds[1])-2.0f
1080         , round(bounds[2]-bounds[0])+8.0f
1081         , round(bounds[3]-bounds[1])+4.0f
1082         , (round(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f
10831083         );
10841084      nvgFill(vg);
10851085
r245570r245571
10971097   nvgBeginPath(vg);
10981098   nvgFillColor(vg, nvgRGBA(220,220,220,255));
10991099   nvgRoundedRect(vg
1100      , roundf(bounds[0]-2.0f)
1101      , roundf(bounds[1]-2.0f)
1102      , roundf(bounds[2]-bounds[0])+4.0f
1103      , roundf(bounds[3]-bounds[1])+4.0f
1100      , round(bounds[0]-2.0f)
1101      , round(bounds[1]-2.0f)
1102      , round(bounds[2]-bounds[0])+4.0f
1103      , round(bounds[3]-bounds[1])+4.0f
11041104      , 3.0f
11051105      );
11061106   px = float( (int)((bounds[2]+bounds[0])/2) );
trunk/3rdparty/bgfx/examples/21-deferred/deferred.cpp
r245570r245571
529529         {
530530            Sphere lightPosRadius;
531531
532            float lightTime = time * lightAnimationSpeed * (sinf(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f);
533            lightPosRadius.m_center[0] = sinf( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset;
534            lightPosRadius.m_center[1] = cosf( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset;
535            lightPosRadius.m_center[2] = sinf( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f;
532            float lightTime = time * lightAnimationSpeed * (sin(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f);
533            lightPosRadius.m_center[0] = sin( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset;
534            lightPosRadius.m_center[1] = cos( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset;
535            lightPosRadius.m_center[2] = sin( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f;
536536            lightPosRadius.m_radius = 2.0f;
537537
538538            Aabb aabb;
trunk/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
r245570r245571
150150      // draw moving shape
151151      static float counter = 0.0f;
152152      counter += 0.01f;
153      float posX = width  / 2.0f + sinf(counter * 3.18378f) * (width / 2.0f);
154      float posY = height / 2.0f + cosf(counter) * (height / 2.0f);
153      float posX = width  / 2.0f + sin(counter * 3.18378f) * (width / 2.0f);
154      float posY = height / 2.0f + cos(counter) * (height / 2.0f);
155155      vd.drawCircle(posX, posY, 5.0f, 10.0f);
156156
157157      vd.endFrame();
trunk/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
r245570r245571
361361      line->y0 = m_pendingPoints[i - 1].y;
362362      line->x1 = m_pendingPoints[i].x;
363363      line->y1 = m_pendingPoints[i].y;
364      line->a = atan2f(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi]
364      line->a = atan2(line->y1 - line->y0, line->x1 - line->x0);                  // angle from positive x axis, increasing ccw, [-pi, pi]
365365      line->sin_a = sinf(line->a);
366366      line->cos_a = cosf(line->a);
367      line->len = sqrtf( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) );
367      line->len = sqrt( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) );
368368
369369      // figure out what connections we have
370370      line->has_prev = (!line->is_first
trunk/3rdparty/bgfx/examples/24-nbody/nbody.cpp
r245570r245571
117117      , 0
118118      );
119119
120   const bgfx::Caps* caps = bgfx::getCaps();
121   const bool computeSupported = !!(caps->supported & BGFX_CAPS_COMPUTE);
120   // Imgui.
121   imguiCreate();
122122
123   if (computeSupported)
124   {
125      // Imgui.
126      imguiCreate();
123   bgfx::VertexDecl quadVertexDecl;
124   quadVertexDecl.begin()
125      .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
126      .end();
127127
128      bgfx::VertexDecl quadVertexDecl;
129      quadVertexDecl.begin()
130         .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
131         .end();
128   // Create static vertex buffer.
129   bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(
130        // Static data can be passed with bgfx::makeRef
131        bgfx::makeRef(s_quadVertices, sizeof(s_quadVertices) )
132      , quadVertexDecl
133      );
132134
133      // Create static vertex buffer.
134      bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(
135            // Static data can be passed with bgfx::makeRef
136            bgfx::makeRef(s_quadVertices, sizeof(s_quadVertices) )
137            , quadVertexDecl
138            );
135   // Create static index buffer.
136   bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(
137      // Static data can be passed with bgfx::makeRef
138      bgfx::makeRef(s_quadIndices, sizeof(s_quadIndices) )
139      );
139140
140      // Create static index buffer.
141      bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(
142            // Static data can be passed with bgfx::makeRef
143            bgfx::makeRef(s_quadIndices, sizeof(s_quadIndices) )
144            );
141   // Create particle program from shaders.
142   bgfx::ProgramHandle particleProgram = loadProgram("vs_particle", "fs_particle");
145143
146      // Create particle program from shaders.
147      bgfx::ProgramHandle particleProgram = loadProgram("vs_particle", "fs_particle");
144   // Setup compute buffers
145   bgfx::VertexDecl computeVertexDecl;
146   computeVertexDecl.begin()
147      .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
148      .end();
148149
149      // Setup compute buffers
150      bgfx::VertexDecl computeVertexDecl;
151      computeVertexDecl.begin()
152         .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
153         .end();
150   const uint32_t threadGroupUpdateSize = 512;
151   const uint32_t maxParticleCount = 32 * 1024;
154152
155      const uint32_t threadGroupUpdateSize = 512;
156      const uint32_t maxParticleCount = 32 * 1024;
153   bgfx::DynamicVertexBufferHandle currPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
154   bgfx::DynamicVertexBufferHandle currPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
155   bgfx::DynamicVertexBufferHandle prevPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
156   bgfx::DynamicVertexBufferHandle prevPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
157157
158      bgfx::DynamicVertexBufferHandle currPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
159      bgfx::DynamicVertexBufferHandle currPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
160      bgfx::DynamicVertexBufferHandle prevPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
161      bgfx::DynamicVertexBufferHandle prevPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
158   bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv, 3);
162159
163      bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv, 3);
160   bgfx::ShaderHandle  initInstancesShader    = loadShader("cs_init_instances");
161   bgfx::ProgramHandle initInstancesProgram   = bgfx::createProgram(initInstancesShader, true);
162   bgfx::ShaderHandle  updateInstancesShader  = loadShader("cs_update_instances");
163   bgfx::ProgramHandle updateInstancesProgram = bgfx::createProgram(updateInstancesShader, true);
164164
165      bgfx::ShaderHandle  initInstancesShader    = loadShader("cs_init_instances");
166      bgfx::ProgramHandle initInstancesProgram   = bgfx::createProgram(initInstancesShader, true);
167      bgfx::ShaderHandle  updateInstancesShader  = loadShader("cs_update_instances");
168      bgfx::ProgramHandle updateInstancesProgram = bgfx::createProgram(updateInstancesShader, true);
165   u_paramsDataStruct u_paramsData;
166   InitializeParams(0, &u_paramsData);
169167
170      u_paramsDataStruct u_paramsData;
171      InitializeParams(0, &u_paramsData);
168   bgfx::setUniform(u_params, &u_paramsData, 3);
169   bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
170   bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
171   bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1);
172172
173      bgfx::setUniform(u_params, &u_paramsData, 3);
174      bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
175      bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
176      bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1);
173   float view[16];
174   float initialPos[3] = { 0.0f, 0.0f, -45.0f };
175   cameraCreate();
176   cameraSetPosition(initialPos);
177   cameraSetVerticalAngle(0.0f);
178   cameraGetViewMtx(view);
177179
178      float view[16];
179      float initialPos[3] = { 0.0f, 0.0f, -45.0f };
180      cameraCreate();
181      cameraSetPosition(initialPos);
182      cameraSetVerticalAngle(0.0f);
183      cameraGetViewMtx(view);
180   int32_t scrollArea = 0;
184181
185      int32_t scrollArea = 0;
182   entry::MouseState mouseState;
183   while (!entry::processEvents(width, height, debug, reset, &mouseState) )
184   {
185      int64_t now = bx::getHPCounter();
186      static int64_t last = now;
187      const int64_t frameTime = now - last;
188      last = now;
189      const double freq = double(bx::getHPFrequency() );
190      const float deltaTime = float(frameTime/freq);
186191
187      entry::MouseState mouseState;
188      while (!entry::processEvents(width, height, debug, reset, &mouseState) )
189      {
190         int64_t now = bx::getHPCounter();
191         static int64_t last = now;
192         const int64_t frameTime = now - last;
193         last = now;
194         const double freq = double(bx::getHPFrequency() );
195         const float deltaTime = float(frameTime/freq);
192      // Set view 0 default viewport.
193      bgfx::setViewRect(0, 0, 0, width, height);
196194
197         // Set view 0 default viewport.
198         bgfx::setViewRect(0, 0, 0, width, height);
195      // Use debug font to print information about this example.
196      bgfx::dbgTextClear();
197      bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody");
198      bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers.");
199199
200         // Use debug font to print information about this example.
201         bgfx::dbgTextClear();
202         bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody");
203         bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers.");
200      imguiBeginFrame(mouseState.m_mx
201         , mouseState.m_my
202         , (mouseState.m_buttons[entry::MouseButton::Left  ] ? IMGUI_MBUT_LEFT  : 0)
203         | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
204         , 0
205         , width
206         , height
207         );
208      imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, 500, &scrollArea);
209      imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100);
210      int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut");
211      imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f);
212      bool reset = imguiButton("Reset");
213      imguiSeparatorLine();
214      imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64);
215      imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f);
216      imguiSlider("Damping", u_paramsData.damping, 0.0f, 1.0f, 0.01f);
217      imguiSlider("Max acceleration", u_paramsData.maxAccel, 0.0f, 100.0f, 0.01f);
218      imguiSlider("Time step", u_paramsData.timeStep, 0.0f, 0.02f, 0.0001f);
219      imguiSeparatorLine();
220      imguiSlider("Particle intensity", u_paramsData.particleIntensity, 0.0f, 1.0f, 0.001f);
221      imguiSlider("Particle size", u_paramsData.particleSize, 0.0f, 1.0f, 0.001f);
222      imguiSlider("Particle power", u_paramsData.particlePower, 0.001f, 16.0f, 0.01f);
223      imguiEndScrollArea();
224      imguiEndFrame();
204225
205         imguiBeginFrame(mouseState.m_mx
206               , mouseState.m_my
207               , (mouseState.m_buttons[entry::MouseButton::Left  ] ? IMGUI_MBUT_LEFT  : 0)
208               | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
209               , 0
210               , width
211               , height
212               );
213         imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, 500, &scrollArea);
214         imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100);
215         int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut");
216         imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f);
217         bool defaults = imguiButton("Reset");
218         imguiSeparatorLine();
219         imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64);
220         imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f);
221         imguiSlider("Damping", u_paramsData.damping, 0.0f, 1.0f, 0.01f);
222         imguiSlider("Max acceleration", u_paramsData.maxAccel, 0.0f, 100.0f, 0.01f);
223         imguiSlider("Time step", u_paramsData.timeStep, 0.0f, 0.02f, 0.0001f);
224         imguiSeparatorLine();
225         imguiSlider("Particle intensity", u_paramsData.particleIntensity, 0.0f, 1.0f, 0.001f);
226         imguiSlider("Particle size", u_paramsData.particleSize, 0.0f, 1.0f, 0.001f);
227         imguiSlider("Particle power", u_paramsData.particlePower, 0.001f, 16.0f, 0.01f);
228         imguiEndScrollArea();
229         imguiEndFrame();
226      // Modify parameters and reset if shape is changed
227      if (shape != u_paramsData.initialShape)
228      {
229         reset = true;
230         InitializeParams(shape, &u_paramsData);
231      }
230232
231         // Modify parameters and reset if shape is changed
232         if (shape != u_paramsData.initialShape)
233         {
234            defaults = true;
235            InitializeParams(shape, &u_paramsData);
236         }
237
238         if (defaults)
239         {
240            bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
241            bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
242            bgfx::setUniform(u_params, &u_paramsData, 3);
243            bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1);
244         }
245
246         bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Read);
247         bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Read);
248         bgfx::setBuffer(2, prevPositionBuffer1, bgfx::Access::Write);
249         bgfx::setBuffer(3, currPositionBuffer1, bgfx::Access::Write);
233      if (reset)
234      {
235         bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
236         bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
250237         bgfx::setUniform(u_params, &u_paramsData, 3);
251         bgfx::dispatch(0, updateInstancesProgram, u_paramsData.dispatchSize, 1, 1);
238         bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1);
239      }
252240
253         bx::xchg(currPositionBuffer0, currPositionBuffer1);
254         bx::xchg(prevPositionBuffer0, prevPositionBuffer1);
241      bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Read);
242      bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Read);
243      bgfx::setBuffer(2, prevPositionBuffer1, bgfx::Access::Write);
244      bgfx::setBuffer(3, currPositionBuffer1, bgfx::Access::Write);
245      bgfx::setUniform(u_params, &u_paramsData, 3);
246      bgfx::dispatch(0, updateInstancesProgram, u_paramsData.dispatchSize, 1, 1);
255247
256         // Update camera.
257         cameraUpdate(deltaTime, mouseState);
258         cameraGetViewMtx(view);
248      bx::xchg(currPositionBuffer0, currPositionBuffer1);
249      bx::xchg(prevPositionBuffer0, prevPositionBuffer1);
259250
260         // Set view and projection matrix for view 0.
261         const bgfx::HMD* hmd = bgfx::getHMD();
262         if (NULL != hmd)
263         {
264            float viewHead[16];
265            float eye[3] = {};
266            bx::mtxQuatTranslationHMD(viewHead, hmd->eye[0].rotation, eye);
251      float view[16];
267252
268            float tmp[16];
269            bx::mtxMul(tmp, view, viewHead);
253      // Update camera.
254      cameraUpdate(deltaTime, mouseState);
255      cameraGetViewMtx(view);
270256
271            float proj[16];
272            bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 10000.0f);
257      // Set view and projection matrix for view 0.
258      const bgfx::HMD* hmd = bgfx::getHMD();
259      if (NULL != hmd)
260      {
261         float viewHead[16];
262         float eye[3] = {};
263         bx::mtxQuatTranslationHMD(viewHead, hmd->eye[0].rotation, eye);
273264
274            bgfx::setViewTransform(0, tmp, proj);
265         float tmp[16];
266         bx::mtxMul(tmp, view, viewHead);
275267
276            // Set view 0 default viewport.
277            //
278            // Use HMD's width/height since HMD's internal frame buffer size
279            // might be much larger than window size.
280            bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
281         }
282         else
283         {
284            float proj[16];
285            bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f);
286            bgfx::setViewTransform(0, view, proj);
268         float proj[16];
269         bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 10000.0f);
287270
288            // Set view 0 default viewport.
289            bgfx::setViewRect(0, 0, 0, width, height);
290         }
271         bgfx::setViewTransform(0, tmp, proj);
291272
292         // Set vertex and fragment shaders.
293         bgfx::setProgram(particleProgram);
294
295         // Set vertex and index buffer.
296         bgfx::setVertexBuffer(vbh);
297         bgfx::setIndexBuffer(ibh);
298         bgfx::setInstanceDataBuffer(currPositionBuffer0, 0, u_paramsData.dispatchSize * threadGroupUpdateSize);
299
300         // Set render states.
301         bgfx::setState(0
302               | BGFX_STATE_RGB_WRITE
303               | BGFX_STATE_BLEND_ADD
304               | BGFX_STATE_DEPTH_TEST_ALWAYS
305               );
306
307         // Submit primitive for rendering to view 0.
308         bgfx::submit(0);
309
310         // Advance to next frame. Rendering thread will be kicked to
311         // process submitted rendering primitives.
312         bgfx::frame();
273         // Set view 0 default viewport.
274         //
275         // Use HMD's width/height since HMD's internal frame buffer size
276         // might be much larger than window size.
277         bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
313278      }
314
315      // Cleanup.
316      cameraDestroy();
317      imguiDestroy();
318      bgfx::destroyUniform(u_params);
319      bgfx::destroyDynamicVertexBuffer(currPositionBuffer0);
320      bgfx::destroyDynamicVertexBuffer(currPositionBuffer1);
321      bgfx::destroyDynamicVertexBuffer(prevPositionBuffer0);
322      bgfx::destroyDynamicVertexBuffer(prevPositionBuffer1);
323      bgfx::destroyProgram(updateInstancesProgram);
324      bgfx::destroyProgram(initInstancesProgram);
325      bgfx::destroyIndexBuffer(ibh);
326      bgfx::destroyVertexBuffer(vbh);
327      bgfx::destroyProgram(particleProgram);
328   }
329   else
330   {
331      int64_t timeOffset = bx::getHPCounter();
332
333      entry::MouseState mouseState;
334      while (!entry::processEvents(width, height, debug, reset, &mouseState) )
279      else
335280      {
336         int64_t now = bx::getHPCounter();
337         float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) );
281         float proj[16];
282         bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f);
283         bgfx::setViewTransform(0, view, proj);
338284
285         // Set view 0 default viewport.
339286         bgfx::setViewRect(0, 0, 0, width, height);
287      }
340288
341         bgfx::dbgTextClear();
342         bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody");
343         bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers.");
289      // Set vertex and fragment shaders.
290      bgfx::setProgram(particleProgram);
344291
345         bool blink = uint32_t(time*3.0f)&1;
346         bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " Compute is not supported by GPU. ");
292      // Set vertex and index buffer.
293      bgfx::setVertexBuffer(vbh);
294      bgfx::setIndexBuffer(ibh);
295      bgfx::setInstanceDataBuffer(currPositionBuffer0, 0, u_paramsData.dispatchSize * threadGroupUpdateSize);
347296
348         bgfx::submit(0);
349         bgfx::frame();
350      }
297      // Set render states.
298      bgfx::setState(0
299         | BGFX_STATE_RGB_WRITE
300         | BGFX_STATE_BLEND_ADD
301         | BGFX_STATE_DEPTH_TEST_ALWAYS
302         );
303
304      // Submit primitive for rendering to view 0.
305      bgfx::submit(0);
306
307      // Advance to next frame. Rendering thread will be kicked to
308      // process submitted rendering primitives.
309      bgfx::frame();
351310   }
352311
312   // Cleanup.
313   cameraDestroy();
314   imguiDestroy();
315   bgfx::destroyUniform(u_params);
316   bgfx::destroyDynamicVertexBuffer(currPositionBuffer0);
317   bgfx::destroyDynamicVertexBuffer(currPositionBuffer1);
318   bgfx::destroyDynamicVertexBuffer(prevPositionBuffer0);
319   bgfx::destroyDynamicVertexBuffer(prevPositionBuffer1);
320   bgfx::destroyProgram(updateInstancesProgram);
321   bgfx::destroyProgram(initInstancesProgram);
322   bgfx::destroyIndexBuffer(ibh);
323   bgfx::destroyVertexBuffer(vbh);
324   bgfx::destroyProgram(particleProgram);
325
353326   // Shutdown bgfx.
354327   bgfx::shutdown();
355328
trunk/3rdparty/bgfx/examples/25-c99/helloworld.c
r245570r245571
1515
1616int _main_(int _argc, char** _argv)
1717{
18   uint32_t width  = 1280;
19   uint32_t height = 720;
20   uint32_t debug  = BGFX_DEBUG_TEXT;
21   uint32_t reset  = BGFX_RESET_VSYNC;
2218   (void)_argc;
2319   (void)_argv;
20   uint32_t width = 1280;
21   uint32_t height = 720;
22   uint32_t debug = BGFX_DEBUG_TEXT;
23   uint32_t reset = BGFX_RESET_VSYNC;
2424
25   bgfx_init(BGFX_RENDERER_TYPE_COUNT
26         , BGFX_PCI_ID_NONE
27         , 0
28         , NULL
29         , NULL
30         );
25   bgfx_init(BGFX_RENDERER_TYPE_COUNT, NULL, NULL);
3126   bgfx_reset(width, height, reset);
3227
3328   // Enable debug text.
trunk/3rdparty/bgfx/examples/common/bounds.cpp
r245570r245571
264264      {
265265         position = (float*)&vertex[index*_stride];
266266
267         xx = position[0] - center[0];
268         yy = position[1] - center[1];
269         zz = position[2] - center[2];
267         float xx = position[0] - center[0];
268         float yy = position[1] - center[1];
269         float zz = position[2] - center[2];
270270         float distSq = xx*xx + yy*yy + zz*zz;
271271
272272         if (distSq > maxDistSq)
trunk/3rdparty/bgfx/examples/common/entry/entry.cpp
r245570r245571
2929#if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
3030   bx::ReallocatorI* getDefaultAllocator()
3131   {
32BX_PRAGMA_DIAGNOSTIC_PUSH();
33BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration
34BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
3532      static bx::CrtAllocator s_allocator;
3633      return &s_allocator;
37BX_PRAGMA_DIAGNOSTIC_POP();
3834   }
3935#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
4036
trunk/3rdparty/bgfx/examples/common/entry/entry_p.h
r245570r245571
161161   class EventQueue
162162   {
163163   public:
164      ~EventQueue()
165      {
166         for (const Event* ev = poll(); NULL != ev; ev = poll() )
167         {
168            release(ev);
169         }
170      }
171
172164      void postAxisEvent(WindowHandle _handle, GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value)
173165      {
174166         AxisEvent* ev = new AxisEvent(_handle);
trunk/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
r245570r245571
1static const uint8_t fs_font_basic_glsl[553] =
1static const uint8_t fs_font_basic_glsl[547] =
22{
33   0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x09, 0x02, 0x00, 0x00, 0x76, // Color..........v
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 0x02, 0x00, 0x00, 0x76, // Color..........v
55   0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
66   0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
77   0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
r245570r245571
1515   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu
1616   0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol
1717   0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0.
18   0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);.  highp in
19   0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;.  tm
20   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, // pvar_3 = int(((v
21   0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, // _texcoord0.w * 4
22   0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .0) + 0.5));.  r
23   0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // gba_1[0] = tmpva
24   0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // r_2.z;.  rgba_1[
25   0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, // 1] = tmpvar_2.y;
26   0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, // .  rgba_1[2] = t
27   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.x;.  rgb
28   0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[3] = tmpvar_
29   0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // 2.w;.  lowp vec4
30   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, //  tmpvar_4;.  tmp
31   0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, // var_4.xyz = v_co
32   0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // lor0.xyz;.  tmpv
33   0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ar_4.w = (v_colo
34   0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, // r0.w * rgba_1[tm
35   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // pvar_3]);.  gl_F
36   0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
37   0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                           // r_4;.}...
18   0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // xyz);.  int tmpv
19   0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;.  tmpvar_3
20   0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, //  = int(((v_texco
21   0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) +
22   0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // 0.5));.  rgba_1[
23   0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, // 0] = tmpvar_2.z;
24   0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, // .  rgba_1[1] = t
25   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.y;.  rgb
26   0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[2] = tmpvar_
27   0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, // 2.x;.  rgba_1[3]
28   0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, //  = tmpvar_2.w;.
29   0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, //  lowp vec4 tmpva
30   0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, // r_4;.  tmpvar_4.
31   0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, // xyz = v_color0.x
32   0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, // yz;.  tmpvar_4.w
33   0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, //  = (v_color0.w *
34   0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, //  rgba_1[tmpvar_3
35   0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // ]);.  gl_FragCol
36   0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, // or = tmpvar_4;.}
37   0x0a, 0x0a, 0x00,                                                                               // ...
3838};
3939static const uint8_t fs_font_basic_dx9[445] =
4040{
trunk/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
r245570r245571
1static const uint8_t fs_font_distance_field_glsl[1019] =
1static const uint8_t fs_font_distance_field_glsl[1013] =
22{
33   0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xdb, 0x03, 0x00, 0x00, 0x76, // Color..........v
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd5, 0x03, 0x00, 0x00, 0x76, // Color..........v
55   0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
66   0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
77   0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
r245570r245571
1515   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu
1616   0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol
1717   0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0.
18   0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);.  highp in
19   0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;.  tm
20   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, // pvar_3 = int(((v
21   0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, // _texcoord0.w * 4
22   0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .0) + 0.5));.  r
23   0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // gba_1[0] = tmpva
24   0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // r_2.z;.  rgba_1[
25   0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, // 1] = tmpvar_2.y;
26   0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, // .  rgba_1[2] = t
27   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.x;.  rgb
28   0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[3] = tmpvar_
29   0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // 2.w;.  highp vec
30   0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 3 tmpvar_4;.  tm
31   0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, // pvar_4 = dFdx(v_
32   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, // texcoord0.xyz);.
33   0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, //   highp vec3 tmp
34   0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_5;.  tmpvar_
35   0x35, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // 5 = dFdy(v_texco
36   0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // ord0.xyz);.  hig
37   0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // hp float tmpvar_
38   0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, // 6;.  tmpvar_6 =
39   0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // (8.0 * (sqrt(. 
40   0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, //   dot (tmpvar_4,
41   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, //  tmpvar_4).  ) +
42   0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, //  sqrt(.    dot (
43   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar_5, tmpvar
44   0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // _5).  )));.  hig
45   0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, // hp float edge0_7
46   0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, // ;.  edge0_7 = (0
47   0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, // .5 - tmpvar_6);.
48   0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, //   lowp float tmp
49   0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_8;.  tmpvar_
50   0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, 0x62, // 8 = clamp (((rgb
51   0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, 0x20, // a_1[tmpvar_3] -
52   0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, // edge0_7) / (.   
53   0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, //  (0.5 + tmpvar_6
54   0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x29, // ).   - edge0_7))
55   0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // , 0.0, 1.0);.  l
56   0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec4 tmpvar_
57   0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x79, // 9;.  tmpvar_9.xy
58   0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // z = v_color0.xyz
59   0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, 0x3d, // ;.  tmpvar_9.w =
60   0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, //  (v_color0.w * (
61   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // tmpvar_8 * (tmpv
62   0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, // ar_8 * .    (3.0
63   0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, //  - (2.0 * tmpvar
64   0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // _8)).  )));.  gl
65   0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
66   0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                               // var_9;.}...
18   0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // xyz);.  int tmpv
19   0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;.  tmpvar_3
20   0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, //  = int(((v_texco
21   0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) +
22   0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // 0.5));.  rgba_1[
23   0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, // 0] = tmpvar_2.z;
24   0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, // .  rgba_1[1] = t
25   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.y;.  rgb
26   0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[2] = tmpvar_
27   0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, // 2.x;.  rgba_1[3]
28   0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, //  = tmpvar_2.w;.
29   0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, //  highp vec3 tmpv
30   0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // ar_4;.  tmpvar_4
31   0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, //  = dFdx(v_texcoo
32   0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // rd0.xyz);.  high
33   0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, // p vec3 tmpvar_5;
34   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x64, 0x46, // .  tmpvar_5 = dF
35   0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // dy(v_texcoord0.x
36   0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // yz);.  highp flo
37   0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, // at tmpvar_6;.  t
38   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, // mpvar_6 = (8.0 *
39   0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, //  (sqrt(.    dot
40   0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // (tmpvar_4, tmpva
41   0x72, 0x5f, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, // r_4).  ) + sqrt(
42   0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // .    dot (tmpvar
43   0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, // _5, tmpvar_5). 
44   0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // )));.  highp flo
45   0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, // at edge0_7;.  ed
46   0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, // ge0_7 = (0.5 - t
47   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // mpvar_6);.  lowp
48   0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, //  float tmpvar_8;
49   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, // .  tmpvar_8 = cl
50   0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, // amp (((rgba_1[tm
51   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, // pvar_3] - edge0_
52   0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, // 7) / (.    (0.5
53   0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, // + tmpvar_6).   -
54   0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, //  edge0_7)), 0.0,
55   0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, //  1.0);.  lowp ve
56   0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_9;.  t
57   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, // mpvar_9.xyz = v_
58   0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // color0.xyz;.  tm
59   0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, // pvar_9.w = (v_co
60   0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lor0.w * (tmpvar
61   0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, // _8 * (tmpvar_8 *
62   0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, //  .    (3.0 - (2.
63   0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, // 0 * tmpvar_8)).
64   0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, //  )));.  gl_FragC
65   0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, // olor = tmpvar_9;
66   0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                                   // .}...
6767};
6868static const uint8_t fs_font_distance_field_dx9[737] =
6969{
trunk/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
r245570r245571
1static const uint8_t fs_font_distance_field_subpixel_glsl[1268] =
1static const uint8_t fs_font_distance_field_subpixel_glsl[1262] =
22{
33   0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x76, // Color..........v
4   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xce, 0x04, 0x00, 0x00, 0x76, // Color..........v
55   0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
66   0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
77   0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
r245570r245571
99   0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // orm lowp sampler
1010   0x43, 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube u_texColor;
1111   0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.
12   0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, //   highp int tmpv
13   0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;.  tmpvar_1
14   0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, //  = int(((v_texco
15   0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) +
16   0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // 0.5));.  highp v
17   0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec3 tmpvar_2;. 
18   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, // tmpvar_2 = dFdx(
19   0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord0.xyz)
20   0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, // ;.  highp vec3 t
21   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_3;.  tmpva
22   0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // r_3 = dFdy(v_tex
23   0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // coord0.xyz);.  h
24   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ighp vec3 tmpvar
25   0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, // _4;.  tmpvar_4 =
26   0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, //  (0.166667 * tmp
27   0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // var_2);.  lowp f
28   0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // loat tmpvar_5;.
29   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, //  tmpvar_5 = text
30   0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // ureCube (u_texCo
31   0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // lor, (v_texcoord
32   0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // 0.xyz - tmpvar_4
33   0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // )).zyxw[tmpvar_1
34   0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ];.  lowp float
35   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_6;.  tmpv
36   0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, // ar_6 = textureCu
37   0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, // be (u_texColor,
38   0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // (v_texcoord0.xyz
39   0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, //  + tmpvar_4)).zy
40   0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // xw[tmpvar_1];. 
41   0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // lowp float tmpva
42   0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, // r_7;.  tmpvar_7
43   0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = (0.5 * (tmpvar
44   0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, // _5 + tmpvar_6));
45   0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // .  highp float t
46   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_8;.  tmpva
47   0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, // r_8 = (8.0 * (sq
48   0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, // rt(.    dot (tmp
49   0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, // var_2, tmpvar_2)
50   0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, // .  ) + sqrt(.   
51   0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, 0x20, //  dot (tmpvar_3,
52   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, // tmpvar_3).  )));
53   0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, // .  lowp vec3 tmp
54   0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_9;.  tmpvar_
55   0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, // 9.x = tmpvar_5;.
56   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, //   tmpvar_9.y = t
57   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_7;.  tmpva
58   0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, // r_9.z = tmpvar_6
59   0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // ;.  lowp vec3 tm
60   0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // pvar_10;.  highp
61   0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x3b, //  float edge0_11;
62   0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x30, // .  edge0_11 = (0
63   0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, // .5 - tmpvar_8);.
64   0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, //   lowp vec3 tmpv
65   0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_12;.  tmpvar_
66   0x31, 0x32, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x74, 0x6d, // 12 = clamp (((tm
67   0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, // pvar_9 - edge0_1
68   0x31, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, // 1) / (.    (0.5
69   0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, // + tmpvar_8).   -
70   0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, //  edge0_11)), 0.0
71   0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);.  tmpvar
72   0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, // _10 = (tmpvar_12
73   0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, //  * (tmpvar_12 *
74   0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x32, 0x2e, 0x30, // (3.0 - .    (2.0
75   0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x0a, 0x20, 0x20, //  * tmpvar_12). 
76   0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // )));.  gl_FragCo
77   0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // lor.xyz = (tmpva
78   0x72, 0x5f, 0x31, 0x30, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // r_10 * v_color0.
79   0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // w);.  gl_FragCol
80   0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, // or.w = (tmpvar_7
81   0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, //  * v_color0.w);.
82   0x7d, 0x0a, 0x0a, 0x00,                                                                         // }...
12   0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, //   int tmpvar_1;.
13   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, //   tmpvar_1 = int
14   0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, // (((v_texcoord0.w
15   0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, //  * 4.0) + 0.5));
16   0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // .  highp vec3 tm
17   0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_2;.  tmpvar
18   0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // _2 = dFdx(v_texc
19   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // oord0.xyz);.  hi
20   0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec3 tmpvar_
21   0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, // 3;.  tmpvar_3 =
22   0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // dFdy(v_texcoord0
23   0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .xyz);.  highp v
24   0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, // ec3 tmpvar_4;. 
25   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, // tmpvar_4 = (0.16
26   0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, // 6667 * tmpvar_2)
27   0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // ;.  lowp float t
28   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_5;.  tmpva
29   0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, // r_5 = textureCub
30   0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, // e (u_texColor, (
31   0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, // v_texcoord0.xyz
32   0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, // - tmpvar_4)).zyx
33   0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // w[tmpvar_1];.  l
34   0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // owp float tmpvar
35   0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, // _6;.  tmpvar_6 =
36   0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, //  textureCube (u_
37   0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // texColor, (v_tex
38   0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, // coord0.xyz + tmp
39   0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, // var_4)).zyxw[tmp
40   0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // var_1];.  lowp f
41   0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, // loat tmpvar_7;.
42   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, //  tmpvar_7 = (0.5
43   0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, //  * (tmpvar_5 + t
44   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // mpvar_6));.  hig
45   0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // hp float tmpvar_
46   0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, // 8;.  tmpvar_8 =
47   0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // (8.0 * (sqrt(. 
48   0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, //   dot (tmpvar_2,
49   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, //  tmpvar_2).  ) +
50   0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, //  sqrt(.    dot (
51   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar_3, tmpvar
52   0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, // _3).  )));.  low
53   0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, // p vec3 tmpvar_9;
54   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, // .  tmpvar_9.x =
55   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_5;.  tmpv
56   0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_9.y = tmpvar_
57   0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, // 7;.  tmpvar_9.z
58   0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // = tmpvar_6;.  lo
59   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec3 tmpvar_1
60   0x30, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 0;.  highp float
61   0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, //  edge0_11;.  edg
62   0x65, 0x30, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, // e0_11 = (0.5 - t
63   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // mpvar_8);.  lowp
64   0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, //  vec3 tmpvar_12;
65   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x63, // .  tmpvar_12 = c
66   0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // lamp (((tmpvar_9
67   0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x29, 0x20, 0x2f, 0x20, 0x28, //  - edge0_11) / (
68   0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, // .    (0.5 + tmpv
69   0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // ar_8).   - edge0
70   0x5f, 0x31, 0x31, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // _11)), 0.0, 1.0)
71   0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, // ;.  tmpvar_10 =
72   0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, // (tmpvar_12 * (tm
73   0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, // pvar_12 * (3.0 -
74   0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, //  .    (2.0 * tmp
75   0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, // var_12).  )));.
76   0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, //  gl_FragColor.xy
77   0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x2a, // z = (tmpvar_10 *
78   0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, //  v_color0.w);. 
79   0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, // gl_FragColor.w =
80   0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, //  (tmpvar_7 * v_c
81   0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,             // olor0.w);.}...
8382};
8483static const uint8_t fs_font_distance_field_subpixel_dx9[885] =
8584{
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
r245570r245571
1static const uint8_t fs_imgui_cubemap_glsl[578] =
1static const uint8_t fs_imgui_cubemap_glsl[363] =
22{
3   0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH....e..3...lo
4   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low
5   0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, // _textureCubeLod
6   0x20, 0x20, 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, //   (lowp samplerC
7   0x75, 0x62, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, // ube sampler, hig
8   0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, // hp vec3 coord, m
9   0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, // ediump float lod
10   0x29, 0x0a, 0x7b, 0x0a, 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, // ).{.#if defined(
11   0x47, 0x4c, 0x5f, 0x45, 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, // GL_EXT_shader_te
12   0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // xture_lod)..retu
13   0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // rn textureCubeLo
14   0x64, 0x20, 0x20, 0x20, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // d   (sampler, co
15   0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, // ord, lod);.#else
16   0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ..return texture
17   0x43, 0x75, 0x62, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // Cube(sampler, co
18   0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, // ord, lod);.#endi
19   0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, // f.}..varying hig
20   0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // hp vec3 v_normal
21   0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.uniform highp
22   0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // vec4 u_imageLodE
23   0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // nabled;.uniform
24   0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, 0x62, 0x65, // lowp samplerCube
25   0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, //  s_texColor;.voi
26   0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // d main ().{.  lo
27   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec4 tmpvar_1
28   0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, // ;.  tmpvar_1.xyz
29   0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, //  = impl_low_text
30   0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, // ureCubeLod    (s
31   0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // _texColor, v_nor
32   0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // mal, u_imageLodE
33   0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // nabled.x).xyz;.
34   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, //  tmpvar_1.w = (0
35   0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, // .2 + (0.8 * u_im
36   0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, // ageLodEnabled.y)
37   0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );.  gl_FragColo
38   0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_1;.}.
39   0x0a, 0x00,                                                                                     // ..
3   0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
4   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
5   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
6   0x00, 0x01, 0x00, 0x33, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...3...varying h
7   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ighp vec3 v_norm
8   0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, // al;.uniform high
9   0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // p vec4 u_imageLo
10   0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // dEnabled;.unifor
11   0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, // m lowp samplerCu
12   0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, // be s_texColor;.v
13   0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // oid main ().{. 
14   0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar
15   0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // _1;.  tmpvar_1.x
16   0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, // yz = textureCube
17   0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // Lod    (s_texCol
18   0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, // or, v_normal, u_
19   0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, // imageLodEnabled.
20   0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // x).xyz;.  tmpvar
21   0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, // _1.w = (0.2 + (0
22   0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // .8 * u_imageLodE
23   0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // nabled.y));.  gl
24   0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
25   0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                               // var_1;.}...
4026};
4127static const uint8_t fs_imgui_cubemap_dx9[373] =
4228{
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
r245570r245571
1static const uint8_t fs_imgui_image_glsl[567] =
1static const uint8_t fs_imgui_image_glsl[360] =
22{
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..(...lo
4   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low
5   0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // _texture2DLod   
6   0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // (lowp sampler2D
7   0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // sampler, highp v
8   0x65, 0x63, 0x32, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // ec2 coord, mediu
9   0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x7b, 0x0a, // mp float lod).{.
10   0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x47, 0x4c, 0x5f, 0x45, // #if defined(GL_E
11   0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // XT_shader_textur
12   0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, // e_lod)..return t
13   0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, // exture2DLod   (s
14   0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, // ampler, coord, l
15   0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // od);.#else..retu
16   0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x28, 0x73, 0x61, 0x6d, // rn texture2D(sam
17   0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, // pler, coord, lod
18   0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, // );.#endif.}..var
19   0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ying highp vec2
20   0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni
21   0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // form highp vec4
22   0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
23   0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // d;.uniform sampl
24   0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // er2D s_texColor;
25   0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.
26   0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, //   lowp vec4 tmpv
27   0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;.  tmpvar_1
28   0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, // .xyz = impl_low_
29   0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, // texture2DLod   
30   0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, // (s_texColor, v_t
31   0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // excoord0, u_imag
32   0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, // eLodEnabled.x).x
33   0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, // yz;.  tmpvar_1.w
34   0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, //  = (0.2 + (0.8 *
35   0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, //  u_imageLodEnabl
36   0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // ed.y));.  gl_Fra
37   0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // gColor = tmpvar_
38   0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                       // 1;.}...
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
4   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
5   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
6   0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...0...varying h
7   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
8   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
9   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
10   0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni
11   0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, // form sampler2D s
12   0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // _texColor;.void
13   0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // main ().{.  lowp
14   0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, //  vec4 tmpvar_1;.
15   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, //   tmpvar_1.xyz =
16   0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, //  texture2DLod   
17   0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, //  (s_texColor, v_
18   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, // texcoord0, u_ima
19   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, // geLodEnabled.x).
20   0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // xyz;.  tmpvar_1.
21   0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, // w = (0.2 + (0.8
22   0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // * u_imageLodEnab
23   0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // led.y));.  gl_Fr
24   0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar
25   0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                 // _1;.}...
3926};
4027static const uint8_t fs_imgui_image_dx9[377] =
4128{
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
r245570r245571
1static const uint8_t fs_imgui_image_swizz_glsl[616] =
1static const uint8_t fs_imgui_image_swizz_glsl[425] =
22{
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..Y...lo
4   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low
5   0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // _texture2DLod   
6   0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // (lowp sampler2D
7   0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // sampler, highp v
8   0x65, 0x63, 0x32, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // ec2 coord, mediu
9   0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x7b, 0x0a, // mp float lod).{.
10   0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x47, 0x4c, 0x5f, 0x45, // #if defined(GL_E
11   0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // XT_shader_textur
12   0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, // e_lod)..return t
13   0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, // exture2DLod   (s
14   0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, // ampler, coord, l
15   0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // od);.#else..retu
16   0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x28, 0x73, 0x61, 0x6d, // rn texture2D(sam
17   0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, // pler, coord, lod
18   0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, // );.#endif.}..var
19   0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ying highp vec2
20   0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
4   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
5   0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, // ...u_swizzle....
6   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
7   0x00, 0x01, 0x00, 0x61, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...a...varying h
8   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
9   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
10   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
11   0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni
2112   0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // form highp vec4
22   0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
23   0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // d;.uniform highp
24   0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, //  vec4 u_swizzle;
25   0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // .uniform sampler
26   0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, // 2D s_texColor;.v
27   0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // oid main ().{. 
28   0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar
29   0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // _1;.  tmpvar_1.x
30   0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x69, // yz = vec3(dot (i
31   0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // mpl_low_texture2
32   0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // DLod    (s_texCo
33   0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // lor, v_texcoord0
34   0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // , u_imageLodEnab
35   0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, // led.x), u_swizzl
36   0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // e));.  tmpvar_1.
37   0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, // w = (0.2 + (0.8
38   0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // * u_imageLodEnab
39   0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // led.y));.  gl_Fr
40   0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar
41   0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                 // _1;.}...
13   0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // u_swizzle;.unifo
14   0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, // rm sampler2D s_t
15   0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // exColor;.void ma
16   0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // in ().{.  lowp v
17   0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;. 
18   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, // tmpvar_1.xyz = v
19   0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ec3(dot (texture
20   0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // 2DLod    (s_texC
21   0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // olor, v_texcoord
22   0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // 0, u_imageLodEna
23   0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // bled.x), u_swizz
24   0x6c, 0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // le));.  tmpvar_1
25   0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8
26   0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, //  * u_imageLodEna
27   0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));.  gl_F
28   0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
29   0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                           // r_1;.}...
4230};
4331static const uint8_t fs_imgui_image_swizz_dx9[441] =
4432{
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
r245570r245571
1static const uint8_t fs_imgui_latlong_glsl[866] =
1static const uint8_t fs_imgui_latlong_glsl[649] =
22{
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x53, 0x03, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..S...lo
4   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low
5   0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, // _textureCubeLod
6   0x20, 0x20, 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, //   (lowp samplerC
7   0x75, 0x62, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, // ube sampler, hig
8   0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, // hp vec3 coord, m
9   0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, // ediump float lod
10   0x29, 0x0a, 0x7b, 0x0a, 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, // ).{.#if defined(
11   0x47, 0x4c, 0x5f, 0x45, 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, // GL_EXT_shader_te
12   0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // xture_lod)..retu
13   0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // rn textureCubeLo
14   0x64, 0x20, 0x20, 0x20, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // d   (sampler, co
15   0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, // ord, lod);.#else
16   0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ..return texture
17   0x43, 0x75, 0x62, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // Cube(sampler, co
18   0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, // ord, lod);.#endi
19   0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, // f.}..varying hig
20   0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // hp vec2 v_texcoo
21   0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, // rd0;.uniform hig
22   0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, // hp vec4 u_imageL
23   0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // odEnabled;.unifo
24   0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // rm lowp samplerC
25   0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube s_texColor;.
26   0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{.
27   0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, 0x73, 0x75, //  highp vec3 resu
28   0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // lt_1;.  highp fl
29   0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_2;. 
30   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, // tmpvar_2 = (v_te
31   0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, 0x32, 0x38, // xcoord0.x * 6.28
32   0x33, 0x31, 0x38, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, // 3185);.  highp f
33   0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // loat tmpvar_3;.
34   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x74, //  tmpvar_3 = (v_t
35   0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, 0x31, // excoord0.y * 3.1
36   0x34, 0x31, 0x35, 0x39, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 41593);.  result
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
4   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
5   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
6   0x00, 0x01, 0x00, 0x51, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...Q...varying h
7   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
8   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
9   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
10   0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni
11   0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // form lowp sample
12   0x72, 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // rCube s_texColor
13   0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{
14   0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, // .  highp vec3 re
15   0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // sult_1;.  highp
16   0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // float tmpvar_2;.
17   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, //   tmpvar_2 = (v_
18   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, // texcoord0.x * 6.
19   0x32, 0x38, 0x33, 0x31, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 28319);.  highp
20   0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, // float tmpvar_3;.
21   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, //   tmpvar_3 = (v_
22   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
23   0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);.  result
3724   0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, // _1.x = (-(sin(tm
3825   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, // pvar_3)) * sin(t
3926   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, // mpvar_2));.  res
r245570r245571
4431   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // tmpvar_2));.  lo
4532   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // wp vec4 tmpvar_4
4633   0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, // ;.  tmpvar_4.xyz
47   0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, //  = impl_low_text
48   0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, // ureCubeLod    (s
49   0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // _texColor, resul
50   0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // t_1, u_imageLodE
51   0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // nabled.x).xyz;.
52   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, //  tmpvar_4.w = (0
53   0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, // .2 + (0.8 * u_im
54   0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, // ageLodEnabled.y)
55   0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );.  gl_FragColo
56   0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_4;.}.
57   0x0a, 0x00,                                                                                     // ..
34   0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, //  = textureCubeLo
35   0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // d    (s_texColor
36   0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, // , result_1, u_im
37   0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, // ageLodEnabled.x)
38   0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // .xyz;.  tmpvar_4
39   0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8
40   0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, //  * u_imageLodEna
41   0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));.  gl_F
42   0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
43   0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                           // r_4;.}...
5844};
5945static const uint8_t fs_imgui_latlong_dx9[537] =
6046{
trunk/3rdparty/bgfx/examples/common/imgui/imgui.cpp
r245570r245571
456456         }
457457      }
458458
459      return bgfx::createTexture2D(uint16_t(_width), uint16_t(_height), 0, bgfx::TextureFormat::BGRA8, 0, mem);
459      return bgfx::createTexture2D(_width, _height, 0, bgfx::TextureFormat::BGRA8, 0, mem);
460460   }
461461
462462   ImguiFontHandle create(const void* _data, uint32_t _size, float _fontSize)
r245570r245571
910910      Area& area = getCurrentArea();
911911
912912      const uint16_t parentBottom = parentArea.m_scissorY + parentArea.m_scissorHeight;
913      const uint16_t childBottom = parentArea.m_widgetY + _height;
913      const uint16_t childBottom = parentArea.m_widgetY + _height;
914914      const uint16_t bottom = IMGUI_MIN(childBottom, parentBottom);
915915
916916      const uint16_t top = IMGUI_MAX(parentArea.m_widgetY, parentArea.m_scissorY);
trunk/3rdparty/bgfx/examples/common/imgui/makefile
r245570r245571
55
66include ../../../scripts/shader-embeded.mk
77
8droidsans.ttf.h: ../../runtime/font/droidsans.ttf
9   @bin2c -f $(<) -o $(@) -n s_droidSansTtf
8droidsans.ttf.h: ../runtime/font/droidsans.ttf
9   bin2c -f $(<) -o $(@) -n s_droidSansTtf
1010
1111rebuild: droidsans.ttf.h
1212   @make -s --no-print-directory clean all
trunk/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
r245570r245571
8686      ImGuiIO& io = ImGui::GetIO();
8787      io.DisplaySize = ImVec2(1280.0f, 720.0f);
8888      io.DeltaTime = 1.0f / 60.0f;
89      io.IniFilename = NULL;
9089//      io.PixelCenterOffset = bgfx::RendererType::Direct3D9 == bgfx::getRendererType() ? -0.5f : 0.0f;
9190
9291      const bgfx::Memory* vsmem;
trunk/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
r245570r245571
1010   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
1111   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
1212   0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // ighp mat4 u_mode
13   0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void
13   0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void
1414   0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // main ().{.  high
1515   0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // p vec4 tmpvar_1;
16   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // .  tmpvar_1.w =
16   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // .  tmpvar_1.w =
1717   0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // 1.0;.  tmpvar_1.
1818   0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // xyz = a_position
19   0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;.  gl_Position
19   0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;.  gl_Position
2020   0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // = (u_modelViewPr
2121   0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, // oj * tmpvar_1);.
22   0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, //   v_texcoord0 =
22   0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, //   v_texcoord0 =
2323   0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // a_texcoord0;.}..
2424   0x00,                                                                                           // .
2525};
trunk/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
r245570r245571
3636
3737BX_PRAGMA_DIAGNOSTIC_PUSH();
3838BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers");
39BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
4039#define STB_IMAGE_IMPLEMENTATION
4140#include <stb/stb_image.c>
4241BX_PRAGMA_DIAGNOSTIC_POP();
r245570r245571
413412   {
414413      cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u;
415414   }
416
415   
417416   return cint;
418417}
419418
r245570r245571
935934   }
936935
937936   // Transform the current scissor rect into current transform space.
938   // If there is difference in rotation, this will be approximation.
937   // If there is difference in rotation, this will be approximation.
939938   memcpy(pxform, state->scissor.xform, sizeof(float)*6);
940939   ex = state->scissor.extent[0];
941940   ey = state->scissor.extent[1];
r245570r245571
11951194{
11961195   float x12,y12,x23,y23,x34,y34,x123,y123,x234,y234,x1234,y1234;
11971196   float dx,dy,d2,d3;
1198
1197   
11991198   if (level > 10) return;
12001199
12011200   x12 = (x1+x2)*0.5f;
r245570r245571
12271226   x1234 = (x123+x234)*0.5f;
12281227   y1234 = (y123+y234)*0.5f;
12291228
1230   nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0);
1231   nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type);
1229   nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0);
1230   nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type);
12321231}
12331232
12341233static void nvg__flattenPaths(NVGcontext* ctx)
r245570r245571
16261625
16271626
16281627static int nvg__expandStroke(NVGcontext* ctx, float w, int lineCap, int lineJoin, float miterLimit)
1629{
1628{   
16301629   NVGpathCache* cache = ctx->cache;
16311630   NVGvertex* verts;
16321631   NVGvertex* dst;
r245570r245571
18901889{
18911890    float x0 = ctx->commandx;
18921891    float y0 = ctx->commandy;
1893    float vals[] = { NVG_BEZIERTO,
1892    float vals[] = { NVG_BEZIERTO,
18941893        x0 + 2.0f/3.0f*(cx - x0), y0 + 2.0f/3.0f*(cy - y0),
18951894        x + 2.0f/3.0f*(cx - x), y + 2.0f/3.0f*(cy - y),
18961895        x, y };
r245570r245571
19721971   float px = 0, py = 0, ptanx = 0, ptany = 0;
19731972   float vals[3 + 5*7 + 100];
19741973   int i, ndivs, nvals;
1975   int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO;
1974   int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO;
19761975
19771976   // Clamp angles
19781977   da = a1 - a0;
r245570r245571
23652364      }
23662365   }
23672366
2368   // TODO: add back-end bit to do this just once per frame.
2367   // TODO: add back-end bit to do this just once per frame.
23692368   nvg__flushTextTexture(ctx);
23702369
23712370   nvg__renderText(ctx, verts, nverts);
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin
r245570r245571
11FSH9Ȟâ
2u_texColor u_texNormalu_lightPosRadiusu_lightRgbInnerROvarying highp vec3 v_bitangent;
2u_texColor u_texNormalu_lightPosRadiusu_lightRgbInnerRLvarying highp vec3 v_bitangent;
33varying highp vec3 v_normal;
44varying highp vec3 v_tangent;
55varying highp vec2 v_texcoord0;
r245570r245571
131131  gl_FragColor.xyz = (tmpvar_34 * tmpvar_33);
132132  gl_FragColor.w = 1.0;
133133  mediump vec4 tmpvar_35;
134  tmpvar_35.xyz = pow (abs(gl_FragColor.xyz), vec3(0.4545454, 0.4545454, 0.4545454));
134  tmpvar_35.xyz = pow (abs(gl_FragColor.xyz), vec3(0.454545, 0.454545, 0.454545));
135135  tmpvar_35.w = gl_FragColor.w;
136136  gl_FragColor = tmpvar_35;
137137}
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin
r245570r245571
1FSH„£Üüàvarying highp vec4 v_color0;
1FSH„£ÜüÜvarying highp vec4 v_color0;
22varying highp vec3 v_world;
33void main ()
44{
r245570r245571
1414  )).z, 0.0);
1515  gl_FragColor = pow (((
1616    pow (v_color0, vec4(2.2, 2.2, 2.2, 2.2))
17   * tmpvar_3) + pow (tmpvar_3, 30.0)), vec4(0.4545454, 0.4545454, 0.4545454, 0.4545454));
17   * tmpvar_3) + pow (tmpvar_3, 30.0)), vec4(0.454545, 0.454545, 0.454545, 0.454545));
1818}
1919
2020
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin
r245570r245571
1FSHo><s_albedos_light×varying highp vec2 v_texcoord0;
1FSHo><s_albedos_light¤varying highp vec2 v_texcoord0;
22uniform sampler2D s_albedo;
33uniform sampler2D s_light;
44void main ()
r245570r245571
1515  tmpvar_4.w = tmpvar_3.w;
1616  lowp vec4 _rgba_5;
1717  _rgba_5 = (tmpvar_2 * tmpvar_4);
18  lowp vec3 tmpvar_6;
19  tmpvar_6 = pow (abs(_rgba_5.xyz), vec3(0.4545454, 0.4545454, 0.4545454));
20  mediump vec4 tmpvar_7;
21  tmpvar_7.xyz = tmpvar_6;
22  tmpvar_7.w = _rgba_5.w;
23  gl_FragColor = tmpvar_7;
18  lowp vec4 tmpvar_6;
19  tmpvar_6.xyz = pow (abs(_rgba_5.xyz), vec3(0.454545, 0.454545, 0.454545));
20  tmpvar_6.w = _rgba_5.w;
21  gl_FragColor = tmpvar_6;
2422}
2523
2624
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin
r245570r245571
11FSH9Ȟâ   u_invView   
2s_texColor s_texNormalÛvarying highp vec3 v_bitangent;
2s_texColor s_texNormal«varying highp vec3 v_bitangent;
33varying highp vec3 v_normal;
44varying highp vec3 v_tangent;
55varying highp vec2 v_texcoord0;
r245570r245571
2424  lowp vec4 tmpvar_5;
2525  tmpvar_5 = texture2D (s_texColor, v_texcoord0);
2626  gl_FragData[0] = tmpvar_5;
27  lowp vec3 tmpvar_6;
28  tmpvar_6 = ((normalize(
27  lowp vec4 tmpvar_6;
28  tmpvar_6.w = 1.0;
29  tmpvar_6.xyz = ((normalize(
2930    (u_invView * tmpvar_4)
3031  .xyz) * 0.5) + 0.5);
31  mediump vec4 tmpvar_7;
32  tmpvar_7.w = 1.0;
33  tmpvar_7.xyz = tmpvar_6;
34  gl_FragData[1] = tmpvar_7;
32  gl_FragData[1] = tmpvar_6;
3533}
3634
3735
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin
r245570r245571
1FSHo><u_view   s_normals_depthu_lightPosRadiusu_lightRgbInnerRu_mtx   Ïvarying highp vec2 v_texcoord0;
1FSHo><u_view   s_normals_depthu_lightPosRadiusu_lightRgbInnerRu_mtx   Ìvarying highp vec2 v_texcoord0;
22uniform highp mat4 u_view;
33uniform sampler2D s_normal;
44uniform sampler2D s_depth;
r245570r245571
5252    (1.0 - (tmpvar_9 * (tmpvar_9 * (3.0 -
5353      (2.0 * tmpvar_9)
5454    ))))
55  )), vec3(0.4545454, 0.4545454, 0.4545454));
55  )), vec3(0.454545, 0.454545, 0.454545));
5656  gl_FragColor.xyz = tmpvar_14;
5757  gl_FragColor.w = 1.0;
5858}
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin
r245570r245571
11FSHÛãûì>
2u_texColorŸvarying highp vec2 v_texcoord0;
2u_texColor–varying highp vec2 v_texcoord0;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
55varying highp vec4 v_texcoord3;
r245570r245571
88void main ()
99{
1010  lowp vec4 blur_1;
11  blur_1 = (texture2D (u_texColor, v_texcoord0) * 0.2242152);
12  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord1.xy) * 0.2017937));
13  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord1.zw) * 0.2017937));
14  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord2.xy) * 0.1233184));
15  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord2.zw) * 0.1233184));
16  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord3.xy) * 0.04035874));
17  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord3.zw) * 0.04035874));
18  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord4.xy) * 0.02242152));
19  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord4.zw) * 0.02242152));
11  blur_1 = (texture2D (u_texColor, v_texcoord0) * 0.224215);
12  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord1.xy) * 0.201794));
13  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord1.zw) * 0.201794));
14  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord2.xy) * 0.123318));
15  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord2.zw) * 0.123318));
16  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord3.xy) * 0.0403587));
17  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord3.zw) * 0.0403587));
18  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord4.xy) * 0.0224215));
19  blur_1 = (blur_1 + (texture2D (u_texColor, v_texcoord4.zw) * 0.0224215));
2020  gl_FragColor = blur_1;
2121}
2222
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin
r245570r245571
11FSHo><u_offset   u_tonemap
2u_texColoru_texLum1   varying highp vec2 v_texcoord0;
2u_texColoru_texLumúvarying highp vec2 v_texcoord0;
33uniform vec4 u_offset[16];
44uniform highp vec4 u_tonemap;
55uniform sampler2D u_texColor;
r245570r245571
5454  rgb_1 = (rgb_1 + (tmpvar_11.xyz * exp2(
5555    ((tmpvar_11.w * 255.0) - 128.0)
5656  )));
57  rgb_1 = (rgb_1 * 0.1111111);
57  rgb_1 = (rgb_1 * 0.111111);
5858  rgb_1 = ((max (vec3(0.0, 0.0, 0.0),
5959    (rgb_1 - u_tonemap.z)
6060  ) * u_tonemap.x) / (clamp (
r245570r245571
6565    (rgb_1 / u_tonemap.y)
6666  )) / (1.0 + rgb_1));
6767  rgb_1 = tmpvar_12;
68  lowp vec3 tmpvar_13;
69  tmpvar_13 = pow (abs(tmpvar_12), vec3(0.4545454, 0.4545454, 0.4545454));
70  mediump vec4 tmpvar_14;
71  tmpvar_14.xyz = tmpvar_13;
72  tmpvar_14.w = 1.0;
73  gl_FragColor = tmpvar_14;
68  lowp vec4 tmpvar_13;
69  tmpvar_13.xyz = pow (abs(tmpvar_12), vec3(0.454545, 0.454545, 0.454545));
70  tmpvar_13.w = 1.0;
71  gl_FragColor = tmpvar_13;
7472}
7573
7674
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin
r245570r245571
11FSHo><u_offset
2u_texColor   varying highp vec2 v_texcoord0;
2u_texColorÁvarying highp vec2 v_texcoord0;
33uniform vec4 u_offset[16];
44uniform sampler2D u_texColor;
55void main ()
r245570r245571
2424  lowp vec4 tmpvar_10;
2525  tmpvar_10 = texture2D (u_texColor, (v_texcoord0 + u_offset[8].xy));
2626  avg_1 = (((
27    (dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_2.xyz * exp2(
27    (dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_2.xyz * exp2(
2828      ((tmpvar_2.w * 255.0) - 128.0)
29    ))) + dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_3.xyz * exp2(
29    ))) + dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_3.xyz * exp2(
3030      ((tmpvar_3.w * 255.0) - 128.0)
3131    ))))
3232   +
33    (dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_4.xyz * exp2(
33    (dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_4.xyz * exp2(
3434      ((tmpvar_4.w * 255.0) - 128.0)
35    ))) + dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_5.xyz * exp2(
35    ))) + dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_5.xyz * exp2(
3636      ((tmpvar_5.w * 255.0) - 128.0)
3737    ))))
3838  ) + (
39    (dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_6.xyz * exp2(
39    (dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_6.xyz * exp2(
4040      ((tmpvar_6.w * 255.0) - 128.0)
41    ))) + dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_7.xyz * exp2(
41    ))) + dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_7.xyz * exp2(
4242      ((tmpvar_7.w * 255.0) - 128.0)
4343    ))))
4444   +
45    ((dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_8.xyz *
45    ((dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_8.xyz *
4646      exp2(((tmpvar_8.w * 255.0) - 128.0))
47    )) + dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_9.xyz *
47    )) + dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_9.xyz *
4848      exp2(((tmpvar_9.w * 255.0) - 128.0))
49    ))) + dot (vec3(0.2126729, 0.7151522, 0.072175), (tmpvar_10.xyz * exp2(
49    ))) + dot (vec3(0.212673, 0.715152, 0.072175), (tmpvar_10.xyz * exp2(
5050      ((tmpvar_10.w * 255.0) - 128.0)
5151    ))))
52  )) * 0.1111111);
52  )) * 0.111111);
5353  lowp float tmpvar_11;
5454  tmpvar_11 = ceil(log2(avg_1));
55  lowp float tmpvar_12;
56  tmpvar_12 = exp2(tmpvar_11);
57  mediump vec4 tmpvar_13;
58  tmpvar_13.yz = vec2(0.0, 0.0);
59  tmpvar_13.x = (avg_1 / tmpvar_12);
60  tmpvar_13.w = ((tmpvar_11 + 128.0) / 255.0);
61  gl_FragColor = tmpvar_13;
55  lowp vec4 tmpvar_12;
56  tmpvar_12.yz = vec2(0.0, 0.0);
57  tmpvar_12.x = (avg_1 / exp2(tmpvar_11));
58  tmpvar_12.w = ((tmpvar_11 + 128.0) / 255.0);
59  gl_FragColor = tmpvar_12;
6260}
6361
6462
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin
r245570r245571
11FSHo><u_offset
2u_texColor£ varying highp vec2 v_texcoord0;
2u_texColoro varying highp vec2 v_texcoord0;
33uniform vec4 u_offset[16];
44uniform sampler2D u_texColor;
55void main ()
r245570r245571
8888  tmpvar_18 = (sum_1 / 16.0);
8989  lowp float tmpvar_19;
9090  tmpvar_19 = ceil(log2(tmpvar_18));
91  lowp float tmpvar_20;
92  tmpvar_20 = exp2(tmpvar_19);
93  mediump vec4 tmpvar_21;
94  tmpvar_21.yz = vec2(0.0, 0.0);
95  tmpvar_21.x = (tmpvar_18 / tmpvar_20);
96  tmpvar_21.w = ((tmpvar_19 + 128.0) / 255.0);
97  gl_FragColor = tmpvar_21;
91  lowp vec4 tmpvar_20;
92  tmpvar_20.yz = vec2(0.0, 0.0);
93  tmpvar_20.x = (tmpvar_18 / exp2(tmpvar_19));
94  tmpvar_20.w = ((tmpvar_19 + 128.0) / 255.0);
95  gl_FragColor = tmpvar_20;
9896}
9997
10098
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin
r245570r245571
1FSH6­Šu_time   u_texCubeÅvarying highp vec3 v_normal;
1FSH6­Šu_time   u_texCube’varying highp vec3 v_normal;
22varying highp vec3 v_pos;
33varying highp vec3 v_view;
44uniform highp float u_time;
r245570r245571
3333     + u_time)) * 0.4) + 0.6)
3434  ) + (
3535    (cos(((v_pos.z * 3.0) + u_time)) * 0.2)
36   + 0.8)) * 3.141593);
37  lowp vec3 tmpvar_8;
36   + 0.8)) * 3.14159);
37  highp vec3 tmpvar_8;
3838  tmpvar_8.x = ((sin(
3939    (tmpvar_7 * 8.0)
4040  ) * 0.4) + 0.6);
r245570r245571
4646  ) * 0.4) + 0.6);
4747  highp vec3 N_9;
4848  N_9 = -(tmpvar_1);
49  mediump vec4 tmpvar_10;
50  lowp vec3 _rgb_11;
51  _rgb_11 = (((tmpvar_8 * textureCube (u_texCube,
49  lowp vec3 _rgb_10;
50  _rgb_10 = (((tmpvar_8 * textureCube (u_texCube,
5251    (tmpvar_2 - (2.0 * (dot (N_9, tmpvar_2) * N_9)))
5352  ).xyz) * tmpvar_5) + (max (
5453    (0.2 + (0.8 * pow ((1.0 - tmpvar_3), 5.0)))
5554  , 0.0) * pow (tmpvar_6.z, 128.0)));
56  lowp vec4 rgbe8_12;
57  lowp float tmpvar_13;
58  tmpvar_13 = ceil(log2(max (
59    max (_rgb_11.x, _rgb_11.y)
60  , _rgb_11.z)));
61  rgbe8_12.xyz = (_rgb_11 / exp2(tmpvar_13));
62  rgbe8_12.w = ((tmpvar_13 + 128.0) / 255.0);
63  tmpvar_10 = rgbe8_12;
64  gl_FragColor = tmpvar_10;
55  lowp vec4 rgbe8_11;
56  lowp float tmpvar_12;
57  tmpvar_12 = ceil(log2(max (
58    max (_rgb_10.x, _rgb_10.y)
59  , _rgb_10.z)));
60  rgbe8_11.xyz = (_rgb_10 / exp2(tmpvar_12));
61  rgbe8_11.w = ((tmpvar_12 + 128.0) / 255.0);
62  gl_FragColor = rgbe8_11;
6563}
6664
6765
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin
r245570r245571
1FSHo><   u_texCubeu_mtx   ‘varying highp vec2 v_texcoord0;
1FSHo><   u_texCubeu_mtx   avarying highp vec2 v_texcoord0;
22uniform lowp samplerCube u_texCube;
33uniform highp mat4 u_mtx;
44void main ()
r245570r245571
1111  tmpvar_2.xyz = tmpvar_1;
1212  lowp vec4 tmpvar_3;
1313  tmpvar_3 = textureCube (u_texCube, normalize((u_mtx * tmpvar_2).xyz));
14  mediump vec4 tmpvar_4;
15  lowp vec4 rgbe8_5;
16  lowp float tmpvar_6;
17  tmpvar_6 = ceil(log2(max (
14  lowp vec4 rgbe8_4;
15  lowp float tmpvar_5;
16  tmpvar_5 = ceil(log2(max (
1817    max (tmpvar_3.x, tmpvar_3.y)
1918  , tmpvar_3.z)));
20  rgbe8_5.xyz = (tmpvar_3.xyz / exp2(tmpvar_6));
21  rgbe8_5.w = ((tmpvar_6 + 128.0) / 255.0);
22  tmpvar_4 = rgbe8_5;
23  gl_FragColor = tmpvar_4;
19  rgbe8_4.xyz = (tmpvar_3.xyz / exp2(tmpvar_5));
20  rgbe8_4.w = ((tmpvar_5 + 128.0) / 255.0);
21  gl_FragColor = rgbe8_4;
2422}
2523
2624
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin
r245570r245571
11FSHÛãûì   u_tonemap
2u_texColoru_texLum   u_texBlurC
3varying highp vec2 v_texcoord0;
2u_texColoru_texLum   u_texBlurø   varying highp vec2 v_texcoord0;
43varying highp vec4 v_texcoord1;
54varying highp vec4 v_texcoord2;
65varying highp vec4 v_texcoord3;
r245570r245571
2120  lowp vec4 tmpvar_4;
2221  tmpvar_4 = texture2D (u_texLum, v_texcoord0);
2322  lowp vec3 xyz_5;
24  xyz_5.x = dot (vec3(0.4124564, 0.3575761, 0.1804375), tmpvar_3);
25  xyz_5.y = dot (vec3(0.2126729, 0.7151522, 0.072175), tmpvar_3);
26  xyz_5.z = dot (vec3(0.0193339, 0.119192, 0.9503041), tmpvar_3);
23  xyz_5.x = dot (vec3(0.412456, 0.357576, 0.180438), tmpvar_3);
24  xyz_5.y = dot (vec3(0.212673, 0.715152, 0.072175), tmpvar_3);
25  xyz_5.z = dot (vec3(0.0193339, 0.119192, 0.950304), tmpvar_3);
2726  lowp float tmpvar_6;
2827  tmpvar_6 = (1.0/(dot (xyz_5, vec3(1.0, 1.0, 1.0))));
2928  lowp vec3 tmpvar_7;
r245570r245571
4544    (1.0 - tmpvar_7.y)
4645   - tmpvar_7.z)) / tmpvar_7.z);
4746  lowp vec3 rgb_10;
48  rgb_10.x = dot (vec3(3.240454, -1.537138, -0.4985314), xyz_9);
49  rgb_10.y = dot (vec3(-0.969266, 1.876011, 0.041556), xyz_9);
50  rgb_10.z = dot (vec3(0.0556434, -0.2040259, 1.057225), xyz_9);
47  rgb_10.x = dot (vec3(3.24045, -1.53714, -0.498531), xyz_9);
48  rgb_10.y = dot (vec3(-0.969266, 1.87601, 0.041556), xyz_9);
49  rgb_10.z = dot (vec3(0.0556434, -0.204026, 1.05723), xyz_9);
5150  lowp vec4 blur_11;
52  blur_11 = (texture2D (u_texBlur, v_texcoord0) * 0.2242152);
53  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord1.xy) * 0.2017937));
54  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord1.zw) * 0.2017937));
55  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord2.xy) * 0.1233184));
56  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord2.zw) * 0.1233184));
57  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord3.xy) * 0.04035874));
58  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord3.zw) * 0.04035874));
59  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord4.xy) * 0.02242152));
60  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord4.zw) * 0.02242152));
51  blur_11 = (texture2D (u_texBlur, v_texcoord0) * 0.224215);
52  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord1.xy) * 0.201794));
53  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord1.zw) * 0.201794));
54  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord2.xy) * 0.123318));
55  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord2.zw) * 0.123318));
56  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord3.xy) * 0.0403587));
57  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord3.zw) * 0.0403587));
58  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord4.xy) * 0.0224215));
59  blur_11 = (blur_11 + (texture2D (u_texBlur, v_texcoord4.zw) * 0.0224215));
6160  lowp vec4 tmpvar_12;
6261  tmpvar_12.w = 1.0;
6362  tmpvar_12.xyz = (rgb_10 + (0.6 * blur_11.xyz));
64  lowp vec3 tmpvar_13;
65  tmpvar_13 = pow (abs(tmpvar_12.xyz), vec3(0.4545454, 0.4545454, 0.4545454));
66  mediump vec4 tmpvar_14;
67  tmpvar_14.xyz = tmpvar_13;
68  tmpvar_14.w = 1.0;
69  gl_FragColor = tmpvar_14;
63  lowp vec4 tmpvar_13;
64  tmpvar_13.xyz = pow (abs(tmpvar_12.xyz), vec3(0.454545, 0.454545, 0.454545));
65  tmpvar_13.w = 1.0;
66  gl_FragColor = tmpvar_13;
7067}
7168
7269
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
r245570r245571
1FSHR{öUlowp vec4 impl_low_textureCubeLod   (lowp samplerCube sampler, highp vec3 coord, mediump float lod)
2{
3#if defined(GL_EXT_shader_texture_lod)
4   return textureCubeLod   (sampler, coord, lod);
5#else
6   return textureCube(sampler, coord, lod);
7#endif
8}
9
10varying highp vec3 v_normal;
1FSHR{öu_paramsu_mtx   u_flags   u_rgbDiff   u_rgbSpec   u_texCube u_texCubeIrrUvarying highp vec3 v_normal;
112varying highp vec3 v_view;
123uniform highp vec4 u_params;
134uniform highp mat4 u_mtx;
r245570r245571
4940      normalize((u_mtx * tmpvar_5).xyz)
5041    ).xyz) * u_flags.z) + ((
5142      (tmpvar_6 + ((1.0 - tmpvar_6) * pow ((1.0 - tmpvar_3), 5.0)))
52     * impl_low_textureCubeLod    (u_texCube,
43     * textureCubeLod    (u_texCube,
5344      normalize((u_mtx * tmpvar_4).xyz)
5445    ,
5546      min ((((1.0 - u_params.x) * 11.0) + 1.0), 8.0)
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
r245570r245571
1FSHÀmA5lowp vec4 impl_low_textureCubeLod   (lowp samplerCube sampler, highp vec3 coord, mediump float lod)
2{
3#if defined(GL_EXT_shader_texture_lod)
4   return textureCubeLod   (sampler, coord, lod);
5#else
6   return textureCube(sampler, coord, lod);
7#endif
8}
9
10varying highp vec3 v_dir;
1FSHÀmA5   u_texCubeu_paramsôvarying highp vec3 v_dir;
112uniform lowp samplerCube u_texCube;
123uniform highp vec4 u_params;
134void main ()
145{
156  lowp vec4 color_1;
16  color_1 = (impl_low_textureCubeLod    (u_texCube, normalize(v_dir), 0.0) * exp2(u_params.y));
17  lowp vec3 _rgb_2;
18  lowp vec3 tmpvar_3;
19  tmpvar_3 = max (vec3(0.0, 0.0, 0.0), (color_1.xyz - 0.004));
20  _rgb_2 = ((tmpvar_3 * (
21    (6.2 * tmpvar_3)
22   + 0.5)) / ((tmpvar_3 *
23    ((6.2 * tmpvar_3) + 1.7)
7  color_1 = (textureCubeLod    (u_texCube, normalize(v_dir), 0.0) * exp2(u_params.y));
8  lowp vec3 tmpvar_2;
9  tmpvar_2 = max (vec3(0.0, 0.0, 0.0), (color_1.xyz - 0.004));
10  lowp vec4 tmpvar_3;
11  tmpvar_3.xyz = ((tmpvar_2 * (
12    (6.2 * tmpvar_2)
13   + 0.5)) / ((tmpvar_2 *
14    ((6.2 * tmpvar_2) + 1.7)
2415  ) + 0.06));
25  mediump vec4 tmpvar_4;
26  tmpvar_4.xyz = _rgb_2;
27  tmpvar_4.w = color_1.w;
28  gl_FragColor = tmpvar_4;
16  tmpvar_3.w = color_1.w;
17  gl_FragColor = tmpvar_3;
2918}
3019
3120
No newline at end of file
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin
r245570r245571
1FSH•Eûu_timejvarying highp vec4 v_color0;
1FSH•Eûu_timefvarying highp vec4 v_color0;
22varying highp vec3 v_normal;
33varying highp vec3 v_pos;
44varying highp vec3 v_view;
r245570r245571
3131     + u_time)) * 0.4) + 0.6)
3232  ) + (
3333    (cos(((v_pos.z * 3.0) + u_time)) * 0.2)
34   + 0.8)) * 3.141593);
34   + 0.8)) * 3.14159);
3535  highp vec3 tmpvar_7;
3636  tmpvar_7.x = ((sin(
3737    (tmpvar_6 * 8.0)
r245570r245571
5050    , 5.0))), 0.0)
5151   *
5252    pow (tmpvar_5.z, 128.0)
53  )), vec3(0.4545454, 0.4545454, 0.4545454));
53  )), vec3(0.454545, 0.454545, 0.454545));
5454  gl_FragColor.w = 1.0;
5555}
5656
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
r245570r245571
1FSH½T;u_colorVvarying highp vec4 v_pos;
1FSH½T;u_colorWvarying highp vec4 v_pos;
22uniform highp vec4 u_color;
33void main ()
44{
r245570r245571
66  color_1.w = u_color.w;
77  color_1.xyz = (u_color.xyz * u_color.w);
88  gl_FragData[0] = (color_1 * (u_color.w * clamp (
9    (0.03 / (1e-5 + pow ((
9    (0.03 / (1e-05 + pow ((
1010      (v_pos.z / v_pos.w)
1111     / 200.0), 5.0)))
1212  , 0.01, 3000.0)));
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
r245570r245571
1FSH½T;u_color!varying highp vec4 v_pos;
1FSH½T;u_color"varying highp vec4 v_pos;
22uniform highp vec4 u_color;
33void main ()
44{
55  highp float tmpvar_1;
66  tmpvar_1 = (u_color.w * clamp ((0.03 /
7    (1e-5 + pow (((v_pos.z / v_pos.w) / 200.0), 5.0))
7    (1e-05 + pow (((v_pos.z / v_pos.w) / 200.0), 5.0))
88  ), 0.01, 3000.0));
99  gl_FragData[0] = (u_color * tmpvar_1);
1010  gl_FragData[1] = vec4(tmpvar_1);
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin
r245570r245571
1FSHjº¹u_paramsVvarying highp vec3 v_texCoord;
1FSHjº¹u_paramsTvarying highp vec3 v_texCoord;
22uniform vec4 u_params[3];
33void main ()
44{
5  mediump vec4 tmpvar_1;
5  highp vec4 tmpvar_1;
66  tmpvar_1.w = 1.0;
77  tmpvar_1.xyz = (mix (vec3(0.1, 0.8, 0.2), vec3(0.15, 0.125, 0.025), v_texCoord.z) * (u_params[1].x * pow (
88    max ((1.0 - sqrt(dot (v_texCoord.xy, v_texCoord.xy))), 0.0)
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin
r245570r245571
11FSHƒòáu_mtx   
2u_lightDir1varying highp vec4 v_color0;
2u_lightDir÷0varying highp vec4 v_color0;
33varying highp vec2 v_texcoord0;
44uniform highp mat4 u_mtx;
55uniform highp vec3 u_lightDir;
r245570r245571
3030  _dir_10 = tmpvar_8;
3131  highp float tt_12;
3232  tt_12 = 0.0;
33  for (highp int ii_11 = 0; ii_11 < 64; ii_11++) {
33  for (int ii_11 = 0; ii_11 < 64; ii_11++) {
3434    highp vec3 _pos_13;
3535    _pos_13 = (_ray_9 + (_dir_10 * tt_12));
3636    highp vec3 tmpvar_14;
r245570r245571
7474    tmpvar_22 = 0.0;
7575  };
7676  if ((tmpvar_22 > 0.5)) {
77    mediump float val_23;
77    highp float val_23;
7878    highp vec3 tmpvar_24;
7979    tmpvar_24 = (tmpvar_3 + (tmpvar_8 * tmpvar_22));
8080    highp vec3 _pos_25;
r245570r245571
375375        (1.0 - tmpvar_75)
376376      , 5.0))), 0.0)
377377    )) * (1.0 - occ_79));
378    mediump float tmpvar_104;
379    tmpvar_104 = pow (val_23, 0.4545454);
378    highp float tmpvar_104;
379    tmpvar_104 = pow (val_23, 0.454545);
380380    val_23 = tmpvar_104;
381    mediump vec4 tmpvar_105;
381    highp vec4 tmpvar_105;
382382    tmpvar_105.w = 1.0;
383383    tmpvar_105.x = tmpvar_104;
384384    tmpvar_105.y = tmpvar_104;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin
r245570r245571
11FSHpjH -   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap07varying highp vec3 v_normal;
2   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap01varying highp vec3 v_normal;
23varying highp vec4 v_shadowcoord;
34varying highp vec3 v_view;
45uniform highp vec4 u_params1;
r245570r245571
6767    tmpvar_15 = normalize(tmpvar_12);
6868    tmpvar_13 = tmpvar_15;
6969    highp float tmpvar_16;
70    tmpvar_16 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
70    tmpvar_16 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
7171    highp float tmpvar_17;
7272    tmpvar_17 = sqrt(dot (tmpvar_12, tmpvar_12));
7373    tmpvar_14 = ((1.0/((
r245570r245571
8181        normalize(u_lightSpotDirectionInner.xyz)
8282      )) - tmpvar_16) / (cos((
8383        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
84       * 0.01745329)) - tmpvar_16))
84       * 0.0174533)) - tmpvar_16))
8585    , 0.0, 1.0), 1.0, float(
8686      (u_lightAttenuationSpotOuter.w >= 90.0)
8787    )));
r245570r245571
106106    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
107107      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_20.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_20.y)))
108108     * u_color.xyz) * tmpvar_8)))
109  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
110    exp2(((1.767302e-5 * tmpvar_21) * tmpvar_21))
109  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
110    exp2(((1.7673e-05 * tmpvar_21) * tmpvar_21))
111111  )), 0.0, 1.0));
112112  gl_FragColor.xyz = tmpvar_22;
113113  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3k&varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3e&varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
9595      tmpvar_22 = 1.0;
9696    } else {
9797      tmpvar_22 = clamp (exp((_depthMultiplier_21 *
98        (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w))
98        (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w))
9999      )), 0.0, 1.0);
100100    };
101101    visibility_1 = tmpvar_22;
r245570r245571
135135        tmpvar_32 = 1.0;
136136      } else {
137137        tmpvar_32 = clamp (exp((_depthMultiplier_31 *
138          (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w))
138          (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w))
139139        )), 0.0, 1.0);
140140      };
141141      visibility_1 = tmpvar_32;
r245570r245571
175175          tmpvar_42 = 1.0;
176176        } else {
177177          tmpvar_42 = clamp (exp((_depthMultiplier_41 *
178            (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w))
178            (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w))
179179          )), 0.0, 1.0);
180180        };
181181        visibility_1 = tmpvar_42;
r245570r245571
214214          tmpvar_52 = 1.0;
215215        } else {
216216          tmpvar_52 = clamp (exp((_depthMultiplier_51 *
217            (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w))
217            (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w))
218218          )), 0.0, 1.0);
219219        };
220220        visibility_1 = tmpvar_52;
r245570r245571
235235    tmpvar_59 = normalize(tmpvar_56);
236236    tmpvar_57 = tmpvar_59;
237237    highp float tmpvar_60;
238    tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
238    tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
239239    highp float tmpvar_61;
240240    tmpvar_61 = sqrt(dot (tmpvar_56, tmpvar_56));
241241    tmpvar_58 = ((1.0/((
r245570r245571
249249        normalize(u_lightSpotDirectionInner.xyz)
250250      )) - tmpvar_60) / (cos((
251251        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
252       * 0.01745329)) - tmpvar_60))
252       * 0.0174533)) - tmpvar_60))
253253    , 0.0, 1.0), 1.0, float(
254254      (u_lightAttenuationSpotOuter.w >= 90.0)
255255    )));
r245570r245571
274274    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
275275      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_64.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_64.y)))
276276     * u_color.xyz) * visibility_1)))
277  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
278    exp2(((1.767302e-5 * tmpvar_65) * tmpvar_65))
277  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
278    exp2(((1.7673e-05 * tmpvar_65) * tmpvar_65))
279279  )), 0.0, 1.0));
280280  gl_FragColor.xyz = tmpvar_66;
281281  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin
r245570r245571
11FSHpjH -   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0cvarying highp vec3 v_normal;
2   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0]varying highp vec3 v_normal;
23varying highp vec4 v_shadowcoord;
34varying highp vec3 v_view;
45uniform highp vec4 u_params1;
r245570r245571
6969    tmpvar_15 = normalize(tmpvar_12);
7070    tmpvar_13 = tmpvar_15;
7171    highp float tmpvar_16;
72    tmpvar_16 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
72    tmpvar_16 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
7373    highp float tmpvar_17;
7474    tmpvar_17 = sqrt(dot (tmpvar_12, tmpvar_12));
7575    tmpvar_14 = ((1.0/((
r245570r245571
8383        normalize(u_lightSpotDirectionInner.xyz)
8484      )) - tmpvar_16) / (cos((
8585        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
86       * 0.01745329)) - tmpvar_16))
86       * 0.0174533)) - tmpvar_16))
8787    , 0.0, 1.0), 1.0, float(
8888      (u_lightAttenuationSpotOuter.w >= 90.0)
8989    )));
r245570r245571
108108    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
109109      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_20.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_20.y)))
110110     * u_color.xyz) * tmpvar_9)))
111  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
112    exp2(((1.767302e-5 * tmpvar_21) * tmpvar_21))
111  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
112    exp2(((1.7673e-05 * tmpvar_21) * tmpvar_21))
113113  )), 0.0, 1.0));
114114  gl_FragColor.xyz = tmpvar_22;
115115  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3G'varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3A'varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
9797      tmpvar_23 = 1.0;
9898    } else {
9999      tmpvar_23 = clamp (exp((_depthMultiplier_22 *
100        (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x))
100        (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x))
101101      )), 0.0, 1.0);
102102    };
103103    visibility_1 = tmpvar_23;
r245570r245571
139139        tmpvar_33 = 1.0;
140140      } else {
141141        tmpvar_33 = clamp (exp((_depthMultiplier_32 *
142          (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x))
142          (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x))
143143        )), 0.0, 1.0);
144144      };
145145      visibility_1 = tmpvar_33;
r245570r245571
181181          tmpvar_43 = 1.0;
182182        } else {
183183          tmpvar_43 = clamp (exp((_depthMultiplier_42 *
184            (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x))
184            (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x))
185185          )), 0.0, 1.0);
186186        };
187187        visibility_1 = tmpvar_43;
r245570r245571
222222          tmpvar_53 = 1.0;
223223        } else {
224224          tmpvar_53 = clamp (exp((_depthMultiplier_52 *
225            (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x))
225            (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x))
226226          )), 0.0, 1.0);
227227        };
228228        visibility_1 = tmpvar_53;
r245570r245571
243243    tmpvar_59 = normalize(tmpvar_56);
244244    tmpvar_57 = tmpvar_59;
245245    highp float tmpvar_60;
246    tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
246    tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
247247    highp float tmpvar_61;
248248    tmpvar_61 = sqrt(dot (tmpvar_56, tmpvar_56));
249249    tmpvar_58 = ((1.0/((
r245570r245571
257257        normalize(u_lightSpotDirectionInner.xyz)
258258      )) - tmpvar_60) / (cos((
259259        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
260       * 0.01745329)) - tmpvar_60))
260       * 0.0174533)) - tmpvar_60))
261261    , 0.0, 1.0), 1.0, float(
262262      (u_lightAttenuationSpotOuter.w >= 90.0)
263263    )));
r245570r245571
282282    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
283283      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_64.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_64.y)))
284284     * u_color.xyz) * visibility_1)))
285  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
286    exp2(((1.767302e-5 * tmpvar_65) * tmpvar_65))
285  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
286    exp2(((1.7673e-05 * tmpvar_65) * tmpvar_65))
287287  )), 0.0, 1.0));
288288  gl_FragColor.xyz = tmpvar_66;
289289  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0óvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0ívarying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
139139    tmpvar_31 = 1.0;
140140  } else {
141141    tmpvar_31 = clamp (exp((_depthMultiplier_30 *
142      (dot (texture2D (u_shadowMap0, tmpvar_29.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - (shadowcoord_1.z - u_params1.x))
142      (dot (texture2D (u_shadowMap0, tmpvar_29.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (shadowcoord_1.z - u_params1.x))
143143    )), 0.0, 1.0);
144144  };
145145  highp vec3 tmpvar_33;
r245570r245571
156156    tmpvar_37 = normalize(tmpvar_34);
157157    tmpvar_35 = tmpvar_37;
158158    highp float tmpvar_38;
159    tmpvar_38 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
159    tmpvar_38 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
160160    highp float tmpvar_39;
161161    tmpvar_39 = sqrt(dot (tmpvar_34, tmpvar_34));
162162    tmpvar_36 = ((1.0/((
r245570r245571
170170        normalize(u_lightSpotDirectionInner.xyz)
171171      )) - tmpvar_38) / (cos((
172172        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
173       * 0.01745329)) - tmpvar_38))
173       * 0.0174533)) - tmpvar_38))
174174    , 0.0, 1.0), 1.0, float(
175175      (u_lightAttenuationSpotOuter.w >= 90.0)
176176    )));
r245570r245571
195195    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
196196      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_42.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_42.y)))
197197     * u_color.xyz) * tmpvar_31)))
198  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
199    exp2(((1.767302e-5 * tmpvar_43) * tmpvar_43))
198  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
199    exp2(((1.7673e-05 * tmpvar_43) * tmpvar_43))
200200  )), 0.0, 1.0));
201201  gl_FragColor.xyz = tmpvar_44;
202202  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0Åvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0¿varying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
137137    tmpvar_30 = 1.0;
138138  } else {
139139    tmpvar_30 = clamp (exp((_depthMultiplier_29 *
140      (dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) - ((shadowcoord_1.z - u_params1.x) / shadowcoord_1.w))
140      (dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((shadowcoord_1.z - u_params1.x) / shadowcoord_1.w))
141141    )), 0.0, 1.0);
142142  };
143143  highp vec3 tmpvar_33;
r245570r245571
154154    tmpvar_37 = normalize(tmpvar_34);
155155    tmpvar_35 = tmpvar_37;
156156    highp float tmpvar_38;
157    tmpvar_38 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
157    tmpvar_38 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
158158    highp float tmpvar_39;
159159    tmpvar_39 = sqrt(dot (tmpvar_34, tmpvar_34));
160160    tmpvar_36 = ((1.0/((
r245570r245571
168168        normalize(u_lightSpotDirectionInner.xyz)
169169      )) - tmpvar_38) / (cos((
170170        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
171       * 0.01745329)) - tmpvar_38))
171       * 0.0174533)) - tmpvar_38))
172172    , 0.0, 1.0), 1.0, float(
173173      (u_lightAttenuationSpotOuter.w >= 90.0)
174174    )));
r245570r245571
193193    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
194194      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_42.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_42.y)))
195195     * u_color.xyz) * tmpvar_30)))
196  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
197    exp2(((1.767302e-5 * tmpvar_43) * tmpvar_43))
196  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
197    exp2(((1.7673e-05 * tmpvar_43) * tmpvar_43))
198198  )), 0.0, 1.0));
199199  gl_FragColor.xyz = tmpvar_44;
200200  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin
r245570r245571
11FSHpjH -   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0·varying highp vec3 v_normal;
2   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0±varying highp vec3 v_normal;
23varying highp vec4 v_shadowcoord;
34varying highp vec3 v_view;
45uniform highp vec4 u_params1;
r245570r245571
6565    tmpvar_14 = normalize(tmpvar_11);
6666    tmpvar_12 = tmpvar_14;
6767    highp float tmpvar_15;
68    tmpvar_15 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
68    tmpvar_15 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
6969    highp float tmpvar_16;
7070    tmpvar_16 = sqrt(dot (tmpvar_11, tmpvar_11));
7171    tmpvar_13 = ((1.0/((
r245570r245571
7979        normalize(u_lightSpotDirectionInner.xyz)
8080      )) - tmpvar_15) / (cos((
8181        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
82       * 0.01745329)) - tmpvar_15))
82       * 0.0174533)) - tmpvar_15))
8383    , 0.0, 1.0), 1.0, float(
8484      (u_lightAttenuationSpotOuter.w >= 90.0)
8585    )));
r245570r245571
104104    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
105105      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_19.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_19.y)))
106106     * u_color.xyz) * tmpvar_7)))
107  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
108    exp2(((1.767302e-5 * tmpvar_20) * tmpvar_20))
107  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
108    exp2(((1.7673e-05 * tmpvar_20) * tmpvar_20))
109109  )), 0.0, 1.0));
110110  gl_FragColor.xyz = tmpvar_21;
111111  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3K$varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3E$varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
9292    if (tmpvar_23) {
9393      tmpvar_21 = 1.0;
9494    } else {
95      tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
95      tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
9696        (v_texcoord1.z - u_params1.x)
9797       / v_texcoord1.w)));
9898    };
r245570r245571
130130      if (tmpvar_32) {
131131        tmpvar_30 = 1.0;
132132      } else {
133        tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
133        tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
134134          (v_texcoord2.z - u_params1.x)
135135         / v_texcoord2.w)));
136136      };
r245570r245571
168168        if (tmpvar_41) {
169169          tmpvar_39 = 1.0;
170170        } else {
171          tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
171          tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
172172            (v_texcoord3.z - u_params1.x)
173173           / v_texcoord3.w)));
174174        };
r245570r245571
205205        if (tmpvar_50) {
206206          tmpvar_48 = 1.0;
207207        } else {
208          tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
208          tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
209209            (v_texcoord4.z - u_params1.x)
210210           / v_texcoord4.w)));
211211        };
r245570r245571
227227    tmpvar_55 = normalize(tmpvar_52);
228228    tmpvar_53 = tmpvar_55;
229229    highp float tmpvar_56;
230    tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
230    tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
231231    highp float tmpvar_57;
232232    tmpvar_57 = sqrt(dot (tmpvar_52, tmpvar_52));
233233    tmpvar_54 = ((1.0/((
r245570r245571
241241        normalize(u_lightSpotDirectionInner.xyz)
242242      )) - tmpvar_56) / (cos((
243243        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
244       * 0.01745329)) - tmpvar_56))
244       * 0.0174533)) - tmpvar_56))
245245    , 0.0, 1.0), 1.0, float(
246246      (u_lightAttenuationSpotOuter.w >= 90.0)
247247    )));
r245570r245571
266266    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
267267      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_60.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_60.y)))
268268     * u_color.xyz) * visibility_1)))
269  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
270    exp2(((1.767302e-5 * tmpvar_61) * tmpvar_61))
269  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
270    exp2(((1.7673e-05 * tmpvar_61) * tmpvar_61))
271271  )), 0.0, 1.0));
272272  gl_FragColor.xyz = tmpvar_62;
273273  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin
r245570r245571
11FSHpjH -   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0×varying highp vec3 v_normal;
2   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0Ñvarying highp vec3 v_normal;
23varying highp vec4 v_shadowcoord;
34varying highp vec3 v_view;
45uniform highp vec4 u_params1;
r245570r245571
6565    tmpvar_14 = normalize(tmpvar_11);
6666    tmpvar_12 = tmpvar_14;
6767    highp float tmpvar_15;
68    tmpvar_15 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
68    tmpvar_15 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
6969    highp float tmpvar_16;
7070    tmpvar_16 = sqrt(dot (tmpvar_11, tmpvar_11));
7171    tmpvar_13 = ((1.0/((
r245570r245571
7979        normalize(u_lightSpotDirectionInner.xyz)
8080      )) - tmpvar_15) / (cos((
8181        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
82       * 0.01745329)) - tmpvar_15))
82       * 0.0174533)) - tmpvar_15))
8383    , 0.0, 1.0), 1.0, float(
8484      (u_lightAttenuationSpotOuter.w >= 90.0)
8585    )));
r245570r245571
104104    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
105105      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_19.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_19.y)))
106106     * u_color.xyz) * tmpvar_8)))
107  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
108    exp2(((1.767302e-5 * tmpvar_20) * tmpvar_20))
107  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
108    exp2(((1.7673e-05 * tmpvar_20) * tmpvar_20))
109109  )), 0.0, 1.0));
110110  gl_FragColor.xyz = tmpvar_21;
111111  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3Ó$varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3Í$varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
9494    if (tmpvar_23) {
9595      tmpvar_22 = 1.0;
9696    } else {
97      tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (v_texcoord1.z - u_params1.x)));
97      tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord1.z - u_params1.x)));
9898    };
9999    visibility_1 = tmpvar_22;
100100  } else {
r245570r245571
132132      if (tmpvar_32) {
133133        tmpvar_31 = 1.0;
134134      } else {
135        tmpvar_31 = float((dot (texture2D (u_shadowMap1, tmpvar_30.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (v_texcoord2.z - u_params1.x)));
135        tmpvar_31 = float((dot (texture2D (u_shadowMap1, tmpvar_30.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord2.z - u_params1.x)));
136136      };
137137      visibility_1 = tmpvar_31;
138138    } else {
r245570r245571
170170        if (tmpvar_41) {
171171          tmpvar_40 = 1.0;
172172        } else {
173          tmpvar_40 = float((dot (texture2D (u_shadowMap2, tmpvar_39.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (v_texcoord3.z - u_params1.x)));
173          tmpvar_40 = float((dot (texture2D (u_shadowMap2, tmpvar_39.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord3.z - u_params1.x)));
174174        };
175175        visibility_1 = tmpvar_40;
176176      } else {
r245570r245571
207207        if (tmpvar_50) {
208208          tmpvar_49 = 1.0;
209209        } else {
210          tmpvar_49 = float((dot (texture2D (u_shadowMap3, tmpvar_48.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (v_texcoord4.z - u_params1.x)));
210          tmpvar_49 = float((dot (texture2D (u_shadowMap3, tmpvar_48.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord4.z - u_params1.x)));
211211        };
212212        visibility_1 = tmpvar_49;
213213      };
r245570r245571
227227    tmpvar_55 = normalize(tmpvar_52);
228228    tmpvar_53 = tmpvar_55;
229229    highp float tmpvar_56;
230    tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
230    tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
231231    highp float tmpvar_57;
232232    tmpvar_57 = sqrt(dot (tmpvar_52, tmpvar_52));
233233    tmpvar_54 = ((1.0/((
r245570r245571
241241        normalize(u_lightSpotDirectionInner.xyz)
242242      )) - tmpvar_56) / (cos((
243243        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
244       * 0.01745329)) - tmpvar_56))
244       * 0.0174533)) - tmpvar_56))
245245    , 0.0, 1.0), 1.0, float(
246246      (u_lightAttenuationSpotOuter.w >= 90.0)
247247    )));
r245570r245571
266266    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
267267      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_60.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_60.y)))
268268     * u_color.xyz) * visibility_1)))
269  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
270    exp2(((1.767302e-5 * tmpvar_61) * tmpvar_61))
269  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
270    exp2(((1.7673e-05 * tmpvar_61) * tmpvar_61))
271271  )), 0.0, 1.0));
272272  gl_FragColor.xyz = tmpvar_62;
273273  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0hvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0bvarying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
136136  if (tmpvar_31) {
137137    tmpvar_30 = 1.0;
138138  } else {
139    tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_29.xy), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (shadowcoord_1.z - u_params1.x)));
139    tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_29.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (shadowcoord_1.z - u_params1.x)));
140140  };
141141  highp vec3 tmpvar_32;
142142  tmpvar_32 = -(normalize(v_view));
r245570r245571
152152    tmpvar_36 = normalize(tmpvar_33);
153153    tmpvar_34 = tmpvar_36;
154154    highp float tmpvar_37;
155    tmpvar_37 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
155    tmpvar_37 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
156156    highp float tmpvar_38;
157157    tmpvar_38 = sqrt(dot (tmpvar_33, tmpvar_33));
158158    tmpvar_35 = ((1.0/((
r245570r245571
166166        normalize(u_lightSpotDirectionInner.xyz)
167167      )) - tmpvar_37) / (cos((
168168        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
169       * 0.01745329)) - tmpvar_37))
169       * 0.0174533)) - tmpvar_37))
170170    , 0.0, 1.0), 1.0, float(
171171      (u_lightAttenuationSpotOuter.w >= 90.0)
172172    )));
r245570r245571
191191    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
192192      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_41.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_41.y)))
193193     * u_color.xyz) * tmpvar_30)))
194  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
195    exp2(((1.767302e-5 * tmpvar_42) * tmpvar_42))
194  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
195    exp2(((1.7673e-05 * tmpvar_42) * tmpvar_42))
196196  )), 0.0, 1.0));
197197  gl_FragColor.xyz = tmpvar_43;
198198  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0Fvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0@varying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
134134  if (tmpvar_31) {
135135    tmpvar_29 = 1.0;
136136  } else {
137    tmpvar_29 = float((dot (texture2D (u_shadowMap0, tmpvar_30), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
137    tmpvar_29 = float((dot (texture2D (u_shadowMap0, tmpvar_30), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
138138      (shadowcoord_1.z - u_params1.x)
139139     / shadowcoord_1.w)));
140140  };
r245570r245571
152152    tmpvar_36 = normalize(tmpvar_33);
153153    tmpvar_34 = tmpvar_36;
154154    highp float tmpvar_37;
155    tmpvar_37 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
155    tmpvar_37 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
156156    highp float tmpvar_38;
157157    tmpvar_38 = sqrt(dot (tmpvar_33, tmpvar_33));
158158    tmpvar_35 = ((1.0/((
r245570r245571
166166        normalize(u_lightSpotDirectionInner.xyz)
167167      )) - tmpvar_37) / (cos((
168168        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
169       * 0.01745329)) - tmpvar_37))
169       * 0.0174533)) - tmpvar_37))
170170    , 0.0, 1.0), 1.0, float(
171171      (u_lightAttenuationSpotOuter.w >= 90.0)
172172    )));
r245570r245571
191191    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
192192      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_41.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_41.y)))
193193     * u_color.xyz) * tmpvar_29)))
194  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
195    exp2(((1.767302e-5 * tmpvar_42) * tmpvar_42))
194  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
195    exp2(((1.7673e-05 * tmpvar_42) * tmpvar_42))
196196  )), 0.0, 1.0));
197197  gl_FragColor.xyz = tmpvar_43;
198198  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin
r245570r245571
1FSHpjH   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0å;varying highp vec3 v_normal;
1FSHpjH   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0ß;varying highp vec3 v_normal;
22varying highp vec4 v_shadowcoord;
33varying highp vec3 v_view;
44uniform highp vec4 u_params1;
r245570r245571
5757  if (tmpvar_14) {
5858    tmpvar_12 = 1.0;
5959  } else {
60    tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
60    tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
6161      (_shadowCoord_11.z - u_params1.x)
6262     / _shadowCoord_11.w)));
6363  };
r245570r245571
7979  if (tmpvar_19) {
8080    tmpvar_17 = 1.0;
8181  } else {
82    tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
82    tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
8383      (_shadowCoord_16.z - u_params1.x)
8484     / _shadowCoord_16.w)));
8585  };
r245570r245571
101101  if (tmpvar_24) {
102102    tmpvar_22 = 1.0;
103103  } else {
104    tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
104    tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
105105      (_shadowCoord_21.z - u_params1.x)
106106     / _shadowCoord_21.w)));
107107  };
r245570r245571
123123  if (tmpvar_29) {
124124    tmpvar_27 = 1.0;
125125  } else {
126    tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
126    tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
127127      (_shadowCoord_26.z - u_params1.x)
128128     / _shadowCoord_26.w)));
129129  };
r245570r245571
145145  if (tmpvar_34) {
146146    tmpvar_32 = 1.0;
147147  } else {
148    tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
148    tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
149149      (_shadowCoord_31.z - u_params1.x)
150150     / _shadowCoord_31.w)));
151151  };
r245570r245571
167167  if (tmpvar_39) {
168168    tmpvar_37 = 1.0;
169169  } else {
170    tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
170    tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
171171      (_shadowCoord_36.z - u_params1.x)
172172     / _shadowCoord_36.w)));
173173  };
r245570r245571
189189  if (tmpvar_44) {
190190    tmpvar_42 = 1.0;
191191  } else {
192    tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
192    tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
193193      (_shadowCoord_41.z - u_params1.x)
194194     / _shadowCoord_41.w)));
195195  };
r245570r245571
211211  if (tmpvar_49) {
212212    tmpvar_47 = 1.0;
213213  } else {
214    tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
214    tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
215215      (_shadowCoord_46.z - u_params1.x)
216216     / _shadowCoord_46.w)));
217217  };
r245570r245571
233233  if (tmpvar_54) {
234234    tmpvar_52 = 1.0;
235235  } else {
236    tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
236    tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
237237      (_shadowCoord_51.z - u_params1.x)
238238     / _shadowCoord_51.w)));
239239  };
r245570r245571
255255  if (tmpvar_59) {
256256    tmpvar_57 = 1.0;
257257  } else {
258    tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
258    tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
259259      (_shadowCoord_56.z - u_params1.x)
260260     / _shadowCoord_56.w)));
261261  };
r245570r245571
277277  if (tmpvar_64) {
278278    tmpvar_62 = 1.0;
279279  } else {
280    tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
280    tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
281281      (_shadowCoord_61.z - u_params1.x)
282282     / _shadowCoord_61.w)));
283283  };
r245570r245571
299299  if (tmpvar_69) {
300300    tmpvar_67 = 1.0;
301301  } else {
302    tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
302    tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
303303      (_shadowCoord_66.z - u_params1.x)
304304     / _shadowCoord_66.w)));
305305  };
r245570r245571
321321  if (tmpvar_74) {
322322    tmpvar_72 = 1.0;
323323  } else {
324    tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
324    tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
325325      (_shadowCoord_71.z - u_params1.x)
326326     / _shadowCoord_71.w)));
327327  };
r245570r245571
343343  if (tmpvar_79) {
344344    tmpvar_77 = 1.0;
345345  } else {
346    tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
346    tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
347347      (_shadowCoord_76.z - u_params1.x)
348348     / _shadowCoord_76.w)));
349349  };
r245570r245571
365365  if (tmpvar_84) {
366366    tmpvar_82 = 1.0;
367367  } else {
368    tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
368    tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
369369      (_shadowCoord_81.z - u_params1.x)
370370     / _shadowCoord_81.w)));
371371  };
r245570r245571
387387  if (tmpvar_89) {
388388    tmpvar_87 = 1.0;
389389  } else {
390    tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
390    tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
391391      (_shadowCoord_86.z - u_params1.x)
392392     / _shadowCoord_86.w)));
393393  };
r245570r245571
407407    tmpvar_94 = normalize(tmpvar_91);
408408    tmpvar_92 = tmpvar_94;
409409    highp float tmpvar_95;
410    tmpvar_95 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
410    tmpvar_95 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
411411    highp float tmpvar_96;
412412    tmpvar_96 = sqrt(dot (tmpvar_91, tmpvar_91));
413413    tmpvar_93 = ((1.0/((
r245570r245571
421421        normalize(u_lightSpotDirectionInner.xyz)
422422      )) - tmpvar_95) / (cos((
423423        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
424       * 0.01745329)) - tmpvar_95))
424       * 0.0174533)) - tmpvar_95))
425425    , 0.0, 1.0), 1.0, float(
426426      (u_lightAttenuationSpotOuter.w >= 90.0)
427427    )));
r245570r245571
446446    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
447447      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_99.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_99.y)))
448448     * u_color.xyz) * tmpvar_7)))
449  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
450    exp2(((1.767302e-5 * tmpvar_100) * tmpvar_100))
449  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
450    exp2(((1.7673e-05 * tmpvar_100) * tmpvar_100))
451451  )), 0.0, 1.0));
452452  gl_FragColor.xyz = tmpvar_101;
453453  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3dõvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3^õvarying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
102102    if (tmpvar_27) {
103103      tmpvar_25 = 1.0;
104104    } else {
105      tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
105      tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
106106        (_shadowCoord_24.z - u_params1.x)
107107       / _shadowCoord_24.w)));
108108    };
r245570r245571
124124    if (tmpvar_32) {
125125      tmpvar_30 = 1.0;
126126    } else {
127      tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
127      tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
128128        (_shadowCoord_29.z - u_params1.x)
129129       / _shadowCoord_29.w)));
130130    };
r245570r245571
146146    if (tmpvar_37) {
147147      tmpvar_35 = 1.0;
148148    } else {
149      tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
149      tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
150150        (_shadowCoord_34.z - u_params1.x)
151151       / _shadowCoord_34.w)));
152152    };
r245570r245571
168168    if (tmpvar_42) {
169169      tmpvar_40 = 1.0;
170170    } else {
171      tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
171      tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
172172        (_shadowCoord_39.z - u_params1.x)
173173       / _shadowCoord_39.w)));
174174    };
r245570r245571
190190    if (tmpvar_47) {
191191      tmpvar_45 = 1.0;
192192    } else {
193      tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
193      tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
194194        (_shadowCoord_44.z - u_params1.x)
195195       / _shadowCoord_44.w)));
196196    };
r245570r245571
212212    if (tmpvar_52) {
213213      tmpvar_50 = 1.0;
214214    } else {
215      tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
215      tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
216216        (_shadowCoord_49.z - u_params1.x)
217217       / _shadowCoord_49.w)));
218218    };
r245570r245571
234234    if (tmpvar_57) {
235235      tmpvar_55 = 1.0;
236236    } else {
237      tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
237      tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
238238        (_shadowCoord_54.z - u_params1.x)
239239       / _shadowCoord_54.w)));
240240    };
r245570r245571
256256    if (tmpvar_62) {
257257      tmpvar_60 = 1.0;
258258    } else {
259      tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
259      tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
260260        (_shadowCoord_59.z - u_params1.x)
261261       / _shadowCoord_59.w)));
262262    };
r245570r245571
278278    if (tmpvar_67) {
279279      tmpvar_65 = 1.0;
280280    } else {
281      tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
281      tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
282282        (_shadowCoord_64.z - u_params1.x)
283283       / _shadowCoord_64.w)));
284284    };
r245570r245571
300300    if (tmpvar_72) {
301301      tmpvar_70 = 1.0;
302302    } else {
303      tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
303      tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
304304        (_shadowCoord_69.z - u_params1.x)
305305       / _shadowCoord_69.w)));
306306    };
r245570r245571
322322    if (tmpvar_77) {
323323      tmpvar_75 = 1.0;
324324    } else {
325      tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
325      tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
326326        (_shadowCoord_74.z - u_params1.x)
327327       / _shadowCoord_74.w)));
328328    };
r245570r245571
344344    if (tmpvar_82) {
345345      tmpvar_80 = 1.0;
346346    } else {
347      tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
347      tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
348348        (_shadowCoord_79.z - u_params1.x)
349349       / _shadowCoord_79.w)));
350350    };
r245570r245571
366366    if (tmpvar_87) {
367367      tmpvar_85 = 1.0;
368368    } else {
369      tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
369      tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
370370        (_shadowCoord_84.z - u_params1.x)
371371       / _shadowCoord_84.w)));
372372    };
r245570r245571
388388    if (tmpvar_92) {
389389      tmpvar_90 = 1.0;
390390    } else {
391      tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
391      tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
392392        (_shadowCoord_89.z - u_params1.x)
393393       / _shadowCoord_89.w)));
394394    };
r245570r245571
410410    if (tmpvar_97) {
411411      tmpvar_95 = 1.0;
412412    } else {
413      tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
413      tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
414414        (_shadowCoord_94.z - u_params1.x)
415415       / _shadowCoord_94.w)));
416416    };
r245570r245571
432432    if (tmpvar_102) {
433433      tmpvar_100 = 1.0;
434434    } else {
435      tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
435      tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
436436        (_shadowCoord_99.z - u_params1.x)
437437       / _shadowCoord_99.w)));
438438    };
r245570r245571
480480      if (tmpvar_115) {
481481        tmpvar_113 = 1.0;
482482      } else {
483        tmpvar_113 = float((dot (texture2D (u_shadowMap1, tmpvar_114), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
483        tmpvar_113 = float((dot (texture2D (u_shadowMap1, tmpvar_114), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
484484          (_shadowCoord_112.z - u_params1.x)
485485         / _shadowCoord_112.w)));
486486      };
r245570r245571
502502      if (tmpvar_120) {
503503        tmpvar_118 = 1.0;
504504      } else {
505        tmpvar_118 = float((dot (texture2D (u_shadowMap1, tmpvar_119), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
505        tmpvar_118 = float((dot (texture2D (u_shadowMap1, tmpvar_119), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
506506          (_shadowCoord_117.z - u_params1.x)
507507         / _shadowCoord_117.w)));
508508      };
r245570r245571
524524      if (tmpvar_125) {
525525        tmpvar_123 = 1.0;
526526      } else {
527        tmpvar_123 = float((dot (texture2D (u_shadowMap1, tmpvar_124), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
527        tmpvar_123 = float((dot (texture2D (u_shadowMap1, tmpvar_124), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
528528          (_shadowCoord_122.z - u_params1.x)
529529         / _shadowCoord_122.w)));
530530      };
r245570r245571
546546      if (tmpvar_130) {
547547        tmpvar_128 = 1.0;
548548      } else {
549        tmpvar_128 = float((dot (texture2D (u_shadowMap1, tmpvar_129), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
549        tmpvar_128 = float((dot (texture2D (u_shadowMap1, tmpvar_129), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
550550          (_shadowCoord_127.z - u_params1.x)
551551         / _shadowCoord_127.w)));
552552      };
r245570r245571
568568      if (tmpvar_135) {
569569        tmpvar_133 = 1.0;
570570      } else {
571        tmpvar_133 = float((dot (texture2D (u_shadowMap1, tmpvar_134), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
571        tmpvar_133 = float((dot (texture2D (u_shadowMap1, tmpvar_134), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
572572          (_shadowCoord_132.z - u_params1.x)
573573         / _shadowCoord_132.w)));
574574      };
r245570r245571
590590      if (tmpvar_140) {
591591        tmpvar_138 = 1.0;
592592      } else {
593        tmpvar_138 = float((dot (texture2D (u_shadowMap1, tmpvar_139), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
593        tmpvar_138 = float((dot (texture2D (u_shadowMap1, tmpvar_139), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
594594          (_shadowCoord_137.z - u_params1.x)
595595         / _shadowCoord_137.w)));
596596      };
r245570r245571
612612      if (tmpvar_145) {
613613        tmpvar_143 = 1.0;
614614      } else {
615        tmpvar_143 = float((dot (texture2D (u_shadowMap1, tmpvar_144), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
615        tmpvar_143 = float((dot (texture2D (u_shadowMap1, tmpvar_144), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
616616          (_shadowCoord_142.z - u_params1.x)
617617         / _shadowCoord_142.w)));
618618      };
r245570r245571
634634      if (tmpvar_150) {
635635        tmpvar_148 = 1.0;
636636      } else {
637        tmpvar_148 = float((dot (texture2D (u_shadowMap1, tmpvar_149), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
637        tmpvar_148 = float((dot (texture2D (u_shadowMap1, tmpvar_149), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
638638          (_shadowCoord_147.z - u_params1.x)
639639         / _shadowCoord_147.w)));
640640      };
r245570r245571
656656      if (tmpvar_155) {
657657        tmpvar_153 = 1.0;
658658      } else {
659        tmpvar_153 = float((dot (texture2D (u_shadowMap1, tmpvar_154), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
659        tmpvar_153 = float((dot (texture2D (u_shadowMap1, tmpvar_154), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
660660          (_shadowCoord_152.z - u_params1.x)
661661         / _shadowCoord_152.w)));
662662      };
r245570r245571
678678      if (tmpvar_160) {
679679        tmpvar_158 = 1.0;
680680      } else {
681        tmpvar_158 = float((dot (texture2D (u_shadowMap1, tmpvar_159), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
681        tmpvar_158 = float((dot (texture2D (u_shadowMap1, tmpvar_159), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
682682          (_shadowCoord_157.z - u_params1.x)
683683         / _shadowCoord_157.w)));
684684      };
r245570r245571
700700      if (tmpvar_165) {
701701        tmpvar_163 = 1.0;
702702      } else {
703        tmpvar_163 = float((dot (texture2D (u_shadowMap1, tmpvar_164), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
703        tmpvar_163 = float((dot (texture2D (u_shadowMap1, tmpvar_164), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
704704          (_shadowCoord_162.z - u_params1.x)
705705         / _shadowCoord_162.w)));
706706      };
r245570r245571
722722      if (tmpvar_170) {
723723        tmpvar_168 = 1.0;
724724      } else {
725        tmpvar_168 = float((dot (texture2D (u_shadowMap1, tmpvar_169), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
725        tmpvar_168 = float((dot (texture2D (u_shadowMap1, tmpvar_169), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
726726          (_shadowCoord_167.z - u_params1.x)
727727         / _shadowCoord_167.w)));
728728      };
r245570r245571
744744      if (tmpvar_175) {
745745        tmpvar_173 = 1.0;
746746      } else {
747        tmpvar_173 = float((dot (texture2D (u_shadowMap1, tmpvar_174), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
747        tmpvar_173 = float((dot (texture2D (u_shadowMap1, tmpvar_174), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
748748          (_shadowCoord_172.z - u_params1.x)
749749         / _shadowCoord_172.w)));
750750      };
r245570r245571
766766      if (tmpvar_180) {
767767        tmpvar_178 = 1.0;
768768      } else {
769        tmpvar_178 = float((dot (texture2D (u_shadowMap1, tmpvar_179), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
769        tmpvar_178 = float((dot (texture2D (u_shadowMap1, tmpvar_179), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
770770          (_shadowCoord_177.z - u_params1.x)
771771         / _shadowCoord_177.w)));
772772      };
r245570r245571
788788      if (tmpvar_185) {
789789        tmpvar_183 = 1.0;
790790      } else {
791        tmpvar_183 = float((dot (texture2D (u_shadowMap1, tmpvar_184), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
791        tmpvar_183 = float((dot (texture2D (u_shadowMap1, tmpvar_184), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
792792          (_shadowCoord_182.z - u_params1.x)
793793         / _shadowCoord_182.w)));
794794      };
r245570r245571
810810      if (tmpvar_190) {
811811        tmpvar_188 = 1.0;
812812      } else {
813        tmpvar_188 = float((dot (texture2D (u_shadowMap1, tmpvar_189), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
813        tmpvar_188 = float((dot (texture2D (u_shadowMap1, tmpvar_189), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
814814          (_shadowCoord_187.z - u_params1.x)
815815         / _shadowCoord_187.w)));
816816      };
r245570r245571
858858        if (tmpvar_203) {
859859          tmpvar_201 = 1.0;
860860        } else {
861          tmpvar_201 = float((dot (texture2D (u_shadowMap2, tmpvar_202), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
861          tmpvar_201 = float((dot (texture2D (u_shadowMap2, tmpvar_202), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
862862            (_shadowCoord_200.z - u_params1.x)
863863           / _shadowCoord_200.w)));
864864        };
r245570r245571
880880        if (tmpvar_208) {
881881          tmpvar_206 = 1.0;
882882        } else {
883          tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
883          tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
884884            (_shadowCoord_205.z - u_params1.x)
885885           / _shadowCoord_205.w)));
886886        };
r245570r245571
902902        if (tmpvar_213) {
903903          tmpvar_211 = 1.0;
904904        } else {
905          tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
905          tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
906906            (_shadowCoord_210.z - u_params1.x)
907907           / _shadowCoord_210.w)));
908908        };
r245570r245571
924924        if (tmpvar_218) {
925925          tmpvar_216 = 1.0;
926926        } else {
927          tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
927          tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
928928            (_shadowCoord_215.z - u_params1.x)
929929           / _shadowCoord_215.w)));
930930        };
r245570r245571
946946        if (tmpvar_223) {
947947          tmpvar_221 = 1.0;
948948        } else {
949          tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
949          tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
950950            (_shadowCoord_220.z - u_params1.x)
951951           / _shadowCoord_220.w)));
952952        };
r245570r245571
968968        if (tmpvar_228) {
969969          tmpvar_226 = 1.0;
970970        } else {
971          tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
971          tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
972972            (_shadowCoord_225.z - u_params1.x)
973973           / _shadowCoord_225.w)));
974974        };
r245570r245571
990990        if (tmpvar_233) {
991991          tmpvar_231 = 1.0;
992992        } else {
993          tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
993          tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
994994            (_shadowCoord_230.z - u_params1.x)
995995           / _shadowCoord_230.w)));
996996        };
r245570r245571
10121012        if (tmpvar_238) {
10131013          tmpvar_236 = 1.0;
10141014        } else {
1015          tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1015          tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10161016            (_shadowCoord_235.z - u_params1.x)
10171017           / _shadowCoord_235.w)));
10181018        };
r245570r245571
10341034        if (tmpvar_243) {
10351035          tmpvar_241 = 1.0;
10361036        } else {
1037          tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1037          tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10381038            (_shadowCoord_240.z - u_params1.x)
10391039           / _shadowCoord_240.w)));
10401040        };
r245570r245571
10561056        if (tmpvar_248) {
10571057          tmpvar_246 = 1.0;
10581058        } else {
1059          tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1059          tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10601060            (_shadowCoord_245.z - u_params1.x)
10611061           / _shadowCoord_245.w)));
10621062        };
r245570r245571
10781078        if (tmpvar_253) {
10791079          tmpvar_251 = 1.0;
10801080        } else {
1081          tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1081          tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10821082            (_shadowCoord_250.z - u_params1.x)
10831083           / _shadowCoord_250.w)));
10841084        };
r245570r245571
11001100        if (tmpvar_258) {
11011101          tmpvar_256 = 1.0;
11021102        } else {
1103          tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1103          tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11041104            (_shadowCoord_255.z - u_params1.x)
11051105           / _shadowCoord_255.w)));
11061106        };
r245570r245571
11221122        if (tmpvar_263) {
11231123          tmpvar_261 = 1.0;
11241124        } else {
1125          tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1125          tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11261126            (_shadowCoord_260.z - u_params1.x)
11271127           / _shadowCoord_260.w)));
11281128        };
r245570r245571
11441144        if (tmpvar_268) {
11451145          tmpvar_266 = 1.0;
11461146        } else {
1147          tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1147          tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11481148            (_shadowCoord_265.z - u_params1.x)
11491149           / _shadowCoord_265.w)));
11501150        };
r245570r245571
11661166        if (tmpvar_273) {
11671167          tmpvar_271 = 1.0;
11681168        } else {
1169          tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1169          tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11701170            (_shadowCoord_270.z - u_params1.x)
11711171           / _shadowCoord_270.w)));
11721172        };
r245570r245571
11881188        if (tmpvar_278) {
11891189          tmpvar_276 = 1.0;
11901190        } else {
1191          tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1191          tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11921192            (_shadowCoord_275.z - u_params1.x)
11931193           / _shadowCoord_275.w)));
11941194        };
r245570r245571
12351235        if (tmpvar_291) {
12361236          tmpvar_289 = 1.0;
12371237        } else {
1238          tmpvar_289 = float((dot (texture2D (u_shadowMap3, tmpvar_290), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1238          tmpvar_289 = float((dot (texture2D (u_shadowMap3, tmpvar_290), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12391239            (_shadowCoord_288.z - u_params1.x)
12401240           / _shadowCoord_288.w)));
12411241        };
r245570r245571
12571257        if (tmpvar_296) {
12581258          tmpvar_294 = 1.0;
12591259        } else {
1260          tmpvar_294 = float((dot (texture2D (u_shadowMap3, tmpvar_295), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1260          tmpvar_294 = float((dot (texture2D (u_shadowMap3, tmpvar_295), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12611261            (_shadowCoord_293.z - u_params1.x)
12621262           / _shadowCoord_293.w)));
12631263        };
r245570r245571
12791279        if (tmpvar_301) {
12801280          tmpvar_299 = 1.0;
12811281        } else {
1282          tmpvar_299 = float((dot (texture2D (u_shadowMap3, tmpvar_300), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1282          tmpvar_299 = float((dot (texture2D (u_shadowMap3, tmpvar_300), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12831283            (_shadowCoord_298.z - u_params1.x)
12841284           / _shadowCoord_298.w)));
12851285        };
r245570r245571
13011301        if (tmpvar_306) {
13021302          tmpvar_304 = 1.0;
13031303        } else {
1304          tmpvar_304 = float((dot (texture2D (u_shadowMap3, tmpvar_305), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1304          tmpvar_304 = float((dot (texture2D (u_shadowMap3, tmpvar_305), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13051305            (_shadowCoord_303.z - u_params1.x)
13061306           / _shadowCoord_303.w)));
13071307        };
r245570r245571
13231323        if (tmpvar_311) {
13241324          tmpvar_309 = 1.0;
13251325        } else {
1326          tmpvar_309 = float((dot (texture2D (u_shadowMap3, tmpvar_310), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1326          tmpvar_309 = float((dot (texture2D (u_shadowMap3, tmpvar_310), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13271327            (_shadowCoord_308.z - u_params1.x)
13281328           / _shadowCoord_308.w)));
13291329        };
r245570r245571
13451345        if (tmpvar_316) {
13461346          tmpvar_314 = 1.0;
13471347        } else {
1348          tmpvar_314 = float((dot (texture2D (u_shadowMap3, tmpvar_315), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1348          tmpvar_314 = float((dot (texture2D (u_shadowMap3, tmpvar_315), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13491349            (_shadowCoord_313.z - u_params1.x)
13501350           / _shadowCoord_313.w)));
13511351        };
r245570r245571
13671367        if (tmpvar_321) {
13681368          tmpvar_319 = 1.0;
13691369        } else {
1370          tmpvar_319 = float((dot (texture2D (u_shadowMap3, tmpvar_320), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1370          tmpvar_319 = float((dot (texture2D (u_shadowMap3, tmpvar_320), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13711371            (_shadowCoord_318.z - u_params1.x)
13721372           / _shadowCoord_318.w)));
13731373        };
r245570r245571
13891389        if (tmpvar_326) {
13901390          tmpvar_324 = 1.0;
13911391        } else {
1392          tmpvar_324 = float((dot (texture2D (u_shadowMap3, tmpvar_325), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1392          tmpvar_324 = float((dot (texture2D (u_shadowMap3, tmpvar_325), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13931393            (_shadowCoord_323.z - u_params1.x)
13941394           / _shadowCoord_323.w)));
13951395        };
r245570r245571
14111411        if (tmpvar_331) {
14121412          tmpvar_329 = 1.0;
14131413        } else {
1414          tmpvar_329 = float((dot (texture2D (u_shadowMap3, tmpvar_330), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1414          tmpvar_329 = float((dot (texture2D (u_shadowMap3, tmpvar_330), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14151415            (_shadowCoord_328.z - u_params1.x)
14161416           / _shadowCoord_328.w)));
14171417        };
r245570r245571
14331433        if (tmpvar_336) {
14341434          tmpvar_334 = 1.0;
14351435        } else {
1436          tmpvar_334 = float((dot (texture2D (u_shadowMap3, tmpvar_335), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1436          tmpvar_334 = float((dot (texture2D (u_shadowMap3, tmpvar_335), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14371437            (_shadowCoord_333.z - u_params1.x)
14381438           / _shadowCoord_333.w)));
14391439        };
r245570r245571
14551455        if (tmpvar_341) {
14561456          tmpvar_339 = 1.0;
14571457        } else {
1458          tmpvar_339 = float((dot (texture2D (u_shadowMap3, tmpvar_340), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1458          tmpvar_339 = float((dot (texture2D (u_shadowMap3, tmpvar_340), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14591459            (_shadowCoord_338.z - u_params1.x)
14601460           / _shadowCoord_338.w)));
14611461        };
r245570r245571
14771477        if (tmpvar_346) {
14781478          tmpvar_344 = 1.0;
14791479        } else {
1480          tmpvar_344 = float((dot (texture2D (u_shadowMap3, tmpvar_345), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1480          tmpvar_344 = float((dot (texture2D (u_shadowMap3, tmpvar_345), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14811481            (_shadowCoord_343.z - u_params1.x)
14821482           / _shadowCoord_343.w)));
14831483        };
r245570r245571
14991499        if (tmpvar_351) {
15001500          tmpvar_349 = 1.0;
15011501        } else {
1502          tmpvar_349 = float((dot (texture2D (u_shadowMap3, tmpvar_350), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1502          tmpvar_349 = float((dot (texture2D (u_shadowMap3, tmpvar_350), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15031503            (_shadowCoord_348.z - u_params1.x)
15041504           / _shadowCoord_348.w)));
15051505        };
r245570r245571
15211521        if (tmpvar_356) {
15221522          tmpvar_354 = 1.0;
15231523        } else {
1524          tmpvar_354 = float((dot (texture2D (u_shadowMap3, tmpvar_355), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1524          tmpvar_354 = float((dot (texture2D (u_shadowMap3, tmpvar_355), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15251525            (_shadowCoord_353.z - u_params1.x)
15261526           / _shadowCoord_353.w)));
15271527        };
r245570r245571
15431543        if (tmpvar_361) {
15441544          tmpvar_359 = 1.0;
15451545        } else {
1546          tmpvar_359 = float((dot (texture2D (u_shadowMap3, tmpvar_360), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1546          tmpvar_359 = float((dot (texture2D (u_shadowMap3, tmpvar_360), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15471547            (_shadowCoord_358.z - u_params1.x)
15481548           / _shadowCoord_358.w)));
15491549        };
r245570r245571
15651565        if (tmpvar_366) {
15661566          tmpvar_364 = 1.0;
15671567        } else {
1568          tmpvar_364 = float((dot (texture2D (u_shadowMap3, tmpvar_365), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1568          tmpvar_364 = float((dot (texture2D (u_shadowMap3, tmpvar_365), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15691569            (_shadowCoord_363.z - u_params1.x)
15701570           / _shadowCoord_363.w)));
15711571        };
r245570r245571
15881588    tmpvar_371 = normalize(tmpvar_368);
15891589    tmpvar_369 = tmpvar_371;
15901590    highp float tmpvar_372;
1591    tmpvar_372 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
1591    tmpvar_372 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
15921592    highp float tmpvar_373;
15931593    tmpvar_373 = sqrt(dot (tmpvar_368, tmpvar_368));
15941594    tmpvar_370 = ((1.0/((
r245570r245571
16021602        normalize(u_lightSpotDirectionInner.xyz)
16031603      )) - tmpvar_372) / (cos((
16041604        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
1605       * 0.01745329)) - tmpvar_372))
1605       * 0.0174533)) - tmpvar_372))
16061606    , 0.0, 1.0), 1.0, float(
16071607      (u_lightAttenuationSpotOuter.w >= 90.0)
16081608    )));
r245570r245571
16271627    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
16281628      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_376.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_376.y)))
16291629     * u_color.xyz) * visibility_1)))
1630  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
1631    exp2(((1.767302e-5 * tmpvar_377) * tmpvar_377))
1630  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
1631    exp2(((1.7673e-05 * tmpvar_377) * tmpvar_377))
16321632  )), 0.0, 1.0));
16331633  gl_FragColor.xyz = tmpvar_378;
16341634  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin
r245570r245571
1FSHpjH   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0<varying highp vec3 v_normal;
1FSHpjH   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0<varying highp vec3 v_normal;
22varying highp vec4 v_shadowcoord;
33varying highp vec3 v_view;
44uniform highp vec4 u_params1;
r245570r245571
6161  if (tmpvar_15) {
6262    tmpvar_13 = 1.0;
6363  } else {
64    tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
64    tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
6565      (_shadowCoord_12.z - u_params1.x)
6666     / _shadowCoord_12.w)));
6767  };
r245570r245571
8383  if (tmpvar_20) {
8484    tmpvar_18 = 1.0;
8585  } else {
86    tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
86    tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
8787      (_shadowCoord_17.z - u_params1.x)
8888     / _shadowCoord_17.w)));
8989  };
r245570r245571
105105  if (tmpvar_25) {
106106    tmpvar_23 = 1.0;
107107  } else {
108    tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
108    tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
109109      (_shadowCoord_22.z - u_params1.x)
110110     / _shadowCoord_22.w)));
111111  };
r245570r245571
127127  if (tmpvar_30) {
128128    tmpvar_28 = 1.0;
129129  } else {
130    tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
130    tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
131131      (_shadowCoord_27.z - u_params1.x)
132132     / _shadowCoord_27.w)));
133133  };
r245570r245571
149149  if (tmpvar_35) {
150150    tmpvar_33 = 1.0;
151151  } else {
152    tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
152    tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
153153      (_shadowCoord_32.z - u_params1.x)
154154     / _shadowCoord_32.w)));
155155  };
r245570r245571
171171  if (tmpvar_40) {
172172    tmpvar_38 = 1.0;
173173  } else {
174    tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
174    tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
175175      (_shadowCoord_37.z - u_params1.x)
176176     / _shadowCoord_37.w)));
177177  };
r245570r245571
193193  if (tmpvar_45) {
194194    tmpvar_43 = 1.0;
195195  } else {
196    tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
196    tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
197197      (_shadowCoord_42.z - u_params1.x)
198198     / _shadowCoord_42.w)));
199199  };
r245570r245571
215215  if (tmpvar_50) {
216216    tmpvar_48 = 1.0;
217217  } else {
218    tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
218    tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
219219      (_shadowCoord_47.z - u_params1.x)
220220     / _shadowCoord_47.w)));
221221  };
r245570r245571
237237  if (tmpvar_55) {
238238    tmpvar_53 = 1.0;
239239  } else {
240    tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
240    tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
241241      (_shadowCoord_52.z - u_params1.x)
242242     / _shadowCoord_52.w)));
243243  };
r245570r245571
259259  if (tmpvar_60) {
260260    tmpvar_58 = 1.0;
261261  } else {
262    tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
262    tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
263263      (_shadowCoord_57.z - u_params1.x)
264264     / _shadowCoord_57.w)));
265265  };
r245570r245571
281281  if (tmpvar_65) {
282282    tmpvar_63 = 1.0;
283283  } else {
284    tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
284    tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
285285      (_shadowCoord_62.z - u_params1.x)
286286     / _shadowCoord_62.w)));
287287  };
r245570r245571
303303  if (tmpvar_70) {
304304    tmpvar_68 = 1.0;
305305  } else {
306    tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
306    tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
307307      (_shadowCoord_67.z - u_params1.x)
308308     / _shadowCoord_67.w)));
309309  };
r245570r245571
325325  if (tmpvar_75) {
326326    tmpvar_73 = 1.0;
327327  } else {
328    tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
328    tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
329329      (_shadowCoord_72.z - u_params1.x)
330330     / _shadowCoord_72.w)));
331331  };
r245570r245571
347347  if (tmpvar_80) {
348348    tmpvar_78 = 1.0;
349349  } else {
350    tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
350    tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
351351      (_shadowCoord_77.z - u_params1.x)
352352     / _shadowCoord_77.w)));
353353  };
r245570r245571
369369  if (tmpvar_85) {
370370    tmpvar_83 = 1.0;
371371  } else {
372    tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
372    tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
373373      (_shadowCoord_82.z - u_params1.x)
374374     / _shadowCoord_82.w)));
375375  };
r245570r245571
391391  if (tmpvar_90) {
392392    tmpvar_88 = 1.0;
393393  } else {
394    tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
394    tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
395395      (_shadowCoord_87.z - u_params1.x)
396396     / _shadowCoord_87.w)));
397397  };
r245570r245571
411411    tmpvar_95 = normalize(tmpvar_92);
412412    tmpvar_93 = tmpvar_95;
413413    highp float tmpvar_96;
414    tmpvar_96 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
414    tmpvar_96 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
415415    highp float tmpvar_97;
416416    tmpvar_97 = sqrt(dot (tmpvar_92, tmpvar_92));
417417    tmpvar_94 = ((1.0/((
r245570r245571
425425        normalize(u_lightSpotDirectionInner.xyz)
426426      )) - tmpvar_96) / (cos((
427427        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
428       * 0.01745329)) - tmpvar_96))
428       * 0.0174533)) - tmpvar_96))
429429    , 0.0, 1.0), 1.0, float(
430430      (u_lightAttenuationSpotOuter.w >= 90.0)
431431    )));
r245570r245571
450450    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
451451      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_100.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_100.y)))
452452     * u_color.xyz) * tmpvar_8)))
453  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
454    exp2(((1.767302e-5 * tmpvar_101) * tmpvar_101))
453  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
454    exp2(((1.7673e-05 * tmpvar_101) * tmpvar_101))
455455  )), 0.0, 1.0));
456456  gl_FragColor.xyz = tmpvar_102;
457457  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3"÷varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParams u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3÷varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
106106    if (tmpvar_28) {
107107      tmpvar_26 = 1.0;
108108    } else {
109      tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
109      tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
110110        (_shadowCoord_25.z - u_params1.x)
111111       / _shadowCoord_25.w)));
112112    };
r245570r245571
128128    if (tmpvar_33) {
129129      tmpvar_31 = 1.0;
130130    } else {
131      tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
131      tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
132132        (_shadowCoord_30.z - u_params1.x)
133133       / _shadowCoord_30.w)));
134134    };
r245570r245571
150150    if (tmpvar_38) {
151151      tmpvar_36 = 1.0;
152152    } else {
153      tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
153      tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
154154        (_shadowCoord_35.z - u_params1.x)
155155       / _shadowCoord_35.w)));
156156    };
r245570r245571
172172    if (tmpvar_43) {
173173      tmpvar_41 = 1.0;
174174    } else {
175      tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
175      tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
176176        (_shadowCoord_40.z - u_params1.x)
177177       / _shadowCoord_40.w)));
178178    };
r245570r245571
194194    if (tmpvar_48) {
195195      tmpvar_46 = 1.0;
196196    } else {
197      tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
197      tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
198198        (_shadowCoord_45.z - u_params1.x)
199199       / _shadowCoord_45.w)));
200200    };
r245570r245571
216216    if (tmpvar_53) {
217217      tmpvar_51 = 1.0;
218218    } else {
219      tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
219      tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
220220        (_shadowCoord_50.z - u_params1.x)
221221       / _shadowCoord_50.w)));
222222    };
r245570r245571
238238    if (tmpvar_58) {
239239      tmpvar_56 = 1.0;
240240    } else {
241      tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
241      tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
242242        (_shadowCoord_55.z - u_params1.x)
243243       / _shadowCoord_55.w)));
244244    };
r245570r245571
260260    if (tmpvar_63) {
261261      tmpvar_61 = 1.0;
262262    } else {
263      tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
263      tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
264264        (_shadowCoord_60.z - u_params1.x)
265265       / _shadowCoord_60.w)));
266266    };
r245570r245571
282282    if (tmpvar_68) {
283283      tmpvar_66 = 1.0;
284284    } else {
285      tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
285      tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
286286        (_shadowCoord_65.z - u_params1.x)
287287       / _shadowCoord_65.w)));
288288    };
r245570r245571
304304    if (tmpvar_73) {
305305      tmpvar_71 = 1.0;
306306    } else {
307      tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
307      tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
308308        (_shadowCoord_70.z - u_params1.x)
309309       / _shadowCoord_70.w)));
310310    };
r245570r245571
326326    if (tmpvar_78) {
327327      tmpvar_76 = 1.0;
328328    } else {
329      tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
329      tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
330330        (_shadowCoord_75.z - u_params1.x)
331331       / _shadowCoord_75.w)));
332332    };
r245570r245571
348348    if (tmpvar_83) {
349349      tmpvar_81 = 1.0;
350350    } else {
351      tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
351      tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
352352        (_shadowCoord_80.z - u_params1.x)
353353       / _shadowCoord_80.w)));
354354    };
r245570r245571
370370    if (tmpvar_88) {
371371      tmpvar_86 = 1.0;
372372    } else {
373      tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
373      tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
374374        (_shadowCoord_85.z - u_params1.x)
375375       / _shadowCoord_85.w)));
376376    };
r245570r245571
392392    if (tmpvar_93) {
393393      tmpvar_91 = 1.0;
394394    } else {
395      tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
395      tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
396396        (_shadowCoord_90.z - u_params1.x)
397397       / _shadowCoord_90.w)));
398398    };
r245570r245571
414414    if (tmpvar_98) {
415415      tmpvar_96 = 1.0;
416416    } else {
417      tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
417      tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
418418        (_shadowCoord_95.z - u_params1.x)
419419       / _shadowCoord_95.w)));
420420    };
r245570r245571
436436    if (tmpvar_103) {
437437      tmpvar_101 = 1.0;
438438    } else {
439      tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
439      tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
440440        (_shadowCoord_100.z - u_params1.x)
441441       / _shadowCoord_100.w)));
442442    };
r245570r245571
488488      if (tmpvar_117) {
489489        tmpvar_115 = 1.0;
490490      } else {
491        tmpvar_115 = float((dot (texture2D (u_shadowMap1, tmpvar_116), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
491        tmpvar_115 = float((dot (texture2D (u_shadowMap1, tmpvar_116), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
492492          (_shadowCoord_114.z - u_params1.x)
493493         / _shadowCoord_114.w)));
494494      };
r245570r245571
510510      if (tmpvar_122) {
511511        tmpvar_120 = 1.0;
512512      } else {
513        tmpvar_120 = float((dot (texture2D (u_shadowMap1, tmpvar_121), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
513        tmpvar_120 = float((dot (texture2D (u_shadowMap1, tmpvar_121), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
514514          (_shadowCoord_119.z - u_params1.x)
515515         / _shadowCoord_119.w)));
516516      };
r245570r245571
532532      if (tmpvar_127) {
533533        tmpvar_125 = 1.0;
534534      } else {
535        tmpvar_125 = float((dot (texture2D (u_shadowMap1, tmpvar_126), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
535        tmpvar_125 = float((dot (texture2D (u_shadowMap1, tmpvar_126), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
536536          (_shadowCoord_124.z - u_params1.x)
537537         / _shadowCoord_124.w)));
538538      };
r245570r245571
554554      if (tmpvar_132) {
555555        tmpvar_130 = 1.0;
556556      } else {
557        tmpvar_130 = float((dot (texture2D (u_shadowMap1, tmpvar_131), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
557        tmpvar_130 = float((dot (texture2D (u_shadowMap1, tmpvar_131), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
558558          (_shadowCoord_129.z - u_params1.x)
559559         / _shadowCoord_129.w)));
560560      };
r245570r245571
576576      if (tmpvar_137) {
577577        tmpvar_135 = 1.0;
578578      } else {
579        tmpvar_135 = float((dot (texture2D (u_shadowMap1, tmpvar_136), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
579        tmpvar_135 = float((dot (texture2D (u_shadowMap1, tmpvar_136), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
580580          (_shadowCoord_134.z - u_params1.x)
581581         / _shadowCoord_134.w)));
582582      };
r245570r245571
598598      if (tmpvar_142) {
599599        tmpvar_140 = 1.0;
600600      } else {
601        tmpvar_140 = float((dot (texture2D (u_shadowMap1, tmpvar_141), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
601        tmpvar_140 = float((dot (texture2D (u_shadowMap1, tmpvar_141), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
602602          (_shadowCoord_139.z - u_params1.x)
603603         / _shadowCoord_139.w)));
604604      };
r245570r245571
620620      if (tmpvar_147) {
621621        tmpvar_145 = 1.0;
622622      } else {
623        tmpvar_145 = float((dot (texture2D (u_shadowMap1, tmpvar_146), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
623        tmpvar_145 = float((dot (texture2D (u_shadowMap1, tmpvar_146), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
624624          (_shadowCoord_144.z - u_params1.x)
625625         / _shadowCoord_144.w)));
626626      };
r245570r245571
642642      if (tmpvar_152) {
643643        tmpvar_150 = 1.0;
644644      } else {
645        tmpvar_150 = float((dot (texture2D (u_shadowMap1, tmpvar_151), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
645        tmpvar_150 = float((dot (texture2D (u_shadowMap1, tmpvar_151), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
646646          (_shadowCoord_149.z - u_params1.x)
647647         / _shadowCoord_149.w)));
648648      };
r245570r245571
664664      if (tmpvar_157) {
665665        tmpvar_155 = 1.0;
666666      } else {
667        tmpvar_155 = float((dot (texture2D (u_shadowMap1, tmpvar_156), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
667        tmpvar_155 = float((dot (texture2D (u_shadowMap1, tmpvar_156), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
668668          (_shadowCoord_154.z - u_params1.x)
669669         / _shadowCoord_154.w)));
670670      };
r245570r245571
686686      if (tmpvar_162) {
687687        tmpvar_160 = 1.0;
688688      } else {
689        tmpvar_160 = float((dot (texture2D (u_shadowMap1, tmpvar_161), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
689        tmpvar_160 = float((dot (texture2D (u_shadowMap1, tmpvar_161), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
690690          (_shadowCoord_159.z - u_params1.x)
691691         / _shadowCoord_159.w)));
692692      };
r245570r245571
708708      if (tmpvar_167) {
709709        tmpvar_165 = 1.0;
710710      } else {
711        tmpvar_165 = float((dot (texture2D (u_shadowMap1, tmpvar_166), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
711        tmpvar_165 = float((dot (texture2D (u_shadowMap1, tmpvar_166), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
712712          (_shadowCoord_164.z - u_params1.x)
713713         / _shadowCoord_164.w)));
714714      };
r245570r245571
730730      if (tmpvar_172) {
731731        tmpvar_170 = 1.0;
732732      } else {
733        tmpvar_170 = float((dot (texture2D (u_shadowMap1, tmpvar_171), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
733        tmpvar_170 = float((dot (texture2D (u_shadowMap1, tmpvar_171), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
734734          (_shadowCoord_169.z - u_params1.x)
735735         / _shadowCoord_169.w)));
736736      };
r245570r245571
752752      if (tmpvar_177) {
753753        tmpvar_175 = 1.0;
754754      } else {
755        tmpvar_175 = float((dot (texture2D (u_shadowMap1, tmpvar_176), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
755        tmpvar_175 = float((dot (texture2D (u_shadowMap1, tmpvar_176), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
756756          (_shadowCoord_174.z - u_params1.x)
757757         / _shadowCoord_174.w)));
758758      };
r245570r245571
774774      if (tmpvar_182) {
775775        tmpvar_180 = 1.0;
776776      } else {
777        tmpvar_180 = float((dot (texture2D (u_shadowMap1, tmpvar_181), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
777        tmpvar_180 = float((dot (texture2D (u_shadowMap1, tmpvar_181), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
778778          (_shadowCoord_179.z - u_params1.x)
779779         / _shadowCoord_179.w)));
780780      };
r245570r245571
796796      if (tmpvar_187) {
797797        tmpvar_185 = 1.0;
798798      } else {
799        tmpvar_185 = float((dot (texture2D (u_shadowMap1, tmpvar_186), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
799        tmpvar_185 = float((dot (texture2D (u_shadowMap1, tmpvar_186), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
800800          (_shadowCoord_184.z - u_params1.x)
801801         / _shadowCoord_184.w)));
802802      };
r245570r245571
818818      if (tmpvar_192) {
819819        tmpvar_190 = 1.0;
820820      } else {
821        tmpvar_190 = float((dot (texture2D (u_shadowMap1, tmpvar_191), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
821        tmpvar_190 = float((dot (texture2D (u_shadowMap1, tmpvar_191), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
822822          (_shadowCoord_189.z - u_params1.x)
823823         / _shadowCoord_189.w)));
824824      };
r245570r245571
870870        if (tmpvar_206) {
871871          tmpvar_204 = 1.0;
872872        } else {
873          tmpvar_204 = float((dot (texture2D (u_shadowMap2, tmpvar_205), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
873          tmpvar_204 = float((dot (texture2D (u_shadowMap2, tmpvar_205), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
874874            (_shadowCoord_203.z - u_params1.x)
875875           / _shadowCoord_203.w)));
876876        };
r245570r245571
892892        if (tmpvar_211) {
893893          tmpvar_209 = 1.0;
894894        } else {
895          tmpvar_209 = float((dot (texture2D (u_shadowMap2, tmpvar_210), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
895          tmpvar_209 = float((dot (texture2D (u_shadowMap2, tmpvar_210), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
896896            (_shadowCoord_208.z - u_params1.x)
897897           / _shadowCoord_208.w)));
898898        };
r245570r245571
914914        if (tmpvar_216) {
915915          tmpvar_214 = 1.0;
916916        } else {
917          tmpvar_214 = float((dot (texture2D (u_shadowMap2, tmpvar_215), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
917          tmpvar_214 = float((dot (texture2D (u_shadowMap2, tmpvar_215), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
918918            (_shadowCoord_213.z - u_params1.x)
919919           / _shadowCoord_213.w)));
920920        };
r245570r245571
936936        if (tmpvar_221) {
937937          tmpvar_219 = 1.0;
938938        } else {
939          tmpvar_219 = float((dot (texture2D (u_shadowMap2, tmpvar_220), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
939          tmpvar_219 = float((dot (texture2D (u_shadowMap2, tmpvar_220), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
940940            (_shadowCoord_218.z - u_params1.x)
941941           / _shadowCoord_218.w)));
942942        };
r245570r245571
958958        if (tmpvar_226) {
959959          tmpvar_224 = 1.0;
960960        } else {
961          tmpvar_224 = float((dot (texture2D (u_shadowMap2, tmpvar_225), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
961          tmpvar_224 = float((dot (texture2D (u_shadowMap2, tmpvar_225), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
962962            (_shadowCoord_223.z - u_params1.x)
963963           / _shadowCoord_223.w)));
964964        };
r245570r245571
980980        if (tmpvar_231) {
981981          tmpvar_229 = 1.0;
982982        } else {
983          tmpvar_229 = float((dot (texture2D (u_shadowMap2, tmpvar_230), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
983          tmpvar_229 = float((dot (texture2D (u_shadowMap2, tmpvar_230), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
984984            (_shadowCoord_228.z - u_params1.x)
985985           / _shadowCoord_228.w)));
986986        };
r245570r245571
10021002        if (tmpvar_236) {
10031003          tmpvar_234 = 1.0;
10041004        } else {
1005          tmpvar_234 = float((dot (texture2D (u_shadowMap2, tmpvar_235), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1005          tmpvar_234 = float((dot (texture2D (u_shadowMap2, tmpvar_235), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10061006            (_shadowCoord_233.z - u_params1.x)
10071007           / _shadowCoord_233.w)));
10081008        };
r245570r245571
10241024        if (tmpvar_241) {
10251025          tmpvar_239 = 1.0;
10261026        } else {
1027          tmpvar_239 = float((dot (texture2D (u_shadowMap2, tmpvar_240), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1027          tmpvar_239 = float((dot (texture2D (u_shadowMap2, tmpvar_240), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10281028            (_shadowCoord_238.z - u_params1.x)
10291029           / _shadowCoord_238.w)));
10301030        };
r245570r245571
10461046        if (tmpvar_246) {
10471047          tmpvar_244 = 1.0;
10481048        } else {
1049          tmpvar_244 = float((dot (texture2D (u_shadowMap2, tmpvar_245), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1049          tmpvar_244 = float((dot (texture2D (u_shadowMap2, tmpvar_245), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10501050            (_shadowCoord_243.z - u_params1.x)
10511051           / _shadowCoord_243.w)));
10521052        };
r245570r245571
10681068        if (tmpvar_251) {
10691069          tmpvar_249 = 1.0;
10701070        } else {
1071          tmpvar_249 = float((dot (texture2D (u_shadowMap2, tmpvar_250), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1071          tmpvar_249 = float((dot (texture2D (u_shadowMap2, tmpvar_250), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10721072            (_shadowCoord_248.z - u_params1.x)
10731073           / _shadowCoord_248.w)));
10741074        };
r245570r245571
10901090        if (tmpvar_256) {
10911091          tmpvar_254 = 1.0;
10921092        } else {
1093          tmpvar_254 = float((dot (texture2D (u_shadowMap2, tmpvar_255), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1093          tmpvar_254 = float((dot (texture2D (u_shadowMap2, tmpvar_255), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
10941094            (_shadowCoord_253.z - u_params1.x)
10951095           / _shadowCoord_253.w)));
10961096        };
r245570r245571
11121112        if (tmpvar_261) {
11131113          tmpvar_259 = 1.0;
11141114        } else {
1115          tmpvar_259 = float((dot (texture2D (u_shadowMap2, tmpvar_260), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1115          tmpvar_259 = float((dot (texture2D (u_shadowMap2, tmpvar_260), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11161116            (_shadowCoord_258.z - u_params1.x)
11171117           / _shadowCoord_258.w)));
11181118        };
r245570r245571
11341134        if (tmpvar_266) {
11351135          tmpvar_264 = 1.0;
11361136        } else {
1137          tmpvar_264 = float((dot (texture2D (u_shadowMap2, tmpvar_265), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1137          tmpvar_264 = float((dot (texture2D (u_shadowMap2, tmpvar_265), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11381138            (_shadowCoord_263.z - u_params1.x)
11391139           / _shadowCoord_263.w)));
11401140        };
r245570r245571
11561156        if (tmpvar_271) {
11571157          tmpvar_269 = 1.0;
11581158        } else {
1159          tmpvar_269 = float((dot (texture2D (u_shadowMap2, tmpvar_270), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1159          tmpvar_269 = float((dot (texture2D (u_shadowMap2, tmpvar_270), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11601160            (_shadowCoord_268.z - u_params1.x)
11611161           / _shadowCoord_268.w)));
11621162        };
r245570r245571
11781178        if (tmpvar_276) {
11791179          tmpvar_274 = 1.0;
11801180        } else {
1181          tmpvar_274 = float((dot (texture2D (u_shadowMap2, tmpvar_275), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1181          tmpvar_274 = float((dot (texture2D (u_shadowMap2, tmpvar_275), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
11821182            (_shadowCoord_273.z - u_params1.x)
11831183           / _shadowCoord_273.w)));
11841184        };
r245570r245571
12001200        if (tmpvar_281) {
12011201          tmpvar_279 = 1.0;
12021202        } else {
1203          tmpvar_279 = float((dot (texture2D (u_shadowMap2, tmpvar_280), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1203          tmpvar_279 = float((dot (texture2D (u_shadowMap2, tmpvar_280), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12041204            (_shadowCoord_278.z - u_params1.x)
12051205           / _shadowCoord_278.w)));
12061206        };
r245570r245571
12511251        if (tmpvar_295) {
12521252          tmpvar_293 = 1.0;
12531253        } else {
1254          tmpvar_293 = float((dot (texture2D (u_shadowMap3, tmpvar_294), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1254          tmpvar_293 = float((dot (texture2D (u_shadowMap3, tmpvar_294), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12551255            (_shadowCoord_292.z - u_params1.x)
12561256           / _shadowCoord_292.w)));
12571257        };
r245570r245571
12731273        if (tmpvar_300) {
12741274          tmpvar_298 = 1.0;
12751275        } else {
1276          tmpvar_298 = float((dot (texture2D (u_shadowMap3, tmpvar_299), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1276          tmpvar_298 = float((dot (texture2D (u_shadowMap3, tmpvar_299), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12771277            (_shadowCoord_297.z - u_params1.x)
12781278           / _shadowCoord_297.w)));
12791279        };
r245570r245571
12951295        if (tmpvar_305) {
12961296          tmpvar_303 = 1.0;
12971297        } else {
1298          tmpvar_303 = float((dot (texture2D (u_shadowMap3, tmpvar_304), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1298          tmpvar_303 = float((dot (texture2D (u_shadowMap3, tmpvar_304), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
12991299            (_shadowCoord_302.z - u_params1.x)
13001300           / _shadowCoord_302.w)));
13011301        };
r245570r245571
13171317        if (tmpvar_310) {
13181318          tmpvar_308 = 1.0;
13191319        } else {
1320          tmpvar_308 = float((dot (texture2D (u_shadowMap3, tmpvar_309), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1320          tmpvar_308 = float((dot (texture2D (u_shadowMap3, tmpvar_309), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13211321            (_shadowCoord_307.z - u_params1.x)
13221322           / _shadowCoord_307.w)));
13231323        };
r245570r245571
13391339        if (tmpvar_315) {
13401340          tmpvar_313 = 1.0;
13411341        } else {
1342          tmpvar_313 = float((dot (texture2D (u_shadowMap3, tmpvar_314), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1342          tmpvar_313 = float((dot (texture2D (u_shadowMap3, tmpvar_314), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13431343            (_shadowCoord_312.z - u_params1.x)
13441344           / _shadowCoord_312.w)));
13451345        };
r245570r245571
13611361        if (tmpvar_320) {
13621362          tmpvar_318 = 1.0;
13631363        } else {
1364          tmpvar_318 = float((dot (texture2D (u_shadowMap3, tmpvar_319), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1364          tmpvar_318 = float((dot (texture2D (u_shadowMap3, tmpvar_319), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13651365            (_shadowCoord_317.z - u_params1.x)
13661366           / _shadowCoord_317.w)));
13671367        };
r245570r245571
13831383        if (tmpvar_325) {
13841384          tmpvar_323 = 1.0;
13851385        } else {
1386          tmpvar_323 = float((dot (texture2D (u_shadowMap3, tmpvar_324), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1386          tmpvar_323 = float((dot (texture2D (u_shadowMap3, tmpvar_324), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
13871387            (_shadowCoord_322.z - u_params1.x)
13881388           / _shadowCoord_322.w)));
13891389        };
r245570r245571
14051405        if (tmpvar_330) {
14061406          tmpvar_328 = 1.0;
14071407        } else {
1408          tmpvar_328 = float((dot (texture2D (u_shadowMap3, tmpvar_329), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1408          tmpvar_328 = float((dot (texture2D (u_shadowMap3, tmpvar_329), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14091409            (_shadowCoord_327.z - u_params1.x)
14101410           / _shadowCoord_327.w)));
14111411        };
r245570r245571
14271427        if (tmpvar_335) {
14281428          tmpvar_333 = 1.0;
14291429        } else {
1430          tmpvar_333 = float((dot (texture2D (u_shadowMap3, tmpvar_334), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1430          tmpvar_333 = float((dot (texture2D (u_shadowMap3, tmpvar_334), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14311431            (_shadowCoord_332.z - u_params1.x)
14321432           / _shadowCoord_332.w)));
14331433        };
r245570r245571
14491449        if (tmpvar_340) {
14501450          tmpvar_338 = 1.0;
14511451        } else {
1452          tmpvar_338 = float((dot (texture2D (u_shadowMap3, tmpvar_339), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1452          tmpvar_338 = float((dot (texture2D (u_shadowMap3, tmpvar_339), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14531453            (_shadowCoord_337.z - u_params1.x)
14541454           / _shadowCoord_337.w)));
14551455        };
r245570r245571
14711471        if (tmpvar_345) {
14721472          tmpvar_343 = 1.0;
14731473        } else {
1474          tmpvar_343 = float((dot (texture2D (u_shadowMap3, tmpvar_344), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1474          tmpvar_343 = float((dot (texture2D (u_shadowMap3, tmpvar_344), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14751475            (_shadowCoord_342.z - u_params1.x)
14761476           / _shadowCoord_342.w)));
14771477        };
r245570r245571
14931493        if (tmpvar_350) {
14941494          tmpvar_348 = 1.0;
14951495        } else {
1496          tmpvar_348 = float((dot (texture2D (u_shadowMap3, tmpvar_349), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1496          tmpvar_348 = float((dot (texture2D (u_shadowMap3, tmpvar_349), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
14971497            (_shadowCoord_347.z - u_params1.x)
14981498           / _shadowCoord_347.w)));
14991499        };
r245570r245571
15151515        if (tmpvar_355) {
15161516          tmpvar_353 = 1.0;
15171517        } else {
1518          tmpvar_353 = float((dot (texture2D (u_shadowMap3, tmpvar_354), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1518          tmpvar_353 = float((dot (texture2D (u_shadowMap3, tmpvar_354), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15191519            (_shadowCoord_352.z - u_params1.x)
15201520           / _shadowCoord_352.w)));
15211521        };
r245570r245571
15371537        if (tmpvar_360) {
15381538          tmpvar_358 = 1.0;
15391539        } else {
1540          tmpvar_358 = float((dot (texture2D (u_shadowMap3, tmpvar_359), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1540          tmpvar_358 = float((dot (texture2D (u_shadowMap3, tmpvar_359), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15411541            (_shadowCoord_357.z - u_params1.x)
15421542           / _shadowCoord_357.w)));
15431543        };
r245570r245571
15591559        if (tmpvar_365) {
15601560          tmpvar_363 = 1.0;
15611561        } else {
1562          tmpvar_363 = float((dot (texture2D (u_shadowMap3, tmpvar_364), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1562          tmpvar_363 = float((dot (texture2D (u_shadowMap3, tmpvar_364), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15631563            (_shadowCoord_362.z - u_params1.x)
15641564           / _shadowCoord_362.w)));
15651565        };
r245570r245571
15811581        if (tmpvar_370) {
15821582          tmpvar_368 = 1.0;
15831583        } else {
1584          tmpvar_368 = float((dot (texture2D (u_shadowMap3, tmpvar_369), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
1584          tmpvar_368 = float((dot (texture2D (u_shadowMap3, tmpvar_369), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
15851585            (_shadowCoord_367.z - u_params1.x)
15861586           / _shadowCoord_367.w)));
15871587        };
r245570r245571
16041604    tmpvar_375 = normalize(tmpvar_372);
16051605    tmpvar_373 = tmpvar_375;
16061606    highp float tmpvar_376;
1607    tmpvar_376 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
1607    tmpvar_376 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
16081608    highp float tmpvar_377;
16091609    tmpvar_377 = sqrt(dot (tmpvar_372, tmpvar_372));
16101610    tmpvar_374 = ((1.0/((
r245570r245571
16181618        normalize(u_lightSpotDirectionInner.xyz)
16191619      )) - tmpvar_376) / (cos((
16201620        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
1621       * 0.01745329)) - tmpvar_376))
1621       * 0.0174533)) - tmpvar_376))
16221622    , 0.0, 1.0), 1.0, float(
16231623      (u_lightAttenuationSpotOuter.w >= 90.0)
16241624    )));
r245570r245571
16431643    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
16441644      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_380.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_380.y)))
16451645     * u_color.xyz) * visibility_1)))
1646  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
1647    exp2(((1.767302e-5 * tmpvar_381) * tmpvar_381))
1646  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
1647    exp2(((1.7673e-05 * tmpvar_381) * tmpvar_381))
16481648  )), 0.0, 1.0));
16491649  gl_FragColor.xyz = tmpvar_382;
16501650  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParamsu_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0{Ivarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParamsu_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0uIvarying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
151151  if (tmpvar_38) {
152152    tmpvar_36 = 1.0;
153153  } else {
154    tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
154    tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
155155      (_shadowCoord_35.z - u_params1.x)
156156     / _shadowCoord_35.w)));
157157  };
r245570r245571
173173  if (tmpvar_43) {
174174    tmpvar_41 = 1.0;
175175  } else {
176    tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
176    tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
177177      (_shadowCoord_40.z - u_params1.x)
178178     / _shadowCoord_40.w)));
179179  };
r245570r245571
195195  if (tmpvar_48) {
196196    tmpvar_46 = 1.0;
197197  } else {
198    tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
198    tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
199199      (_shadowCoord_45.z - u_params1.x)
200200     / _shadowCoord_45.w)));
201201  };
r245570r245571
217217  if (tmpvar_53) {
218218    tmpvar_51 = 1.0;
219219  } else {
220    tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
220    tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
221221      (_shadowCoord_50.z - u_params1.x)
222222     / _shadowCoord_50.w)));
223223  };
r245570r245571
239239  if (tmpvar_58) {
240240    tmpvar_56 = 1.0;
241241  } else {
242    tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
242    tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
243243      (_shadowCoord_55.z - u_params1.x)
244244     / _shadowCoord_55.w)));
245245  };
r245570r245571
261261  if (tmpvar_63) {
262262    tmpvar_61 = 1.0;
263263  } else {
264    tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
264    tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
265265      (_shadowCoord_60.z - u_params1.x)
266266     / _shadowCoord_60.w)));
267267  };
r245570r245571
283283  if (tmpvar_68) {
284284    tmpvar_66 = 1.0;
285285  } else {
286    tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
286    tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
287287      (_shadowCoord_65.z - u_params1.x)
288288     / _shadowCoord_65.w)));
289289  };
r245570r245571
305305  if (tmpvar_73) {
306306    tmpvar_71 = 1.0;
307307  } else {
308    tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
308    tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
309309      (_shadowCoord_70.z - u_params1.x)
310310     / _shadowCoord_70.w)));
311311  };
r245570r245571
327327  if (tmpvar_78) {
328328    tmpvar_76 = 1.0;
329329  } else {
330    tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
330    tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
331331      (_shadowCoord_75.z - u_params1.x)
332332     / _shadowCoord_75.w)));
333333  };
r245570r245571
349349  if (tmpvar_83) {
350350    tmpvar_81 = 1.0;
351351  } else {
352    tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
352    tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
353353      (_shadowCoord_80.z - u_params1.x)
354354     / _shadowCoord_80.w)));
355355  };
r245570r245571
371371  if (tmpvar_88) {
372372    tmpvar_86 = 1.0;
373373  } else {
374    tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
374    tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
375375      (_shadowCoord_85.z - u_params1.x)
376376     / _shadowCoord_85.w)));
377377  };
r245570r245571
393393  if (tmpvar_93) {
394394    tmpvar_91 = 1.0;
395395  } else {
396    tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
396    tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
397397      (_shadowCoord_90.z - u_params1.x)
398398     / _shadowCoord_90.w)));
399399  };
r245570r245571
415415  if (tmpvar_98) {
416416    tmpvar_96 = 1.0;
417417  } else {
418    tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
418    tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
419419      (_shadowCoord_95.z - u_params1.x)
420420     / _shadowCoord_95.w)));
421421  };
r245570r245571
437437  if (tmpvar_103) {
438438    tmpvar_101 = 1.0;
439439  } else {
440    tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
440    tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
441441      (_shadowCoord_100.z - u_params1.x)
442442     / _shadowCoord_100.w)));
443443  };
r245570r245571
459459  if (tmpvar_108) {
460460    tmpvar_106 = 1.0;
461461  } else {
462    tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
462    tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
463463      (_shadowCoord_105.z - u_params1.x)
464464     / _shadowCoord_105.w)));
465465  };
r245570r245571
481481  if (tmpvar_113) {
482482    tmpvar_111 = 1.0;
483483  } else {
484    tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
484    tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
485485      (_shadowCoord_110.z - u_params1.x)
486486     / _shadowCoord_110.w)));
487487  };
r245570r245571
501501    tmpvar_118 = normalize(tmpvar_115);
502502    tmpvar_116 = tmpvar_118;
503503    highp float tmpvar_119;
504    tmpvar_119 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
504    tmpvar_119 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
505505    highp float tmpvar_120;
506506    tmpvar_120 = sqrt(dot (tmpvar_115, tmpvar_115));
507507    tmpvar_117 = ((1.0/((
r245570r245571
515515        normalize(u_lightSpotDirectionInner.xyz)
516516      )) - tmpvar_119) / (cos((
517517        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
518       * 0.01745329)) - tmpvar_119))
518       * 0.0174533)) - tmpvar_119))
519519    , 0.0, 1.0), 1.0, float(
520520      (u_lightAttenuationSpotOuter.w >= 90.0)
521521    )));
r245570r245571
540540    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
541541      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_123.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_123.y)))
542542     * u_color.xyz) * tmpvar_31)))
543  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
544    exp2(((1.767302e-5 * tmpvar_124) * tmpvar_124))
543  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
544    exp2(((1.7673e-05 * tmpvar_124) * tmpvar_124))
545545  )), 0.0, 1.0));
546546  gl_FragColor.xyz = tmpvar_125;
547547  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParamsu_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0DIvarying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuteru_smSamplingParamsu_tetraNormalGreenu_tetraNormalYellowu_tetraNormalBlueu_tetraNormalRed u_shadowMap0>Ivarying highp vec3 v_normal;
22varying highp vec4 v_position;
33varying highp vec4 v_texcoord1;
44varying highp vec4 v_texcoord2;
r245570r245571
147147  if (tmpvar_37) {
148148    tmpvar_35 = 1.0;
149149  } else {
150    tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
150    tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
151151      (_shadowCoord_34.z - u_params1.x)
152152     / _shadowCoord_34.w)));
153153  };
r245570r245571
169169  if (tmpvar_42) {
170170    tmpvar_40 = 1.0;
171171  } else {
172    tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
172    tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
173173      (_shadowCoord_39.z - u_params1.x)
174174     / _shadowCoord_39.w)));
175175  };
r245570r245571
191191  if (tmpvar_47) {
192192    tmpvar_45 = 1.0;
193193  } else {
194    tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
194    tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
195195      (_shadowCoord_44.z - u_params1.x)
196196     / _shadowCoord_44.w)));
197197  };
r245570r245571
213213  if (tmpvar_52) {
214214    tmpvar_50 = 1.0;
215215  } else {
216    tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
216    tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
217217      (_shadowCoord_49.z - u_params1.x)
218218     / _shadowCoord_49.w)));
219219  };
r245570r245571
235235  if (tmpvar_57) {
236236    tmpvar_55 = 1.0;
237237  } else {
238    tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
238    tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
239239      (_shadowCoord_54.z - u_params1.x)
240240     / _shadowCoord_54.w)));
241241  };
r245570r245571
257257  if (tmpvar_62) {
258258    tmpvar_60 = 1.0;
259259  } else {
260    tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
260    tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
261261      (_shadowCoord_59.z - u_params1.x)
262262     / _shadowCoord_59.w)));
263263  };
r245570r245571
279279  if (tmpvar_67) {
280280    tmpvar_65 = 1.0;
281281  } else {
282    tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
282    tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
283283      (_shadowCoord_64.z - u_params1.x)
284284     / _shadowCoord_64.w)));
285285  };
r245570r245571
301301  if (tmpvar_72) {
302302    tmpvar_70 = 1.0;
303303  } else {
304    tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
304    tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
305305      (_shadowCoord_69.z - u_params1.x)
306306     / _shadowCoord_69.w)));
307307  };
r245570r245571
323323  if (tmpvar_77) {
324324    tmpvar_75 = 1.0;
325325  } else {
326    tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
326    tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
327327      (_shadowCoord_74.z - u_params1.x)
328328     / _shadowCoord_74.w)));
329329  };
r245570r245571
345345  if (tmpvar_82) {
346346    tmpvar_80 = 1.0;
347347  } else {
348    tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
348    tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
349349      (_shadowCoord_79.z - u_params1.x)
350350     / _shadowCoord_79.w)));
351351  };
r245570r245571
367367  if (tmpvar_87) {
368368    tmpvar_85 = 1.0;
369369  } else {
370    tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
370    tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
371371      (_shadowCoord_84.z - u_params1.x)
372372     / _shadowCoord_84.w)));
373373  };
r245570r245571
389389  if (tmpvar_92) {
390390    tmpvar_90 = 1.0;
391391  } else {
392    tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
392    tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
393393      (_shadowCoord_89.z - u_params1.x)
394394     / _shadowCoord_89.w)));
395395  };
r245570r245571
411411  if (tmpvar_97) {
412412    tmpvar_95 = 1.0;
413413  } else {
414    tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
414    tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
415415      (_shadowCoord_94.z - u_params1.x)
416416     / _shadowCoord_94.w)));
417417  };
r245570r245571
433433  if (tmpvar_102) {
434434    tmpvar_100 = 1.0;
435435  } else {
436    tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
436    tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
437437      (_shadowCoord_99.z - u_params1.x)
438438     / _shadowCoord_99.w)));
439439  };
r245570r245571
455455  if (tmpvar_107) {
456456    tmpvar_105 = 1.0;
457457  } else {
458    tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
458    tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
459459      (_shadowCoord_104.z - u_params1.x)
460460     / _shadowCoord_104.w)));
461461  };
r245570r245571
477477  if (tmpvar_112) {
478478    tmpvar_110 = 1.0;
479479  } else {
480    tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.960464e-8, 1.525879e-5, 0.00390625, 1.0)) >= (
480    tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (
481481      (_shadowCoord_109.z - u_params1.x)
482482     / _shadowCoord_109.w)));
483483  };
r245570r245571
497497    tmpvar_117 = normalize(tmpvar_114);
498498    tmpvar_115 = tmpvar_117;
499499    highp float tmpvar_118;
500    tmpvar_118 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
500    tmpvar_118 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
501501    highp float tmpvar_119;
502502    tmpvar_119 = sqrt(dot (tmpvar_114, tmpvar_114));
503503    tmpvar_116 = ((1.0/((
r245570r245571
511511        normalize(u_lightSpotDirectionInner.xyz)
512512      )) - tmpvar_118) / (cos((
513513        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
514       * 0.01745329)) - tmpvar_118))
514       * 0.0174533)) - tmpvar_118))
515515    , 0.0, 1.0), 1.0, float(
516516      (u_lightAttenuationSpotOuter.w >= 90.0)
517517    )));
r245570r245571
536536    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
537537      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_122.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_122.y)))
538538     * u_color.xyz) * tmpvar_30)))
539  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
540    exp2(((1.767302e-5 * tmpvar_123) * tmpvar_123))
539  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)) * clamp ((1.0/(
540    exp2(((1.7673e-05 * tmpvar_123) * tmpvar_123))
541541  )), 0.0, 1.0));
542542  gl_FragColor.xyz = tmpvar_124;
543543  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin
r245570r245571
11FSHpjH -   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0ávarying highp vec3 v_normal;
2   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0Ûvarying highp vec3 v_normal;
23varying highp vec4 v_shadowcoord;
34varying highp vec3 v_view;
45uniform highp vec4 u_params1;
r245570r245571
9494        normalize(u_lightSpotDirectionInner.xyz)
9595      )) - tmpvar_21) / (cos((
9696        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
97       * 0.01745329)) - tmpvar_21))
97       * 0.0174533)) - tmpvar_21))
9898    , 0.0, 1.0), 1.0, float(
9999      (u_lightAttenuationSpotOuter.w >= 90.0)
100100    )));
r245570r245571
119119    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
120120      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_25.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_25.y)))
121121     * u_color.xyz) * tmpvar_7)))
122  , vec3(0.4545454, 0.4545454, 0.4545454)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
123    exp2(((1.767302e-5 * tmpvar_26) * tmpvar_26))
122  , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)) * clamp ((1.0/(
123    exp2(((1.7673e-05 * tmpvar_26) * tmpvar_26))
124124  )), 0.0, 1.0));
125125  gl_FragColor.xyz = tmpvar_27;
126126  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin
r245570r245571
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3.varying highp vec3 v_normal;
1FSHF­œ   u_params1   u_params2u_color u_materialKa u_materialKd u_materialKsu_lightPositionu_lightAmbientPoweru_lightDiffusePoweru_lightSpecularPoweru_lightSpotDirectionInneru_lightAttenuationSpotOuter u_shadowMap0 u_shadowMap1 u_shadowMap2 u_shadowMap3ÿ-varying highp vec3 v_normal;
22varying highp vec4 v_texcoord1;
33varying highp vec4 v_texcoord2;
44varying highp vec4 v_texcoord3;
r245570r245571
287287    tmpvar_79 = normalize(tmpvar_76);
288288    tmpvar_77 = tmpvar_79;
289289    highp float tmpvar_80;
290    tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.01745329));
290    tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.0174533));
291291    highp float tmpvar_81;
292292    tmpvar_81 = sqrt(dot (tmpvar_76, tmpvar_76));
293293    tmpvar_78 = ((1.0/((
r245570r245571
301301        normalize(u_lightSpotDirectionInner.xyz)
302302      )) - tmpvar_80) / (cos((
303303        min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001))
304       * 0.01745329)) - tmpvar_80))
304       * 0.0174533)) - tmpvar_80))
305305    , 0.0, 1.0), 1.0, float(
306306      (u_lightAttenuationSpotOuter.w >= 90.0)
307307    )));
r245570r245571
326326    abs((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * (u_materialKa * u_color.xyz)) + ((
327327      (((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * (u_materialKd * tmpvar_84.x)) + ((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * (u_materialKs.xyz * tmpvar_84.y)))
328328     * u_color.xyz) * visibility_1)))
329  , vec3(0.4545454, 0.4545454, 0.4545454)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
330    exp2(((1.767302e-5 * tmpvar_85) * tmpvar_85))
329  , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)) * clamp ((1.0/(
330    exp2(((1.7673e-05 * tmpvar_85) * tmpvar_85))
331331  )), 0.0, 1.0));
332332  gl_FragColor.xyz = tmpvar_86;
333333  gl_FragColor.w = 1.0;
trunk/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin
r245570r245571
Previous 199869 Revisions Next


© 1997-2024 The MAME Team