Commit graph

696 commits

Author SHA1 Message Date
Ozkan Sezer
b34726884e do the direct3d tap dance for overscan hint only if SDL_VIDEO_RENDER_D3D == 1 2018-05-10 08:25:23 +03:00
Sam Lantinga
40f5b81553 Fixed bug 4134 - Render targets lose scale quality after minimizing a fullscreen window
Olli-Samuli Lehmus

If one creates a window with the SDL_WINDOW_FULLSCREEN_DESKTOP flag, and creates a render target with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"), and afterwards sets SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"), after minimizing the window, the scale quality hint is lost on the render target. Textures however do keep their interpolation modes.
2018-05-07 19:52:25 -07:00
Ryan C. Gordon
b014335598 Backed out changeset bd976b7b2b43
Apparently this still triggers a compiler warning, have to dig further.
2018-02-21 22:53:52 -05:00
Ryan C. Gordon
7d719ba6da android: apparently they fixed this header at some point. 2018-02-21 22:35:17 -05:00
sezero
d9c8979193 revert the recent typecast assignment changes (see bug #4079)
also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h  into generic function
pointer typedefs.
2018-02-12 17:00:00 +03:00
Sam Lantinga
6534481645 Fixed compile warning 2018-02-09 16:31:57 -08:00
Sam Lantinga
e9a1c0c9d0 Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
2018-01-30 18:08:34 -08:00
Sam Lantinga
10167096d7 Added availability check to fix compiler warning for symbol only available on tvOS 11.0 and newer 2018-01-10 10:42:40 -08:00
Alex Szpakowski
35a7e56e2d metal: set max texture size based on device capability. 2018-01-07 22:00:37 -04:00
Alex Szpakowski
eec1fe1f38 metal: Fix pipeline states to use the pixel format of the current render target, instead of a hard-coded format. 2018-01-07 16:57:32 -04:00
Alex Szpakowski
f09c79bde3 metal: Add support for YUV/NV12 texture formats. 2018-01-06 18:54:12 -04:00
Alex Szpakowski
825117dcd7 metal: use a private instead of managed buffer for the renderer's non-changing constant data.
Recommended by Xcode's Metal frame capture analysis.
2018-01-04 22:16:42 -04:00
Alex Szpakowski
b080c63c45 metal: Implement fast hardware clearing when possible, by deferring the start of a render pass until a clear or draw operation happens. 2018-01-04 19:29:33 -04:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Alex Szpakowski
7b8088185d metal: Misc. improvements.
- Use a single buffer for various non-changing constants accessed by the GPU, instead of multiple buffers.
- Do the half-pixel offset for points and lines using a transform matrix so we don't need a malloc when rendering.
- Don't add a half-pixel offset for other primitives and textures. This matches D3D and GL render behaviour.
- Remove the half-texel texture coordinate offset since it's not needed now that there's no more half-pixel position offset when rendering a texture.
- Don't try to set texture usage on iOS 8 since it doesn't exist there.
2018-01-03 00:43:01 -04:00
Alex Szpakowski
a879f3978e metal and moltenvk: fix highdpi. 2018-01-02 21:44:28 -04:00
Sam Lantinga
70e42bafac Fixed direction of y adjustment for new orthographic projection in the metal renderer 2018-01-02 14:32:15 -08:00
Sam Lantinga
088a7a4bc1 Fixed metal renderer pixel centers when drawing 2018-01-02 14:11:10 -08:00
Alex Szpakowski
70b738ba02 metal: Fix a typo preventing iOS compilation... 2018-01-01 23:06:08 -04:00
Alex Szpakowski
5eb1319f1d metal: Clean up manual reference counting. Fixes some memory leaks. 2018-01-01 23:03:50 -04:00
Alex Szpakowski
584e9b8cf6 iOS: fix build 2018-01-01 19:40:29 -04:00
Alex Szpakowski
ab9047d439 metal: Use sampler state objects instead of shader-declared samplers for linear vs nearest filtering.
This avoids a ton of shader duplication once multiple shaders that use samplers are added (e.g. the currently missing YUV shaders).
2018-01-01 19:37:16 -04:00
Alex Szpakowski
f6752e16ff metal: Add support for custom blend modes. 2018-01-01 18:06:27 -04:00
Alex Szpakowski
857571199f metal: implement SDL_RenderCopyEx, and fix a memory leak in SDL_CreateTexture. 2017-12-31 21:06:16 -04:00
Alex Szpakowski
56b4f2c655 metal: Use the existing cocoa code for creating a Metal view on macOS. Fixes the renderer size when the window is resized. 2017-12-31 15:30:08 -04:00
Alex Szpakowski
3668dd8ac9 metal: Respect the vsync flag on macOS 10.13+. 2017-12-30 22:39:55 -04:00
Alex Szpakowski
0d72a31759 metal: use a projection matrix instead of manually transforming vertices into clip space on the CPU. 2017-12-30 20:32:22 -04:00
Alex Szpakowski
94f975ceac metal: only 4 (instead of 5) vertices are needed to draw rectangles and textures, and only 3 (instead of 5) vertices are needed to cover the screen for the 'full-screen quad' when clearing. 2017-12-30 18:48:07 -04:00
Sam Lantinga
35623271c9 Fixed bug 3981 - Inverted logic bug in SDL_renderer "overscan" feature
Eric wing

There is a tiny bug in the new overscan code for the SDL_renderer.

In SDL_renderer.c, line 1265, the if check for SDL_strcasecmp with "direct3d" needs to be inverted.

Instead of:
if(SDL_strcasecmp("direct3d", SDL_GetCurrentVideoDriver())) {

It should be:
if(0 == SDL_strcasecmp("direct3d", SDL_GetCurrentVideoDriver())) {

This bug causes the "overscan" mode to pretty much be completely ignored in all cases and all things remain letterboxed (as before the feature).
2017-12-12 16:34:16 -08:00
Sam Lantinga
9827268cfa Added support for Android video textures 2017-12-12 12:52:17 -08:00
Sam Lantinga
1e762408f2 Merged latest changes from rel/streaming_client 2017-12-12 12:52:09 -08:00
Sam Lantinga
df9ab55151 The newer compilers generate the property boilerplate automatically 2017-12-11 11:34:53 -08:00
Sam Lantinga
945f36aba6 Fixed Mac OS X build 2017-12-11 11:02:51 -08:00
Sam Lantinga
be1dbd6b8f Backed out using pixel texture coordinates, it had weird visual side effects 2017-12-09 19:48:38 -08:00
Sam Lantinga
85a77617ea Fixed normalized coordinates when the viewport is set 2017-12-09 19:41:08 -08:00
Sam Lantinga
b70fcb5dcb Added support for linear sampling and pixel coordinates in the metal renderer 2017-12-09 15:00:41 -08:00
Sam Lantinga
60e8a20b88 Fixed pixel positioning and size for the Metal renderer 2017-12-09 12:58:41 -08:00
Ryan C. Gordon
5da972e7ff metal: fixed render target support.
--HG--
extra : rebase_source : 0d438b9eca6be9264b9f005beba23bdee94eb884
2017-12-09 03:28:23 -05:00
Ryan C. Gordon
32d7f91409 metal: Added some comments and FIXMEs.
--HG--
extra : rebase_source : 6a5b3bcfbb43cc34b72d646617c09af26f16632e
2017-12-09 03:27:52 -05:00
Ryan C. Gordon
9d117dde2b metal: Cleaned up some reference count politics.
--HG--
extra : rebase_source : 96d3ab1460cf610112d7fcbfc056c6a9faec3455
2017-12-08 18:26:26 -05:00
Sam Lantinga
f16b7e735b Added SDL_RenderGetMetalLayer() and SDL_RenderGetMetalCommandEncoder() 2017-12-08 14:30:10 -08:00
Sam Lantinga
021f7dab32 Fixed Metal renderer memory leak 2017-12-08 13:20:20 -08:00
Ryan C. Gordon
122fb6329f metal: Don't check if Metal is available if targeting modern macOS versions.
--HG--
extra : rebase_source : f007831a3ff9aebb17ec3529e6fee4c3ad63d0b1
2017-12-08 14:03:36 -05:00
Sam Lantinga
f9a5278047 Minor cleanup 2017-12-08 12:02:23 -08:00
Sam Lantinga
d8cb066822 Fixed minor memory leak in the Metal renderer 2017-12-08 11:35:19 -08:00
Sam Lantinga
644fefb7ac Added check for failure of D3D_ActivateRenderer() 2017-12-08 11:34:32 -08:00
Sam Lantinga
2abcf193b5 Fixed bug 1878 - Scaled texture draws with filtering produce wrapping artifacts.
Yuri K. Schlesner

When using texture filtering, there are filtering artifacts visible on the edges of scaled textures, where the texture filtering pulls in texels from the other side of the texture. Using clamping texture modes wouldn't completely fix this since source rectangles don't need to cover the whole texture. (See screenshot attached in next post.)

The opengl driver uses clamping on textures and so avoid this at least in the cases where the source rect is the whole texture. The direct3d driver does not and so has problems in every case. I'm not sure if it can actually completely be fixed, but at least enabling clamping for direct3d would be one step in the right direction.
2017-12-08 11:09:05 -08:00
Sam Lantinga
bb8d2413ee Defer getting the next drawable until we actually start rendering
This works better for games where there may be a bunch of simulation logic that needs to be run before the next rendering pass, and prevents blocking if the next drawable is busy.
2017-12-08 08:58:02 -08:00
Sam Lantinga
577d7d42ff Fixed runtime errors on iOS 2017-12-07 18:08:51 -08:00
Sam Lantinga
7e4560664b Fixed building for simulators or older iOS SDKs 2017-12-07 17:47:01 -08:00