DirectX breaks graphics card

Started by
49 comments, last by Evil Steve 16 years, 2 months ago
is it right to do if i do this?

specify the usage as dynamic and use D3DLOCK_DISCARD.

pd3dDevice->CreateVertexBuffer( (*it)->_col * 2 * sizeof(CUSTOMVERTEX),	D3DUSAGE_DYNAMIC, D3DFVF_CUSTOMVERTEX,	D3DPOOL_DEFAULT, &pVb, NULL );buffer->Lock(0, 0, (void**)&pVertices, D3DLOCK_DISCARD);
Advertisement
Quote:Original post by juxie
When I specify the D3DLOCK_DISCARD, i will get errors on debug runtime.
What should I specify if I am trying to efficiently render particle system.
Then that's a seperate bug that should be fixed. The correct way to render a particle system is described in the Documentation, under Using Dynamic Vertex and Index Buffers. You should have a huge vertex buffer (Usually enough for at least 2 frames of data), and lock it in chunks. Keep looking the next "chunk" using D3DLOCK_NOOVERWRITE, and then when you get to the end of the buffer, lock with D3DLOCK_DISCARD and start from the start again.

Quote:Original post by juxie
Yes if I take screen shot, i will just be a solid green screen.
Does that mean it's alright?
Nope, that just confirms that it is the debug runtimes filling the backbuffer with green.

I had a thought - do you actually have a Z-buffer? If you don't, Clear() will fail (Because you're telling it to clear the Z-buffer too), which will cause exactly what you're seeing. If that's not it, is Clear() actually failing?
Quote:Nope, that just confirms that it is the debug runtimes filling the backbuffer with green.


Quote:I had a thought - do you actually have a Z-buffer? If you don't, Clear() will fail (Because you're telling it to clear the Z-buffer too), which will cause exactly what you're seeing. If that's not it, is Clear() actually failing?


Yup i have z-buffer turned on.
Do you mean if I Clear() Z-buffer when it's not turned on, i will see green bars?

Quote:Original post by juxie
Yup i have z-buffer turned on.
Do you mean if I Clear() Z-buffer when it's not turned on, i will see green bars?
If you pass invalid parameters to Clear(), it'll fail, and not clear anything. If you tell Clear() to clear the z-buffer and you don't have a z-buffer attached, then Clear() will fil; which will mean that nothing will be cleared.

As a simple test, you could remove the D3DCLEAR_ZBUFFER flag and see if you still see the green.

Have you tried commenting everything out apart from Clear and Present?
Quote:Have you tried commenting everything out apart from Clear and Present?


Yes, I tried, I still get full screen green when i take a screen shot.

Quote:
As a simple test, you could remove the D3DCLEAR_ZBUFFER flag and see if you still see the green.


I tried, I get green too.

So your render loop is calling nothing bit Clear() and Present(), the debug runtimes aren't giving you any more warnings or errors, and you still just get a green screen? There's something very wrong if that's the case...
Quote:Original post by Evil Steve
So your render loop is calling nothing bit Clear() and Present(), the debug runtimes aren't giving you any more warnings or errors, and you still just get a green screen? There's something very wrong if that's the case...


Do you have any suggestion what could be wrong?
I hope you could advise please.

Quote:Original post by juxie
Do you have any suggestion what could be wrong?
I hope you could advise please.
If all your render loop does is Clear and Present, and neither function fails, and you still see green, all I can guess is that your drivers or the card are screwed.
Quote:Original post by Evil Steve
If all your render loop does is Clear and Present, and neither function fails, and you still see green, all I can guess is that your drivers or the card are screwed.


Alright. Unfortunately now the other machines i have do not allow me to change to debug runtimes as admin rights are probably disabled.
I am looking for a machine which will let me test now.
What should i expect to see when it is doing the right thing?



This topic is closed to new replies.

Advertisement