Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/texture.c:
+ hr = D3DERR_INVALIDCALL; + goto exit; + }
/* Create the to-be-filled texture */ dynamic_texture = (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) && (usage & D3DUSAGE_DYNAMIC); if (pool == D3DPOOL_DEFAULT && !dynamic_texture) { - hr = D3DXCreateTexture(device, width, height, miplevels, 0, format, D3DPOOL_SYSTEMMEM, &buftex); - texptr = &buftex; + hr = D3DXCreateTexture(device, width, height, miplevels, 0, format, D3DPOOL_SYSTEMMEM, &buf_tex); + if (SUCCEEDED(hr)) + { + tex = buf_tex; + IDirect3DTexture9_AddRef(buf_tex); + } Nowadays we usually call this kind of temporary texture, used just for uploading data, a "staging" texture. Since this touches the variable name, I guess we could as well go for the current fashion choice :smile:
A `TRACE()` mentioning that would also be nice, I think. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5801#note_72981