sdl2_frt/src
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
..
atomic Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
audio Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
core Changed a static function to match the naming scheme of rest of source file. 2015-06-01 01:25:22 -04:00
cpuinfo Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
dynapi Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
events Fixed bug 2096 - Mapping from scancode to keycode doesn't work for remapped modifier keys 2015-05-28 12:48:20 -07:00
file Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
filesystem Windows SDL_GetBasePath: free string on failure. 2015-05-28 15:36:27 -04:00
haptic I think this will be the time... 2015-05-28 01:27:24 -04:00
joystick Another attempt to get this to compile. 2015-05-28 01:08:33 -04:00
libm Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
loadso Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
main Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
power Linux: Implemented sysfs-based version of SDL_GetPowerInfo(). 2015-06-03 13:11:28 -07:00
render Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash 2015-06-04 00:56:11 -07:00
stdlib Make sure we have the vsscanf() prototype (thanks, Ozkan!). 2015-05-28 14:34:38 -04:00
test Some setups need _GNU_SOURCE to make LLONG_MAX available (thanks, Ozkan!). 2015-05-26 16:31:11 -04:00
thread Uh, yeah, it helps to press "Save" before committing... 2015-05-26 21:30:41 -04:00
timer Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
video Backout commit 83034612a883 2015-06-04 02:12:06 -04:00
SDL_assert_c.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_assert.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_error_c.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_error.c Fixed bug 2210 - Initializing Video produces unnecessary errors 2015-05-28 12:31:25 -07:00
SDL_hints.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_internal.h Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL_log.c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
SDL.c Stack hint should look for 0, not -1, and not care about environment variables. 2015-05-26 21:19:23 -04:00