Sam Lantinga
c0d1f73247
d3d12: actually execute the pending commands before processing resize
...
This makes sure all the resources are in the expected state
Fix the D3D12 case in https://github.com/libsdl-org/SDL/issues/6376
(cherry-picked from commit df1bd07dee )
2022-10-24 20:37:00 +03:00
Sam Lantinga
923ab93969
d3d12: fixed window resize handling
...
Fixes https://github.com/libsdl-org/SDL/issues/6355
(cherry-picked from commit f99fc3268e )
2022-10-24 20:37:00 +03:00
Sam Lantinga
1f82b4a96f
d3d12: reset the vertex buffer size when it is released
...
(cherry-picked from commit 490c20f93f )
2022-10-24 20:37:00 +03:00
Sam Lantinga
77f3a9cbe8
Only advertise the SDL_PIXELFORMAT_EXTERNAL_OES format if we can build the shader for it
...
(cherry picked from commit 5bc85d6788 )
2022-10-04 12:33:16 -07:00
Sam Lantinga
b8dacc37b5
Pretty print shaders for debugging purposes
...
(cherry picked from commit 2970710b5d )
2022-10-04 12:33:16 -07:00
Sam Lantinga
a49a25671d
Fixed OpenGL ES shader compilation on Linux
...
(cherry picked from commit bc57d3e35c )
2022-10-04 12:33:16 -07:00
Sam Lantinga
284cf11778
Fixed uninitialized variable warning
...
(cherry picked from commit 8a15a738f3 )
2022-10-04 12:33:16 -07:00
Sam Lantinga
949addc94e
Fixed OpenGLES shaders failing after renderer has been created
...
Cache all the shaders up front, so we can verify that they won't silently fail at runtime.
If compiling the fragment shaders with the precision hint fails, try again without specifying precision.
Fixes https://github.com/libsdl-org/SDL/issues/6166
Fixes https://github.com/libsdl-org/SDL/issues/6174
(cherry picked from commit b5102a551b )
2022-10-04 12:33:16 -07:00
Amir
23a4b9bdd6
android: fix some compiler warnings
...
(cherry picked from commit 7f415ce587 )
2022-10-04 12:32:10 -07:00
Sam Lantinga
ce29ebc3b8
Add GLES2 shader prologue infrastructure. (by @eloj)
...
There is supposedly an OpenGL ES2 target that does not support precision specifiers. However, the existing logic to detect this is currently broken in two ways:
1) There's a typo of the `#ifdef` as `#if`.
2) Checking for `GL_FRAGMENT_PRECISION_HIGH` can not be the correct way to detect this platform. Other targets, including some desktops, will also not have this defined (for various reasons).
Because some of the shader code is missing precision specifiers, and because a default is ONLY provided if `GL_FRAGMENT_PRECISION_HIGH` is set, these other targets break.
Instead of 'hard-coding' the prologue string into shaders in the C source, use our ability to provide a list of strings to `glShaderSource` instead, leaving the determination to run-time.
This commit closes https://github.com/libsdl-org/SDL/pull/6182
(cherry picked from commit 29f4a5ba0e )
2022-10-04 12:29:27 -07:00
Cameron Cawley
e70db38d60
Fix compatibility with Windows XP
...
(cherry picked from commit 10e1ef00e2 )
2022-09-06 17:10:00 +03:00
Cameron Cawley
09b6956dcc
opengl: Support NV12 textures on GPUs with only 2 texture units
2022-08-16 07:30:13 -07:00
Francisco Javier Trujillo Mata
7d5ccae22d
Fix memory leak when destroying texture
2022-08-14 08:13:37 -04:00
Sam Lantinga
cb46e1b3f0
Removed unused variable
2022-08-12 20:51:44 -07:00
Ethan Lee
a28f426acb
render: Only update size/scale/viewport when moving to a new display, rather than all window movement.
...
We really only care about DPI changes here, so this both reduces work and also avoids weird cases where viewport state can be corrupted by trivial window events. This doesn't _completely_ get rid of the issue but this is somewhat intentional, since apps will definitely want to do a full reset when changing displays anyhow (otherwise DPI/adapter changes will screw things up, and that's out of our control as long as both window size and drawable size are exposed at the same time.
Note that OpenGL still captures window events because of weird platform-specific issues like macOS and viewport stretching!
Fixes #5949
2022-08-12 16:13:24 -04:00
Francisco Javier Trujillo Mata
20f9a1b8a4
Implement SetTextureScaleMode
2022-08-08 09:34:08 -07:00
Francisco Javier Trujillo Mata
fbb440d167
Invalidate texture in the UnlockTextureMethod
2022-08-06 12:11:34 -07:00
Sam Lantinga
5858c7dfce
Fixed OpenGL ES Shaders for systems that don't understand precision keywords
2022-08-05 16:17:10 -07:00
Francisco Javier Trujillo Mata
944111dbcf
Cleaning up video driver
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
83c1179744
Adding SetViewPortCommand
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
a9f4cda3f9
Adding setcliprect command
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
fb1a205e70
Implement blend modes
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
075f9016fa
Remove some unnecessary comments
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
ed301b123b
Updating supported format
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
1d1965b6ee
Removing the BGR_888 from texture supported
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f75c35c071
Add invalidate texture when it changes
2022-08-02 11:40:31 -07:00
Daniel Santos
5bb965be3d
Implement RenderLines
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
0f0e5b44dc
Increase size of pool for gsKit events
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f758cad81a
Remove non needed FillRects function
2022-08-02 11:40:31 -07:00
Daniel Santos
3cb124b98e
Implement RenderPoints
2022-08-02 11:40:31 -07:00
Daniel Santos
df6ebc2562
Implement FillRect
2022-08-02 11:40:31 -07:00
Daniel Santos
a152e467b1
Fix "implicit declaration" with memalign
2022-08-02 11:40:31 -07:00
Daniel Santos
33cbf9acbe
Fix some mixed declaration warnings
2022-08-02 11:40:31 -07:00
Daniel Santos
acf48f14ac
Vertex pointer revision
...
Now triangles are fully working
2022-08-02 11:40:31 -07:00
Daniel Santos
726180445e
Add textured triangle prim
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
2a70d492f0
Destroy texture properly
2022-08-02 11:40:31 -07:00
Daniel Santos
7b0486d490
Try triangles
2022-08-02 11:40:31 -07:00
Daniel Santos
d5305ee098
Do properly color assign
2022-08-02 11:40:31 -07:00
Daniel Santos
b48c74a316
Add GeometryQueue
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
3bfc8f554e
Removing some of the QueueCopy functions because they are legacy
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
be1219bd4e
Implement setDrawColor
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f1699ce735
Implementing Clear command and texture Update
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
c472b8dd45
Whole clean around render and video driver
2022-08-02 11:40:31 -07:00
Daniel Santos
cdf89fde91
Add triangle prim support
...
Improve line support
Add initial texture support
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
88e64f9ae1
Add natively supported colors
2022-08-02 11:40:31 -07:00
Daniel Santos
90e0e5c29d
Add point, line and rect support
2022-08-02 11:40:31 -07:00
Daniel Santos
147a71b976
Finish dummy driver
2022-08-02 11:40:31 -07:00
Daniel Santos
2660449c6c
Add dummy driver
2022-08-02 11:40:31 -07:00
slime
65647b3417
SDL_Render: use high precision texcoords in ES2 shaders, when possible
...
Fixes #5884
2022-07-22 19:03:53 -07:00
Sam Lantinga
b299cb3d3c
Added a utility function to calculate the next power of 2 for a value
2022-07-17 08:31:16 -07:00