Commit Graph

852 Commits

Author SHA1 Message Date
kingscallop
eaab1be079 Fix GpuShader5 extension on Intel and support 'bitsTo' functions (#2118)
GpuShader5 extension isn't supported on fragment shaders.
Bumps the GLSL version to support the 'bitsTo' functions when present on the shader.
2020-04-26 20:43:03 -07:00
Бранимир Караџић
23998f3d78 Fixed typo. 2020-04-08 08:05:11 -07:00
Бранимир Караџић
5555c73b3a Cleanup. 2020-04-07 23:59:16 -07:00
Бранимир Караџић
1361ccf211 Revert "Revert "Avoid redundant uniform uploads (#2090)""
This reverts commit c023ac4620.
2020-04-07 23:43:21 -07:00
Бранимир Караџић
c023ac4620 Revert "Avoid redundant uniform uploads (#2090)"
This reverts commit d9d9865ad9.
2020-04-07 23:23:54 -07:00
juj
d9d9865ad9 Avoid redundant uniform uploads (#2090)
* Avoid redundant uniform uploads

* Fix placement of GL_CHECK()s and import of glUniform4f.

* Fix typo

* Migrate GL uniform cache to use tinystl to conform to BGFX data structures

* Address review

* Address review
2020-04-07 23:08:09 -07:00
G
f07a0f5179 Added support for the extension OES_EGL_image_external(_essl3) for GLES2/3 (#2021)
Co-authored-by: Gabriel <gabriel.sulka@visiarc.com>
2020-04-06 08:20:49 -07:00
Pablo Escobar
1b85139371 Revert "Remove debug label quotes"
This reverts commit 08b3ec5814.
2020-04-03 21:56:54 +00:00
Pablo Escobar
fdcdeae23a Remove debug label quotes 2020-04-03 21:56:54 +00:00
Бранимир Караџић
ebc55f8083 Cleanup. 2020-03-31 18:52:02 -07:00
paul gruenbacher
c92e647b1a add missing flags to conditional check 2020-03-31 23:47:40 +00:00
Бранимир Караџић
f2290c1b57 Move GL_CHECK to GL callsites. 2020-03-30 09:08:10 -07:00
paul gruenbacher
5b9dd78383 make sure depth textures are resolved as well when blitting frameBuffer 2020-03-30 15:57:13 +00:00
Бранимир Караџић
a594cfa391 Cleanup. 2020-03-30 08:38:33 -07:00
Jukka Jylänki
7aed93f392 Adjust integer texture format enums for desktop OpenGL < 4.0 2020-03-30 15:35:15 +00:00
Jukka Jylänki
3ad3227595 Revert back to using GL_HALF_FLOAT (that is GL_HALF_FLOAT_OES) 2020-03-30 15:35:15 +00:00
Jukka Jylänki
43bd07f825 Fix OpenGL ES texture formats and remove runtime texture probing on WebGL. 2020-03-30 15:35:15 +00:00
Бранимир Караџић
e495c613a5 Cleanup. 2020-03-30 08:34:58 -07:00
Jukka Jylänki
4a8276cb29 Optimize glUniform1iv and glUniform4fv to use faster glUniform1i and glUniform4f on WebGL. 2020-03-30 15:26:49 +00:00
Jukka Jylänki
bab9dc752e Avoid redundant GL calls to glEnableVertexAttribArray() and glDisableVertexAttribArray(). #1960 2020-03-30 15:26:15 +00:00
Бранимир Караџић
29dc60b068 Revert "Fix RGBA4 and RGB5A1 format & internalFormat"
This reverts commit 5b9b75abb2.
2020-03-02 22:09:05 -08:00
Бранимир Караџић
09de2467d5 Revert "Fix RGBA4 and RGB5_A1 type. GL_UNSIGNED_SHORT_4_4_4_4_REV and GL_UNSIGNED_SHORT_1_5_5_5_REV do not exist in GLES, only in desktop OpenGL, but the non _REV verrsion is present in both"
This reverts commit c56d843565.
2020-03-02 22:09:00 -08:00
Jukka Jylänki
c56d843565 Fix RGBA4 and RGB5_A1 type. GL_UNSIGNED_SHORT_4_4_4_4_REV and GL_UNSIGNED_SHORT_1_5_5_5_REV do not exist in GLES, only in desktop OpenGL, but the non _REV verrsion is present in both 2020-03-03 06:04:45 +00:00
Jukka Jylänki
5b9b75abb2 Fix RGBA4 and RGB5A1 format & internalFormat 2020-03-03 04:08:27 +00:00
Jukka Jylänki
e1b3fe6d75 Fix OpenGL ES depth&stencil format querying. 2020-03-02 16:55:39 +00:00
Jukka Jylänki
d539f3425f Avoid querying GL_MAX_ARRAY_TEXTURE_LAYERS and GL_MAX_LABEL_LENGTH if it is known at compile time that the GL context is not new enough to have them. 2020-03-02 16:54:25 +00:00
Sandy Carter
d7e3f03780 shaderc_glsl: Fix error when mixing SamplerArray and flat keyword
Use of the `flat` keyword will have `glslopt_optimize` run with glsl
version 130. In this mode, it will change calls of `texture2DArray` to
the more general `textureArray`. However, this call results in an error
when reading the compiled shader:

```
bgfx/src/renderer_gl.cpp:5904: BGFX Failed to compile shader.
0: 0(45) : error C1503: undefined variable "textureArray"
```
Defining this call to be `texture` avoids this error.
2020-02-20 16:05:00 +00:00
Sandy Carter
77fdc487ab opengl: Fix color ordering of RGBA4 2020-02-08 09:21:12 -08:00
Бранимир Караџић
3002159da9 Fixed state tracking. 2020-02-04 09:51:21 -08:00
Sandy Carter
5924652151 rebind instance data buffer if index offset changes
Fix case of drawing different offsets of indices of same vertex buffer
using same instance data.

This can happen in the case of conditionally drawing subsets of vertex
buffer stored in different offsets of the same index buffer while re-using
non-transient instance buffers.
2020-02-04 07:38:36 -08:00
Sandy Carter
a38e873f8a rebind instance data buffer if index buffer changes
Fix case of drawing different indices of same vertex buffer using same
instance data.

This can happen in the case of conditionally drawing subsets of vertex
buffer stored in different index buffers while re-using non-transient
instance buffers.
2020-02-01 09:18:51 -08:00
Алексей Тулинов
ac9c330100 Fixes #2000. Restored old behavior of handling shaders with "#version 430" in them. 2020-01-29 19:23:31 -08:00
Бранимир Караџић
6a1287e43d Cleanup. 2020-01-23 09:10:05 -08:00
Cedric Guillemet
b4cac17b93 default parameters 2020-01-21 09:11:53 -08:00
Cedric Guillemet
4b83e0f5bc discard flags 2020-01-21 09:11:53 -08:00
Бранимир Караџић
82f56b5987 Happy New Year! 2020-01-14 21:37:06 -08:00
Boris Shirvinskii
6284cde9d6 [iOS] disabling D16 and D24S8 texture formats as it appears they are not supported
tested on the full range of iOS devices from iPhone 5s to iPhone 11
2019-12-04 09:28:01 -08:00
Sandy
3a78f007ef Fix inconsitency between Backends for RGB5A1 (#1932)
* opengl: Fix color ordering of RGB5A1

* vulkan: Fix color ordering of RGB5A1

* d3d9: Fix color ordering of RGB5A1
2019-11-03 07:10:55 -08:00
Cedric Guillemet
6a883a33fd Front facing (#1904)
* Added BGFX_STATE_FRONT_CCW to defines.h and implemented initial usage only in renderer_d3d11.cpp.

* set front facing for d3d12, gl metal and vulkan

* front facing method Metal

* tabs

* removed tab
idl updated
2019-10-25 20:07:05 -07:00
Sebastian Marketsmueller
85bc4db6f5 fix mip level computation for asmjs and add support for srgb textures in es2/webgl (#1922) 2019-10-25 14:49:12 -07:00
Christophe Dehais
c6fc1b069d End debug group before switching context 2019-09-06 18:57:09 -07:00
kingscallop
0c90be66d0 Fix gl_FragColor for example 41
Support gl_FragColor with glsl fragment shaders with version 430. (Fixes example 41 using opengl)
2019-09-01 15:07:06 -07:00
kingscallop
fe045d0c98 Fix gpu_shader4 for some drivers
- Add gl_InstanceID (GL_ARB_draw_instanced) support for drivers that don't implement GL_EXT_gpu_shader4 extension (e.g. mesa driver 'i915' on Pentium G3258).
- Don't emit the glsl extension GL_EXT_gpu_shader4 if it isn't supported by the driver (e.g. mesa driver 'i915'). In case the shader uses gl_VertexID, bump up the shader version to 130.
2019-09-01 15:06:35 -07:00
Leandro Freire
1db46f4fe6 Rename variables and constants 2019-08-17 12:32:16 -07:00
Leandro Freire
855623e153 Rename VertexDecl to VertexLayout 2019-08-13 18:42:01 -07:00
DanielGavin
e14c077b32 command sync (#1823)
Added command barrier bit when submitting with an indirect buffer - this fixes the flickering on tess-41
2019-07-21 17:33:50 -07:00
Vladimir Vukicevic
3d460e0445 Work around emscripten double-reporting GL error 2019-07-02 01:24:15 +00:00
Bastien Brunnenstein
e9ad3a6eba Use SRGB texture format on backbuffer when MSAA is enabled 2019-06-13 23:51:22 +02:00
Бранимир Караџић
8b6f466493 OS: Fixed texture2DArrayLod. 2019-05-25 19:33:54 -07:00
SnapperTT
14f13ae656 Fixed MRT buffers not being cleared if homogeneousDepth is disabled 2019-05-21 15:58:51 +10:00