if you create a new empty texture e.g. with
IDirect3DDevice9::CreateTexture or D3DXCreateTexture
Is it guaranteed to be filled with zeros - as it appears to me by testing? Does anybody have a link to a statement from microsoft about this? I could not find anything.
No, there is no stated guarantee (that I've ever seen). In fact, I've seen a good bit of the opposite behavior: data from previous (deallocated) textures and seemingly random data appearing.
However, the behavior between textures differs greatly depending on where the texture is allocated in the format. Allocating in system memory or with some of the shared pools could cause the data to be zeroed out, if the CPU so desires. Typically, when allocating in video memory, this does not occur. There may also be differences between
IDirect3DDevice9::CreateTexture
andD3DXCreateTexture
; D3DX often does more initialization or provides options for such.If you are seeing the texture appear zero-filled, that may be due to debug builds or a fresh system. Run some other graphics applications and then try running a release build (make sure your system is not set to D3D debug mode).