-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL3: MaOS 15.2: metal renderer artifacts on SetRenderTexture #12047
Comments
Line 532 in df3cfbc
You need to clear the texture after you create it. |
Here is code I added at setup time. I still get the artifacts, again, outside the destination rectangle. I would understand the Texture not being set filled with random junk but wouldn't that just show And I do clear the Render target (the window) also. I must be missing something?
|
Your backbuffer contents are also not defined. You need to clear the screen each frame before rendering your texture. |
Hi,
I have an application (an 8-bit computer emulator) I am writing.
I am testing on a MacBook Pro M1 (ca 2020).
I draw the emulated screen into a Texture, and periodically RenderTexture and RenderPresent to load latest version of frame onto the screen.
I do use LockTexture, UnlockTexture. (see code below).
When SDL uses the default renderer (NULL selects Metal I believe), and SDL_RenderTexture specifies a destination Rectangle, I get artifacts outside of the destination rectangle. See attached image. There is a border area, the window is about 25 pixels border larger than the target rectangle.
If I get rid of the target rectangle, and have SDL_RenderTexture blit to the whole window, there are no artifacts. (of course, if there were they might be outside the window area).
If I change the renderer from default to OpenGL, there are no artifacts either. The artifacts vary over time. As the cursor in my emulator blinks, different randomish pixels are displayed in the borders.
here is my SDL init routine, and here is the function that does the update.
I have been over the update function and the functions it calls with a fine-toothed comb and cannot find any out of bounds memory references. And again with opengl as the renderer there are no artifacts.
I am thinking this must be a bug in SDL somewhere because, to reiterate:
no artifacts using opengl renderer
no artifacts if I do not specify a destination rectangle
However, I am very new to SDL programming and would be happy to be wrong :-)
The text was updated successfully, but these errors were encountered: