| Summary: | [PATCH] Updated YUV texture is never drawn | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Cameron Gutman <cameron.gutman> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
| Attachments: | Patch to address the issue | ||
Created attachment 3836 [details]
Patch to address the issue
Patch added, thanks! https://hg.libsdl.org/SDL/rev/89b3e1e9839c |
My code implements a basic video rendering loop with the following code: SDL_UpdateYUVTexture(m_Texture, nullptr, frame->data[0], frame->linesize[0], frame->data[1], frame->linesize[1], frame->data[2], frame->linesize[2]); SDL_RenderClear(m_Renderer); SDL_RenderCopy(m_Renderer, m_Texture, nullptr, nullptr); SDL_RenderPresent(m_Renderer); This is broken in the latest HG (and 2.0.10 prerelease). It now only renders the first frame of video and nothing more. It continues to successfully present frames, but they are copies of the initial YUV texture. The problem is that the D3D renderer's SetDrawState() tries avoid making D3D calls if the texture is still in the same state as before. However, the texture's dirty status is not taken into account. As a result, UpdateDirtyTexture() is never called and the texture retains its original contents forever.