Commit Graph

923 Commits

Author SHA1 Message Date
Sandy
536c4cdbf5 Texture format info: Invert R and B in R5G6B5 (#2886)
d3d9: Do software conversion to take advantage of B5G6R5.
d3d11: Do software conversion to take advantage of B5G6R5.
gl: Set internal representation to swap R and B.
metal: Swizzle R and B and remove software conversion.
2022-08-23 06:46:56 -07:00
Sandy
054a9ecd83 Texture format info: Invert R and B in RGBA4 (#2878)
* texture format info: Invert R and B in RGBA4

d3d9: Revert 06c08adc9e to force software
      conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655262 to swizzle R and B
mtl: Swizzle channels

* metal: Remove explicit conversion of RGBA4 and RGB5A1 in osx

* metal: Set alpha bit to correct end of short
2022-08-22 19:03:22 -07:00
Sandy
58aeeaf155 texture format info: Invert R and B in RGB5A1 (#2876)
d3d9: Revert 76db2ed38d to force software
      conversion and use the format that does exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert b36aa71403 to swizzle R and B
mtl: Swizzle R and B
2022-08-22 17:36:50 -07:00
Бранимир Караџић
ec00fa1bc2 GL: Added component mapping stub. 2022-08-19 19:11:13 -07:00
Cedric Guillemet
6aad365c9e Enable MSAA setting at context creation for Android (#2854) 2022-08-04 06:51:38 -07:00
Cedric Guillemet
a3d52fab32 premultiplied backbuffer for UWP/SwapchainPanel (#2837)
* premultiplied backbuffer for UWP/SwapchainPanel

* init flag

* caps and feedback/opengl premul

* reduced #ifdef form

* removed ifdef
2022-07-18 09:23:57 -07:00
Бранимир Караџић
d0a4672307 Cleanup. 2022-07-10 23:26:39 -07:00
Бранимир Караџић
c066251750 Cleanup. 2022-07-10 20:46:11 -07:00
Бранимир Караџић
32192450c4 WebGL2: Fixed missing glReadBuffer import. 2022-07-10 19:03:28 -07:00
Cedric Guillemet
607a775009 FS Quad/MSAA for GLES3 (#2820) 2022-06-15 07:44:25 -07:00
Cedric Guillemet
f0cf1794e7 Fix MSAA with ARM Mali OpenGL ES (#2818)
* Fix MSAA with ARM Mali OpenGL ES

* indenting
2022-06-15 03:35:19 -07:00
Julian Xhokaxhiu
89ae74122c OpenGL: Enable sRGB texture format support for BC7 (#2800) 2022-05-17 10:54:37 -07:00
Sami Kyöstilä
09d8c34e34 GL: Properly reset FBO after emulated blit (#2782)
Reset the previously bound FBO after rendering an emulated blit instead
of binding the default framebuffer.

Co-authored-by: Sami Kyöstilä <sami.kyostila@unrealvoodoo.org>
2022-04-23 07:25:46 -07:00
TooMuchVoltage Software Inc
f6e0db1969 Fixing shadow2DProj in GLSL (#2775)
Removing erroneous extra bracket for aliasing shadow2DProj in GLSL. Would have caused compilation failure if used.
2022-04-20 06:33:17 -07:00
Christophe Dehais
f44818b548 Import glDrawBuffers() from WEBGL_draw_buffers extension (#2667) 2022-03-31 18:27:24 -07:00
Sandy
251e35ae09 Fixes for shader texture array in GLES3 (#2750)
* opengl: use texture for texture2DArray

* shaderc: Add default precision for sampler2DArray on GLES3
2022-03-29 13:14:21 -07:00
Sandy
c0cbaf2a43 gl: Get maxTextureLayers on versions 3.0 and up (#2749) 2022-03-29 10:57:33 -07:00
Christophe Dehais
6c9248914e Fix leaked FBO for depth/stencil only view (#2738) 2022-03-04 09:48:50 -08:00
Бранимир Караџић
ae7aeba72c GL: Fixed vertex layout binding. 2022-02-25 17:21:55 -08:00
Бранимир Караџић
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