src/render


Log

Author Commit Date CI Message
Sylvain Becker 22a2decf 2019-06-28T16:38:42 Android: concurrency issues, make sure Activity is in running State when calling functions like SDL_CreateWindow, SDL_CreateRenderer, Android_GLES_CreateContext Bugs 4694, 4681, 4142
Sylvain Becker cfed0b77 2019-06-28T16:14:50 Add an "error" label in SDL_CreateRenderer (no op)
Ryan C. Gordon 31bb95f1 2019-06-21T15:07:39 direct3d: Use D3DPOOL_DEFAULT for vertex buffers after all, release correctly. Fixes Bugzilla #4679. Fixes Bugzilla #4537.
Cameron Gutman e681623c 2019-06-20T19:51:00 direct3d: Fix dirty textures failing to update Even if the texture itself has not changed since last time, the data may have so we must call UpdateDirtyTexture() to handle that possibility.
Ryan C. Gordon 7162649f 2019-06-18T18:58:39 opengl: Be more robust in failing cases. Load all possible symbols, not just until one fails, in case they get used during shutdown, etc. Fixes Bugzilla #4093.
Sam Lantinga 5dcac4cc 2019-06-18T10:08:19 Fixed 4669 - Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes Sylvain I think what happening with the software renderer is: * you're somehow in background (so texture creation is not possible) * it resizes and wants to push a SDL_WINDOWEVENT_SIZE_CHANGED It call: https://hg.libsdl.org/SDL/file/a010811d40dd/src/render/SDL_render.c#l683 * GetOutputSize * SW_GetOutputSize * SW_ActivateRenderer * SDL_GetWindowSurface * SDL_CreateWindowFramebuffer which is mapped to SDL_CreateWindowTexture and it ends up re-creating the surface/a texture, while being in background
Sylvain Becker e96d4760 2019-06-18T18:53:58 Android: resize with software rendering, reverted again (Bug 4669)
Sylvain Becker 12b92260 2019-06-18T18:40:40 Android: try to fix resize with software rendering (bug 4669)
Sylvain Becker 8a20d40d 2019-06-18T18:22:18 Android: revert commit SW_GetOutputSize, again (Bug 4669)
Sylvain Becker 98cc7589 2019-06-18T10:41:11 Android: prevent using SW_GetOutputSize with software renderer (Bug 4669)
Sam Lantinga 1213fe79 2019-06-14T13:56:42 Worked around "Undefined symbol: ___isPlatformVersionAtLeast()" link error on Xcode 11 beta
Ryan C. Gordon 3e9bf284 2019-06-11T15:06:35 software: Fixed compiler warning and dos2unix'd the endlines.
Ryan C. Gordon 04fedce0 2019-06-11T14:09:53 software: Correctly track viewport and cliprect. Fixes Bugzilla #4457.
Ryan C. Gordon a2f2b735 2019-06-11T13:02:56 direct3d: Use D3DPOOL_MANAGED for vertex buffers. Fixes Bugzilla #4537.
Ryan C. Gordon f7b7a972 2019-06-11T10:12:47 direct3d: Fixed SDL_RenderSetClipRect usage. Fixes Bugzilla #4459.
Ryan C. Gordon 4f59d372 2019-06-11T09:29:48 direct3d: don't dereference bogus pointer if current texture was destroyed. Fixes Bugzilla #4460.
Ryan C. Gordon a6af0b82 2019-06-11T02:31:57 direct3d: Fixed more compiler warnings on Visual Studio 64-bit builds.
Sam Lantinga b5e9ebba 2019-06-08T19:12:05 Fixed compiler warning warning C4018: '<' : signed/unsigned mismatch
Sam Lantinga 41c718db 2019-05-19T12:04:06 Fixed bug 4469 - make SDL_CreateTextureFromSurface pick a more appropriate format Sylvain Currently SDL_CreateTextureFromSurface picks first valid format, and do a conversion. format = renderer->info.texture_formats[0]; for (i = 0; i < renderer->info.num_texture_formats; ++i) { if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) && SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) { format = renderer->info.texture_formats[i]; break; It could try to find a better format, for instance : if SDL_Surface has no Amask, but a colorkey : if surface fmt is RGB888, try to pick ARGB8888 renderer fmt if surface fmt is BGR888, try to pick ABGR8888 renderer fmt else try to pick the same renderer format as surface fmt if no format has been picked, use the fallback. I think it goes with bug 4290 fastpath BlitNtoN when you expand a surface with pixel format of size 24 to 32, there is a fast path possible. So with this issue: - if you have a surface with colorkey (RGB or BGR, not palette), it takes a renderer format where the conversion is faster. (it avoids, if possible, RGB -> ABGR which means switching RGB to BGR) - if you have a surface ABGR format, it try to take the ABGR from the renderer. (it avoids, if possible, ABGR -> ARGB, which means switch RGB to BGR)
Sam Lantinga 2ee9b1dd 2019-05-19T11:01:36 Fixed bug 4025 - SDL_Renderer OpenGL : add support for textures ABGR, RGB, BGR Sylvain OpenGLES2 SDL renderer has support for textures ARGB, ABGR, RGB and BGR, whereas OpenGL SDL renderer only had ARGB. If you think it's worth adding it, here's a patch. I quickly tried and it worked, but there may be missing things or corner case.
Sylvain Becker d68e501d 2019-04-08T13:43:48 Fixed bug 4582 - Maximize/Resize not working on Windows 10 When viewport is set, projectionAndView changes, but ID3D11DeviceContext_UpdateSubresource was not called.
Ryan C. Gordon 8ab698af 2019-03-21T10:39:49 opengles2: Fix static analysis warning. Not clear if this could ever dereference NULL in real life, but better safe than sorry!
Sam Lantinga b2e76d86 2019-03-19T16:52:09 Fixed Windows RT build
Sylvain Becker b28e956b 2019-03-12T07:59:53 Fixed bug 4542 - Image flipped vertically when rendering on texture Have to recompute viewport because projection/glOrtho is different wether rendering is on target texture or not
Ryan C. Gordon 40781dfb 2019-02-04T23:35:18 opengles2: patched to compile.
Ryan C. Gordon b7504f31 2019-02-04T23:32:28 opengles2: keep cached texturing state correct.
Ryan C. Gordon a609c03a 2019-02-04T23:24:10 opengles1: keep cached texturing state correct.
Ryan C. Gordon 40a52cee 2019-02-04T18:55:39 render: Fix OpenGL draw state cache for various points of texture binding.
Sylvain Becker 07548602 2019-01-19T16:47:43 Fixed bug 3657 - Color-key doesn't work when an alpha channel is present When surface format is the same as renderer format, it still needs an intermediate conversion to transform colorkey to alpha.
Sylvain Becker be991f3a 2019-01-12T13:34:03 Fixed bug 4453 - GLES / GLES2: first white renderer clear cmd is drawn as black
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sylvain Becker 9cdd0dd9 2018-12-29T17:59:34 PSP renderer: use colors from 'draw' union (very likely, but un-tested)
Sylvain Becker ebd9efb3 2018-12-29T16:37:44 opengles 1: same fix as in bug #4433
Sylvain Becker 87b76369 2018-12-29T16:34:50 opengles 1: use color from 'draw' union in SetDrawState()
Alex Szpakowski dc344360 2018-12-21T20:53:31 render: Fix internal state getting out of sync when destroying a texture that was just rendered and then creating a new one, in the GL and GLES2 backends. Fixes bug #4433.
Ryan C. Gordon 0a705901 2018-12-19T18:10:02 render: Prefer the Metal renderer over OpenGL. This is the best option for macOS and iOS, the only platforms with Metal. Pre-Metal versions of these platforms will fall back to OpenGL (ES), as appropriate. Huge thanks to Alexander Szpakowski, who worked incredibly hard to get the Metal renderer to such a high-quality state!
Alex Szpakowski c7db6ade 2018-12-19T18:27:21 metal: Implement SDL_LockTexture for YUV formats.
Alex Szpakowski ce8c716a 2018-12-18T14:23:05 metal: Implement SDL_LockTexture for non-YUV textures.
Sylvain Becker e5476c65 2018-12-15T14:50:12 Fixed bug 4425 - promote to alpha format, palette surface with alpha values. SDL_CreateTextureFromSurface() forgets to choose a texture format with alpha for surfaces that have palettes with alpha values.
Sylvain Becker 39ec1699 2018-12-06T10:24:44 opengles2: fix prototype of glDeleteBuffers
Sylvain Becker 252dc85e 2018-12-06T09:22:00 Fix warnings detected on Android build
Sylvain Becker 6259a726 2018-12-05T16:13:12 Warnings: fix a documentation warning and missing prototypes
Ryan C. Gordon cca9d24c 2018-12-03T09:26:05 direct3d: be more aggressive about resetting invalidated cached state. Fixes Bugzilla #4402.
Ryan C. Gordon 939bf1c4 2018-12-03T02:06:17 render: fix some static analysis warnings.
Ryan C. Gordon 33f78eb1 2018-12-03T01:58:23 direct3d: Make sure streaming textures update before being used for drawing. Fixes Bugzilla #4402.
Ryan C. Gordon b744108a 2018-12-02T21:57:33 Patched to compile on C89 compilers.
Ryan C. Gordon 3c936150 2018-12-02T20:55:57 direct3d: Release and NULL out vertex buffers on reset. Otherwise they are irretrievably lost on window resize, etc, which makes rendering freeze and other disasters. Fixes Bugzilla #4358.
Alex Szpakowski 37b1f989 2018-11-25T22:13:09 metal: use a staging texture in SDL_UpdateTexture, to make sure it doesn't stomp texture data being drawn in a previous frame on the GPU.
Alex Szpakowski 872936a4 2018-11-21T23:46:37 metal: Fix an incorrect division.
Alex Szpakowski 4a58722b 2018-11-21T23:37:23 metal: SDL_RenderFillRects uses one draw call per 16k rectangles (within the given FillRects call), instead of one draw call per rectangle. Reduces CPU usage when drawing many rectangles.
Ryan C. Gordon 457e58c4 2018-11-17T16:24:52 opengles: Fixed compiler warnings.
Sam Lantinga 9719f89d 2018-11-17T12:12:29 Back out change initializing renderer blend mode incorrectly.
Ryan C. Gordon fde7592a 2018-11-17T14:39:42 direct3d11: Fixed missing rendering of solid primitives. Fixes Bugzilla #4388.
Ryan C. Gordon 782f1685 2018-11-17T14:37:51 Fixed a few compiler warnings.
Sam Lantinga 29e15ce6 2018-11-17T00:58:45 The default draw blendmode is SDL_BLENDMODE_NONE
Ryan C. Gordon 9262c0de 2018-11-14T22:38:58 software: fix blits with color mods that change during a command queue run.
Alex Szpakowski 244b79e1 2018-11-04T14:31:56 metal: SDL_RenderReadPixels on macOS synchronizes the render target's texture data if it's managed, before reading from it.
Alex Szpakowski c9fed272 2018-11-04T12:31:02 metal: fix the SDL_RENDERER_PRESENTVSYNC flag not being set on the renderer info on macOS, when vsync is used.
Alex Szpakowski c2bba9e4 2018-11-04T12:24:05 metal: fix the size of the buffer used for constant data.
Alex Szpakowski 457390fc 2018-11-01T20:24:21 metal: avoid an extra buffer allocation and GPU data copy in RunCommandQueue, it's not needed. Improves overall performance.
Alex Szpakowski 4e86dfd8 2018-11-01T19:49:01 metal: remove an obsolete section of a constant buffer.
Ozkan Sezer 0d79a8a1 2018-11-01T20:04:24 fix build using Watcom : ./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant ./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant ./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant ./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant ./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant ./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
Ryan C. Gordon 4659e738 2018-11-01T12:31:45 merge fallout: Patched to compile, fixed some compiler warnings, etc.
Cameron Gutman 329f2eb9 2018-10-31T20:17:53 Fix crash when GL_LoadFunctions()/GLES2_LoadFunctions() fails https://bugzilla.libsdl.org/show_bug.cgi?id=4350 We can't safely call GL_DestroyRenderer() until GL_LoadFunctions() succeeds because we will be missing functions that we try to use when activating the renderer for destruction if we have an GL context.
Ryan C. Gordon 62494a2e 2018-10-31T15:03:41 Merge SDL-ryan-batching-renderer branch to default.
Sam Lantinga da56cefa 2018-10-30T07:00:03 Fixed bug 4188 - Software renderer SDL_RenderCopyEx blits corrupt image under certain cases Sylvain Re-opening this issue. It fixes the test-case, but it introduces a regression with another bug (bug #4313). So here's a new patch that activate cropping of the source surface to solve the issue. It also reverts the wrong changeset. It prevents unneeded colorkey error message.
Micha? Janiszewski 91820998 2018-10-28T21:36:48 Add and update include guards Include guards in most changed files were missing, I added them keeping the same style as other SDL files. In some cases I moved the include guards around to be the first thing the header has to take advantage of any possible improvements compiler may have for inclusion guards.
Ryan C. Gordon 8340b0f0 2018-10-23T01:34:03 render: Add floating point versions of various draw APIs.
Ryan C. Gordon b262b0eb 2018-10-22T20:50:32 Small stack allocations fall back to malloc if they're unexpectedly large.
Alex Szpakowski 8c41e262 2018-10-13T03:36:42 metal: Fix SDL_RenderReadPixels to wait for the GPU to finish rendering to the active texture before reading its pixels.
Alex Szpakowski d9094421 2018-10-12T17:55:42 metal: Fix high dpi and resizing on macOS, and clean up iOS code. Fixes bug #4250.
Sam Lantinga 82c2f04e 2018-10-09T17:41:40 Fixed bug 4188 - Software renderer SDL_RenderCopyEx blits corrupt image under certain cases duckgrease SDL_RenderCopyEx blits wrong image (in some cases it's bunch of alternating horizontal lines, some cases it's image from the wrong coordinate, and in some cases it's just a bunch of garbled pixels), when the following conditions are met: - Use software renderer. - Enable either horizontal or vertical flip. - source and destination rectangles must have same width and height, and must be smaller than the size of the texture. - source rectangle's X and Y coordinates must be 0.
Ryan C. Gordon eedf2c96 2018-10-06T17:08:04 opengles2: Fixed several incorrect things.
Ryan C. Gordon 6ecd0b2c 2018-10-04T21:10:42 opengles2: removed useless memcpy.
Ryan C. Gordon ef3d970a 2018-10-04T20:22:28 opengles2: Fixed incorrect cliprect state.
Ryan C. Gordon 208c4b03 2018-10-04T20:21:58 metal: CopyEx transform matrix must be aligned for constant buffer access.
Ryan C. Gordon 638d624f 2018-10-04T20:21:23 metal: Don't try to create a zero-byte vertex buffer. (Which will cause a crash in Metal, or an assert in the validation layer.)
Ryan C. Gordon 1ecf4dfc 2018-10-04T16:34:44 render: Added SDL_RenderFlush().
Ryan C. Gordon 09140bd8 2018-10-04T16:11:43 render: Move PSP backend to new interface. I have no idea if this works (or if it ever worked, having now examined this code), as I have no way to compile or test this. If it's broken, send patches. :)
Ryan C. Gordon 9fedff99 2018-10-03T23:37:29 render: moved software renderer to new interface.
Ryan C. Gordon bd08a4e6 2018-10-03T19:05:20 render: D3D11 now cycles through 8 vertex buffers. This means it doesn't have to block while the current frame finishes using the vertex buffer; it just moves on to the next, probably-not-in-use buffer.
Ryan C. Gordon a9094a21 2018-10-03T18:23:53 render: D3D11 renderer patched to compile.
Ryan C. Gordon 6e6f7382 2018-10-03T00:52:37 render: first (untested!) shot at converting D3D11 renderer to new interfaces. Probably doesn't even compile yet.
Ryan C. Gordon 0c2e10dc 2018-10-01T22:53:45 render: Make the GL backends cache and defer more state changes.
Ryan C. Gordon fcb46813 2018-10-01T13:41:15 render: D3D9 doesn't need to check for stream offset support anymore. We don't use offsets at all now. Too slow.
Ryan C. Gordon 709f5ee4 2018-10-01T11:32:08 render: Set the D3D9 stream source once and choose offsets during draw calls. This is _much_ faster than setting the offsets with SetStreamSource!
Ryan C. Gordon 9870746b 2018-10-01T03:02:54 render: Patched to compile.
Ryan C. Gordon 5e644cfd 2018-10-01T01:23:02 render: first shot at moving Direct3D 9 backend to new interface. Untested!
Ryan C. Gordon fdc52a65 2018-09-29T04:00:38 render: patched to compile on C89 compilers, other untested code fixes.
Ryan C. Gordon daad53af 2018-09-28T19:48:14 opengles1: set some non-zero drawstate defaults.
Ryan C. Gordon c20a858d 2018-09-28T19:47:44 render: moved opengles2 over to new interface.
Sam Lantinga 20dfda44 2018-09-28T00:40:35 Fixed mingw-w64 build
Sam Lantinga 7df0f4fd 2018-09-27T14:56:29 Fixed bug 4277 - warnings patch Sylvain Patch a few warnings when using: -Wmissing-prototypes -Wdocumentation -Wdocumentation-unknown-command They are automatically enabled with -Wall
Sam Lantinga 60afec79 2018-09-25T19:53:16 Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)
Ryan C. Gordon 0d588cc4 2018-09-25T21:35:09 render: Do state cache improvements for GLES1, too.
Ryan C. Gordon d04e5524 2018-09-25T19:20:31 render: OpenGL renderer now caches some state, to improve non-batching mode. (other minor bug fixes in here, too)
Ryan C. Gordon 06461bba 2018-09-25T17:04:47 render: Move non-batching flushes to different place. This lets us batch up a few commands that are all related to the same API call.
Ryan C. Gordon 43f15e05 2018-09-25T16:17:10 render: opengles renderer actually works now. :)
Ryan C. Gordon b2db99cb 2018-09-25T10:41:25 render: First shot at converting opengles renderer to new interfaces.
Sam Lantinga ef347048 2018-09-24T16:41:55 Fixed bug 4264 - SDL_CreateTextureFromSurface generates error message but returns ok Anthony @ POW Games SDL_CreateTextureFromSurface makes an internal call to SDL_GetColorKey which can return an error and spams the error log with "Surface doesn't have a colorkey" even though the original function didn't return an error.