Commit Graph

940 Commits

Author SHA1 Message Date
Branimir Karadžić
290295136b Added bx::Location, and removed allocator macros. 2023-04-23 19:19:22 -07:00
issam3105
c3e3053935 Fix call to non-existant glDrawBuffers on mobile WebGL 1 (#3068)
Co-authored-by: Issam <issam.dahmen@fittingbox.com>
2023-04-04 07:52:40 -07:00
Christophe Dehais
cd3a1ea7f8 [GL] Fix sRGB framebuffer write (#3032) 2023-02-02 09:16:32 -08:00
Бранимир Караџић
466c6a4e95 Happy New Year! 2023-01-14 10:05:12 -08:00
Raziel Alphadios
c2bc5177b5 Add support for remaining unsupported ASTC formats (#2963)
* Add support for remaining unsupported ASTC formats
Add new ASTC formats into pixelformats example and ninja scripts
Rebuild ASTC textures

* Update idl and generate
Move comma in pixelformats

Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2022-10-25 17:03:40 -07:00
Бранимир Караџић
8e4fc9deb4 Cleanup. 2022-10-14 07:12:32 -07:00
Christophe Dehais
f3ff07a7fc Simplify the sampler object code path selection in GL backend (#2955) 2022-10-14 07:08:26 -07:00
Бранимир Караџић
9e7aa2d2ef WebGL: Use sampler object if it's GLES3. 2022-10-13 18:29:03 -07:00
Cedric Guillemet
c3afd0e31d Remove alpha-premultiplied postprocess (#2948) 2022-10-06 07:06:45 -07:00
Branimir Karadžić
a06ee14802 Fixed issue #2944. 2022-10-03 20:19:19 -07:00
Бранимир Караџић
2d6c85ac7a Fixed emscripten build. 2022-09-23 10:01:47 -07:00
Бранимир Караџић
01f308dd58 GL: Fixed instace data offset when i_dataX is missing in shader. 2022-09-20 20:48:48 -07:00
jwdevel
f1f77a6cd3 Record frame num in view stats (#2908)
* Add 'frameNumber' to Frame struct

Previously, the frame number returned from bgfx::frame() was tracked separately in the Context. Now,
we store that information in the Frame. This will allow us to attach the frame number to ViewStats.

* Add frame number to ViewStats

When ViewStats are enabled, we tag each timer query with the current frame number, then include
that information in the final results. In this way, clients can correlate specific work that they
submitted to specific GPU timing information.

NOTE: Some backends not implemented, yet. They will always have 0 for frame number.
The ones which are implemented are:
 * OpenGL
 * Vulkan
 * D3D 9,11,12
 * Noop
2022-09-18 19:09:48 -07:00
pezcode
ba467be036 Add support for indirect draw with indirect count (#2925)
* Add indirect draw with indirect count (BGFX_CAPS_DRAW_INDIRECT_COUNT)

* Update bindings

* VK: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* D3D12: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* GL: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* 48-drawindirect: Use BGFX_CAPS_DRAW_INDIRECT_COUNT if available

* 48-drawindirect: Update shaders
2022-09-17 18:16:19 -07:00
Бранимир Караџић
72cbe83275 Removed bgfx::setPlatformData usage from entry example harness. 2022-08-25 20:07:03 -07:00
Sandy
85910e9778 Add BGR versions of 16 bit formats (#2897)
* pixelformats: Add BGRA4

* pixelformats: Add BGR5A1

* pixelformats: Add B5G6R5

* make idl
2022-08-25 16:08:06 -07:00
Sandy
561e91a62b opengl: Implement texture swizzle mapping (#2892)
* opengl: Implement texture swizzle mapping

* imageformats: Fix compilation on android

Android GLES does not have a definition for GL_BGR: Swizzle instead.
2022-08-25 06:54:57 -07:00
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