Commit Graph

842 Commits

Author SHA1 Message Date
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
SnapperTT
4842c84e56 Fixes blitter not taking into account homogeneousDepth
If the opengl render has been modified to allow glClipControl to create a hetrogeneous depth buffer then anything blitted using the internal blit() functions will set to z=-1 and culled, making things such as debug text invisible. This fixes this
2019-05-01 10:24:49 +10:00
Hugo Amnov
594cc27a65 Implement aliasing vertex buffer with different vertex declaration. 2019-04-16 18:19:55 +02:00
Бранимир Караџић
a1c39c7190 Cleanup. 2019-03-27 09:58:11 -07:00
Jan-Eric Duden
e4f0d6893a FIX asan error (false positive). Use of bx::uint32_cnttz with 0 results in undefined value. 2019-03-27 16:40:41 +01:00
Benjamin Grange
ccbb9ac6bc Fix GL texture array
Bad num layers
2019-03-16 20:43:37 +01:00
Бранимир Караџић
b19afc2e7d Cleanup. 2019-02-20 20:17:40 -08:00
Branimir Karadžić
1b9dd14683 Fixed framebuffer RW. 2019-02-18 13:40:17 -08:00
Бранимир Караџић
9d6205654d GL: Fixed glPush/PopDebugGroup stub. 2019-02-17 14:52:57 -08:00
Бранимир Караџић
e3e7e9aaf4 Cleanup. 2019-02-17 09:03:09 -08:00
Hugo Amnov
58563b0b1b FrameBuffer Read/Write access WIP 2019-02-17 16:50:26 +01:00