sdl2_frt/src/render
Sam Lantinga 38549a7bba Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash
Roberto

I have debugged the code checking the function calls when Direct3D is the renderer, remember that with software and OpenGL renderers, this issue is not happening.

- Create the texture:
SDL_Texture *pTex = SDL_CreateTexture(pRenderer, iFormat, SDL_TEXTUREACCESS_TARGET, pSurf->w, pSurf->h);

- Update the texture:
SDL_UpdateTexture(pTex, NULL, pSurf->pixels, pSurf->pitch);
  SDL_render.c, SDL_UpdateTexture(): return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
    SDL_render_d3d.c, D3D_UpdateTexture(): if (D3D_UpdateTextureRep(data->device, &texturedata->texture, texture->format, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
      SDL_render_d3d.c, D3D_UpdateTextureRep(): if (D3D_CreateStagingTexture(device, texture) < 0) {
        SDL_render_d3d.c, D3D_CreateStagingTexture(): result = IDirect3DDevice9_CreateTexture(..., D3DPOOL_SYSTEMMEM, ...) --> FAIL! with INVALIDCALL code

After checking a bit the Microsoft documentation, I found this:

D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT. (https://msdn.microsoft.com/en-us/library/windows/desktop/bb172625%28v=vs.85%29.aspx)

The call that fails, is using D3DUSAGE_RENDERTARGET with D3DPOOL_SYSTEMMEM which is unsupported, hence the INVALIDCALL return code.
2015-06-04 00:56:11 -07:00
..
direct3d Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash 2015-06-04 00:56:11 -07:00
direct3d11 Fixed clip rectangle calculation when there is a viewport offset 2015-05-28 18:57:10 -07:00
opengl Fixed clip rectangle calculation when there is a viewport offset 2015-05-28 18:57:10 -07:00
opengles Fixed clip rectangle calculation when there is a viewport offset 2015-05-28 18:57:10 -07:00
opengles2 Fixed clip rectangle calculation when there is a viewport offset 2015-05-28 18:57:10 -07:00
psp Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
software Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
mmx.h Windows: Always set the system timer resolution to 1ms by default. 2015-04-20 12:22:44 -04:00
SDL_d3dmath.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_d3dmath.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_render.c Fixed bug 2367 - Bad mouse motion coordinates with two windows where one has changed logical size 2015-05-28 12:18:05 -07:00
SDL_sysrender.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_yuv_mmx.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_yuv_sw_c.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_yuv_sw.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00