We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5295

Summary: SDL_RenderCopy ARGB888 texture to IYUV texture, RGB color be lost
Product: SDL Reporter: aitemp
Component: renderAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86   
OS: Linux   

Description aitemp 2020-09-22 06:45:54 UTC
SDL_Texture *YUVtexture = SDL_CreateTexture(render, SDL_PIXELFORMAT_IYUV, /* YV12/NV12... */, SDL_TEXTUREACCESS_TARGET, width, height);
if (texture)
{
SDL_UpdateYUVTexture(YUVtexture, NULL, yPlane, yPicth, uPlane, uPicth, vPlane, vPicth);

SDL_Texture *RGBtexture = SDL_CreateTexture(render, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, width, height);
SDL_UpdateTexture(RGBtexture, NULL, rgbData, rgbPitch);

SDL_SetRenderTarget(m_render, YUVtexture);
SDL_RenderCopy(m_render, RGBtexture, NULL, NULL); /* Copy RGB texture to YUV texture */
SDL_SetRenderTarget(m_render, NULL);

SDL_RenderCopy(m_render, YUVtexture, NULL, NULL); /* RGB texture without color */
}
Comment 1 aitemp 2020-09-22 06:46:50 UTC
render is OPENGL