| Summary: | Pixel shader problem when recreating a texture for direct3d renderer | ||
|---|---|---|---|
| Product: | SDL | Reporter: | cmediaplayer <cmediaplayer.1> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | Keywords: | target-2.0.12 |
| Version: | 2.0.10 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
Why was this change necessary? The shader is reset when the texture is changed, and when the device is reset. Why would it need to be changed when creating a new texture that isn't bound to the rendering pipeline? (In reply to Sam Lantinga from comment #1) > Why was this change necessary? The shader is reset when the texture is > changed, and when the device is reset. Why would it need to be changed when > creating a new texture that isn't bound to the rendering pipeline? Thanks for your reply. Yes, you are right about the shader is reset when the texture is changed, and when the device is reset. But it has to be set back after resetting the texture. Otherwise the image on the screen becomes gray even it's not colored gray if you want to create new one. Because the device lost the shader. But when you resize the main window after recreated the texture, the problem goes away. Nobody wants to resize the window after changed the scale quality in the app. So that's why it's necessary. Okay, thanks for the report. I used your application and found the problem. It's fixed for the next release: https://hg.libsdl.org/SDL/rev/663f2daa3e4f Cheers, |
Hi, i already mentioned in the SDL discourse a bug that recreating of a texture occours pixel shader problem on direct3d renderer. There is no problem for direct3d11. You can see the issue by using my app named C Media Player which is available for Windows for free using my web site www.cmediaplayer.com. Just follow the steps: *Open a media file *When playing the file change the scale quality under the video menu. *You will see the problem. I already fixed this issue by editing the source code of SDL library in SDL_render_d3d.c source file in the function D3D_CreateTexture at line 554 by adding those pieces of code: if (data->drawstate.shader) { const HRESULT result = IDirect3DDevice9_SetPixelShader(data->device, data->drawstate.shader); if (FAILED(result)) { return D3D_SetError(“IDirect3DDevice9_SetPixelShader()”, result); } } If you push this patch, it would be nice for everyone who needs this patch. Thanks in advance Kadir