Commit Graph

904 Commits

Author SHA1 Message Date
Бранимир Караџић
4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Christophe Dehais
c0729cb09b Use m_gles3 flag more extensively (instead of compile-time ES version) (#2665) 2021-11-19 07:26:47 -08:00
Christophe Dehais
08cd17e3b8 Check if gl_Frag[Data/Color] are not already patched (#2661) 2021-11-18 13:12:38 -08:00
Бранимир Караџић
2cdba37415 GL: Fixed update surface size when texture is transcoded. 2021-11-11 20:00:18 -08:00
Christophe Dehais
65ae59a82b Fix 3D blit test (#2651)
bi.m_depth == 1 for usual 2D blit
2021-11-08 09:44:16 -08:00
Branimir Karadžić
7bfb8a7b38 More fixes. 2021-10-25 19:15:55 -07:00
Бранимир Караџић
8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -07:00
Andrew Willmott
1a001a67db Fix RG16F typo (#2603) 2021-09-16 07:23:27 -07:00
Бранимир Караџић
925fbe30ae Cleanup. 2021-08-14 12:39:50 -07:00
Бранимир Караџић
962a446055 Cleanup. 2021-08-14 08:33:25 -07:00
jwdevel
59a73fe9d3 Improve detection of EXT_gpu_shader4 (#2572)
This extension is used to detect support for gl_InstanceID and gl_VertexID. However, in more recent
versions of OpenGL, this is built-in functionality. On my system, it does not list that extension,
even though it supports those features, but BGFX was not detecting that.

Updated detection to look for GL>=3.1.

Note 1: even with this change, you do need to compile BGFX with the appropriate
BGFX_CONFIG_RENDERER_OPENGL value (>=31). The default of 21 is not high enough.

Note 2: Even with all of the above, you will likely hit issues with duplicate '#version' lines in
the generated shader code. For that, see issue #xxxx.

fixes issue #2570
2021-08-07 18:02:08 -07:00
kingscallop
6a529fca4b Fix usage of bx::findIdentifierMatch for gl_FragDepth (#2533)
When trying to find all the instances of gl_FragDepth
and replace them with bgfx_FragDepth it only finds
the first instance.
2021-06-05 13:56:00 -07:00
Branimir Karadžić
c5aea5325d Fixed MSVC build. 2021-05-19 07:03:02 -07:00
Бранимир Караџић
a47a1c8917 Fixed WebGL instancing and EGL context upgrade. 2021-05-18 22:41:51 -07:00
Бранимир Караџић
3214539bad Fixing WebGL + Android instancing. 2021-05-18 20:22:46 -07:00
pezcode
2c21f68998 VPRT support for D3D11, D3D12, GL (#2507)
* glsl-optimizer: whitelist ARB_shader_viewport_layer_array_enable

* D3D11: remove duplicate structs and enums

* D3D11: report BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* D3D12: report BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* GL: support for BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* D3D11: multi-layer MSAA resolve

* D3D12: multi-layer MSAA resolve

* D3D12: fix binding multi-layer resolved textures

* GL: fix multi-layer rendertarget creation
2021-05-05 11:58:21 -07:00
Бранимир Караџић
9310d19141 Cleanup. 2021-04-27 09:18:22 -07:00
Бранимир Караџић
d01f86a6a9 Cleanup. 2021-04-26 19:54:58 -07:00
Бранимир Караџић
c319aa909e Fixed build. 2021-04-23 22:30:21 -07:00
SnapperTT
ffde01f8c9 Fix change in blend rgba not being detected as a state change (#2494) 2021-04-23 20:15:01 -07:00
Hugo Amnov
24be4a38d0 WebGPU: Add texture format to shaderc (bin version 10) + streamline storage Images in shaders (#2482)
* WebGPU: Add texture format (shaderc bin version 10)

* WebGPU: Simplify storage images + Fix format decorations

* Shaderc: Cleanup Texture name assumption in textures
2021-04-20 20:18:49 -07:00
pezcode
900afe7644 GL: only unbind instance buffer if it changed (#2463) 2021-04-09 09:36:21 -07:00
simon chen
0b8677ed06 fix update bug when compressed texture create with BGFX_TEXTURE_SRGB (#2437)
Co-authored-by: chenmou.cm <chenmou.cm@alibaba-inc.com>
2021-03-30 19:50:19 -07:00
Lee Thomason
176ab53d45 Print error messages when shader doesn't compile. (#2378)
* Trace compile error if shader doesn't compile.

* remove redundant output

Co-authored-by: Lee Thomason <leet@unity3d.com>
2021-02-05 17:12:01 -08:00
Бранимир Караџић
16f441758f Fixed #2368. 2021-01-25 12:24:12 -08:00
kingscallop
758566b3af Make the provoking vertex consistent across OpenGL, D3D and Vulkan (#2360)
The default provoking vertex on OpenGL is the last of a triangle, but
on D3D and Vulkan it is the first.

This patch sets the provoking vertex to the first vertex on OpenGL.
2021-01-16 13:59:28 -08:00
Бранимир Караџић
af49c5d264 Happy New Year! 2021-01-14 15:53:49 -08:00
Branimir Karadžić
5c304dad3b Fixed issue #2330. Added support for 32-bit indices in transient index buffer. 2020-12-15 19:01:25 -08:00
Бранимир Караџић
86583e9bbd Cleanup. 2020-11-25 22:29:40 -08:00
Christophe Dehais
6b790dc96b Add opt-in compile flag for GL read back emulation (#2305)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-11-05 14:54:17 -08:00
Christophe Dehais
3a297ed3c0 Add support for OES_fbo_render_mipmap (#2303)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-10-30 11:58:36 -07:00
Christophe Dehais
3af46fd7dc Explicitly enable WebGL extensions (#2302)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-10-30 11:57:09 -07:00
pezcode
09c11bca29 Mip + blit fixes (#2281)
* D3D12: Fix readback for non-zero mip

* Fix blit with non-zero mip

This required clamping the blit extents to the mip size, which is moved out of the renderers now

* Assert formatting
2020-10-09 15:32:50 -07:00
Бранимир Караџић
e878147cf9 Added version info to debug stats. 2020-10-05 19:45:22 -07:00
MooZ
9d369ab4a0 Fixed msaa for OpenGL ES targets. (#2277) 2020-10-05 10:17:01 -07:00
kingscallop
436b7fab9e Adds UAV support for D3D12, Vulkan and reworked for OpenGL, D3D11 (#2119)
* Adds UAV support for D3D12, Vulkan and reworked support for OpenGL, D3D11

UAV support is now uniform across compute and draw.
To set a UAV you just use bgfx::setImage() and IMAGE2D in the shader, just like in compute.
Due to these changes shaders will have to be recompiled.

The changes include:
	- D3D11 requires patching of the UAV slot number (which is now done by modifying the DXBC instead of using a macro)
	- If the DXBC binary includes a debug chunk, that is also patched to match the new slot number
	- All the other renderers don't need any kind of patching
	- There are some shader annotations to better convert the UAV format used in hlsl to spirv

Possibility of further enhancements:
	- bgfx::setViewFrameBuffer() only supports binding to a framebuffer or, using BGFX_INVALID_HANDLE, to bind the default backbuffer. This doesn't allow for the case where there is no need to bind to either one of them, for example when using a fragment shader only to read and write to an UAV.

* Bump shader version, because they need to be recompiled.
2020-10-04 21:51:41 -07:00
Бранимир Караџић
ffb2518d5a Cleanup. 2020-09-28 10:05:18 -07:00
Christophe Dehais
816026a8bf Add blitting fallback for OGL (#2269)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-09-28 09:53:37 -07:00
kingscallop
cb8f6dfcec Fixes example 08 when using OpenGL (#2233)
This example was broken on Windows and Linux when using OpenGL.
The code path when using immutable compressed textures was wrong.
2020-08-16 11:42:42 -07:00
Julian Xhokaxhiu
daec25b6d0 OpenGL: Disable scissor testing while blitting framebuffers when MSAA is enabled (#2200) 2020-07-14 07:47:48 -07:00
Бранимир Караџић
a95ddd1c0c Reemoved use of old LineReader. 2020-06-20 15:14:54 -07:00
Бранимир Караџић
d5d3d29e9c Cleanup. 2020-06-20 14:29:25 -07:00
Бранимир Караџић
ce4fecc53e Cleanup. 2020-06-19 20:39:19 -07:00
Бранимир Караџић
38ac02695d Fixed emscripten build. 2020-06-19 20:36:44 -07:00
Бранимир Караџић
3f6d049470 Fixed Emscripten function calls. 2020-06-19 09:31:32 -07:00
Бранимир Караџић
2cbcb6ea90 RRenamed BX_CHECK to BX_ASSERT. 2020-06-16 10:06:18 -07:00
Бранимир Караџић
ee78de075c Cleanup. 2020-06-16 08:25:54 -07:00
Бранимир Караџић
5b42be38ec Cleanup. 2020-06-15 16:21:55 -07:00
Justin Murray
86bd3ad9ad Broadened bypass mechanism for bgfx default headers in the OpenGL renderer. This reflects the fact that, if the first line of a shader is already a #version declaration, we never want to write lines above that regardless of what version is declared. (#2168) 2020-06-12 21:16:06 -07:00
juj
75384ccfe1 Add checks for Emscripten API return values to make sure API calls are not failing (#2160) 2020-06-05 07:34:11 -07:00