Create depth texture failed. #1293

Open
opened 3 years ago by jiangqi9090 · 0 comments
jiangqi9090 commented 3 years ago (Migrated from github.com)

Sorry for my bad English.

I'm trying to add SSAO, so I create a depth texture

	IDirect3DTexture9 *tex;
	HRESULT hr = d3ddevice->CreateTexture(raster->width, raster->height, 1, D3DUSAGE_DEPTHSTENCIL, ((D3DFORMAT)MAKEFOURCC('I', 'N', 'T', 'Z')), D3DPOOL_DEFAULT, &tex, nil);

But when after creating the texture, the program will crash because all the dx9 resources became NULL pointers(IDirect3DVertexBuffer9 and textures). I create vertex buffer again and the return value is 8876086c.

I found the problem causes by D3DUSAGE_DEPTHSTENCIL, if I replace it with D3DUSAGE_RENDERTARGET, the program won't crash. I don't know what happened.

Sorry for my bad English. I'm trying to add SSAO, so I create a depth texture ```c IDirect3DTexture9 *tex; ``` ```c HRESULT hr = d3ddevice->CreateTexture(raster->width, raster->height, 1, D3DUSAGE_DEPTHSTENCIL, ((D3DFORMAT)MAKEFOURCC('I', 'N', 'T', 'Z')), D3DPOOL_DEFAULT, &tex, nil); ``` But when after creating the texture, the program will crash because all the dx9 resources became NULL pointers(IDirect3DVertexBuffer9 and textures). I create vertex buffer again and the return value is 8876086c. I found the problem causes by D3DUSAGE_DEPTHSTENCIL, if I replace it with D3DUSAGE_RENDERTARGET, the program won't crash. I don't know what happened.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mirror/re3#1293
Loading…
There is no content yet.