Inconsistent Emscripten behavior when rendering from non-alpha PNG to RGBA texture with SDL_BLENDMODE_BLEND
I'm not really sure whether this is an SDL renderer issue or an SDL_image one, but it's only manifested for me as the result of a sequence of steps involving loading a PNG from a file.
I used IMG_LoadTyped_IO to load a PNG that had no alpha channel into a surface, then SDL_CreateTextureFromSurface to make a texture.
My rendering target is a SDL_PIXELFORMAT_RGBA32 texture, and I'm in SDL_BLENDMODE_BLEND. When I call SDL_RenderTexture to draw that texture that I'd loaded, the result varies: it draws at full opacity in a Windows executable, and in an Emscripten webapp if I'm running it in Firefox, but it draws nothing if I'm running the same Emscripten webapp in Chromium.
For my own current purposes, I can easily work around this by just only using PNGs that have an alpha channel in the first place.
What version of SDL? What version of SDL_image?
SDL f8f8d87bfaf3d8557a5c13e0072964a537569b6c and SDL_image 979f0173086bb3a09bfb2f3ec2131c0355bedfaf
I'm sorry, but I haven't been able to come up with a reproducer for this inconsistency (I'd observed it in the course of quite a large program). For reference, the Chromium in question was "Version 128.0.6613.113 (Official Build, ungoogled-chromium) (64-bit)" and the Firefox was "132.0.1 (64-bit)", both on Linux.
I am observing one anomaly: SDL_SetRenderTarget(renderer, rgba32texture); SDL_RenderTexture(renderer, rgb24texture,NULL); sets the target RGBA texture's alpha channel to 0 as opposed to 255 or unchanged, which is a behavior that seems counterintuitive to me and worth documenting, but that's happening consistently without a cross-browser divergence (matching the Chromium, not Firefox, observation from before.)