* Fix DebugDraw shaders compilation
Pull request #2317 broke compilation of the DebugDraw shaders (vs_debugdraw_fill.sc, etc)
on the Intel mesa driver. Shaders with a version lower than 130 have no
support for uvec or ivec by default on OpenGL.
This patch detects when these shaders are present and bumps the version when appropriate.
* Removed the ivecs from the patch
It seems the ivecs are infact supported on versions lower than 130 on
OpenGL.
In non-embedded shaders there is a separation between essl binaries (examples/runtime/shaders/essl)
and glsl binaries (examples/runtime/shaders/glsl). On embedded shaders there is no such separation
and by default essl shaders are being used by the OpenGL runtime. This usually doesn't cause any
issues but in the case of the debugdraw shaders, that started using uvec4, this now leads to a
runtime error. This patch fixes this by splitting the embedded shaders into essl and glsl.
As asked, this is the first part of the change.
To be able to compile the 'examples/common/debugdraw' shaders, pull
request #2362 is needed.
Compiling 'fs_texture_array.sc' with shaderc for OpenGLES fails with a syntax error,
because the matrix transpose function definitions occur before extension directives,
in this case EXT_texture_array.
When using the multview / docking feature of dear imgui (availible on the main repo in the docking branch) dear imgui will use desktop relative coordinates instead of window relative. This causing the rendering to get "offseted" if not handled correctly.
Before this change the rendering matrix wasn't used at all and this has now been changed in the vertex shader.
Notice this change is fully backwards compatible with the relative windows as well as the upper left corner will always be set to 0,0 in that case thus this change will work with both versions.
I also added some changes to skip rendering if not needed (based on the the other backend implementations for dear imgui such as the OpenGL one)
* fix mip level computation for asmjs and add support for srgb textures in es2/webgl
* fix BX_TRACE in glcontext_html5.cpp
* fix wrong logic in texture validation
Co-authored-by: Sebastian Marketsmueller <sebastianm@hq.unity3d.com>
Co-authored-by: Vladimir Vukicevic <vladimir@pobox.com>
* Cleanup
* Request host-cached memory for readback
* Request device-visible memory for the uniform buffer
* Use more fine-grained image memory barrier stages
* Don't rebind vertex and index buffers if not necessary
* Timer queries
* Don't transition images during a renderpass
* Cache descriptor sets
* Trigger RenderDoc capture if requested
* Fix invalid command buffer after surface recreation
* Perform clear and blit before compute
* Use init.debug to enable validation layers
...instead of always enabling them in debug config
* Only resolve framebuffer once
* Report number of primitives without index buffer
* Minimize state changes
* Occlusion queries
* Transition swapchain image from undefined layout
* Make sure we have a combined graphics and compute queue family
Existing code already makes that assumption, otherwise we'd need different command queues and explicit resource queue transitions. The spec also guarantees that a device with such a queue family should exist.
* Release cached image views on texture destruction
* Fix stencil-only clear
* Fix non-zero integer format clear
* Annotate all optional functions with their extensions
* Support for BGFX_SAMPLER_SAMPLE_STENCIL
* Remove unused extension functions
* Support for BGFX_SAMPLER_BORDER_COLOR
* Undo descriptor set cache
Try this again in another PR... the hashing doesn't quite work with some bind combinations, and the cache needs a better eviction strategy
* Don't start renderpass for empty draw calls
* Advertize graphics debugger, if present
ie. RenderDoc
* Cleanup
* Only enable required features and extensions
* Don't spam warning about swapchain format fallback
* Cleanup
* Cleanup
* Request host-cached memory for readback
* Request device-visible memory for the uniform buffer
* Use more fine-grained image memory barrier stages
* Don't rebind vertex and index buffers if not necessary
* Timer queries
* Don't transition images during a renderpass
* Cache descriptor sets
* Trigger RenderDoc capture if requested
* Fix invalid command buffer after surface recreation
* Perform clear and blit before compute
* Use init.debug to enable validation layers
...instead of always enabling them in debug config
* Only resolve framebuffer once
* Report number of primitives without index buffer
* Minimize state changes
* Occlusion queries
* Transition swapchain image from undefined layout
* Make sure we have a combined graphics and compute queue family
Existing code already makes that assumption, otherwise we'd need different command queues and explicit resource queue transitions. The spec also guarantees that a device with such a queue family should exist.
* Release cached image views on texture destruction
* Fix stencil-only clear
* Fix non-zero integer format clear
* Annotate all optional functions with their extensions
* Support for BGFX_SAMPLER_SAMPLE_STENCIL
* Remove unused extension functions
* Support for BGFX_SAMPLER_BORDER_COLOR
* Undo descriptor set cache
Try this again in another PR... the hashing doesn't quite work with some bind combinations, and the cache needs a better eviction strategy
* Don't start renderpass for empty draw calls
* Advertize graphics debugger, if present
ie. RenderDoc
* Cleanup
* Only enable required features and extensions
* Don't spam warning about swapchain format fallback
* Cleanup