Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualgrosvenor

Posted 07 July 2012 - 08:25 AM

Hi L. Spiro,

Are you rendering on second thread?

It's the main thread.

Are you doing redundant-state checking?

Uhh... sounds pretty general. Anything specific I should be looking for?

Why not some screenshots of this omitting of triangles?

Right, why not...
[attachment=9899:missing_triangles.jpg]

So, this is where the buffers are bound:
	 VERIFY(Get3DDevice()->SetFVF( m_VertexFormat.GetVertexFormatID() ));
	 VERIFY(Get3DDevice()->SetStreamSource(0, m_VertexBuffer.m_D3D9VertexBuffer, 0, m_VertexFormat.GetVertexSize()));
	 VERIFY(Get3DDevice()->SetIndices(m_IndexBuffer.m_D3D9IndexBuffer));	

... and this is the render call
//actual rendering:
   assert(pEffect);
   if (pEffect)
   {
	unsigned int numPasses = 0;
	VERIFY(pEffect->Begin(&numPasses, 0));
	for (unsigned int pass = 0; pass < numPasses; ++pass)
	{
	 VERIFY(pEffect->BeginPass(pass));
	 HRESULT hr;
	 hr = Get3DDevice()->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, m_VertexBuffer.m_NumVertices, index0, numIndices/3);
	 if (hr!=D3D_OK)
	 {
	  sys::Output(DXGetErrorString(hr));
	  sys::Output(DXGetErrorDescription(hr));
	  assert(false);
	 }
	 VERIFY(pEffect->EndPass());
	}
	VERIFY(pEffect->End());
   }

Btw, the effect does not care which model I take. It happens the same with a tesselated sphere. It happens in-game and it happens in the modelviewer.

What does PIX say you are passing to the call? Is it not the correct number of triangles for the primitive type (triangle list/triangle strip)?

148 <0x064A5970> IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4688, 0, 2612) 66862329856

I can even hardcode the parameters in this call to these values, the missing triangles bug appears not before the 512th frame.
To be honest, I used PIX the first time now that you mentioned it.

Are the correct vertex buffers bound?

Probably. When I launch the modelviewer, there is only one vertex buffer and one index buffer thats get set at all, so there is not much chance of mixing it up, I guess. From the pictures I would rather guess the index buffer to be the problem, but it 's no definite saying, because the polygons don't share vertices.

It is unlikely an ATI driver bug. More likely they have made fixes which have exposed some error on your side, and you should be glad for this chance to find and fix it.

That's right. But I am really curious. This one would really be a long time lurker.

Thanks for helping,

Matt

Edit: the VERIFY doesn't do anything. It's only an empty macro in this configuration.

#1grosvenor

Posted 07 July 2012 - 08:21 AM

Hi L. Spiro,

Are you rendering on second thread?

It's the main thread.

Are you doing redundant-state checking?

Uhh... sounds pretty general. Anything specific I should be looking for?

Why not some screenshots of this omitting of triangles?

Right, why not...
[attachment=9899:missing_triangles.jpg]

So, this is where the buffers are bound:
	 VERIFY(Get3DDevice()->SetFVF( m_VertexFormat.GetVertexFormatID() ));
	 VERIFY(Get3DDevice()->SetStreamSource(0, m_VertexBuffer.m_D3D9VertexBuffer, 0, m_VertexFormat.GetVertexSize()));
	 VERIFY(Get3DDevice()->SetIndices(m_IndexBuffer.m_D3D9IndexBuffer));	

... and this is the render call
//actual rendering:
   assert(pEffect);
   if (pEffect)
   {
	unsigned int numPasses = 0;
	VERIFY(pEffect->Begin(&numPasses, 0));
	for (unsigned int pass = 0; pass < numPasses; ++pass)
	{
	 VERIFY(pEffect->BeginPass(pass));
	 HRESULT hr;
	 hr = Get3DDevice()->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, m_VertexBuffer.m_NumVertices, index0, numIndices/3);
	 if (hr!=D3D_OK)
	 {
	  sys::Output(DXGetErrorString(hr));
	  sys::Output(DXGetErrorDescription(hr));
	  assert(false);
	 }
	 VERIFY(pEffect->EndPass());
	}
	VERIFY(pEffect->End());
   }

Btw, the effect does not care which model I take. It happens the same with a tesselated sphere. It happens in-game and it happens in the modelviewer.

What does PIX say you are passing to the call? Is it not the correct number of triangles for the primitive type (triangle list/triangle strip)?

148 <0x064A5970> IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4688, 0, 2612) 66862329856

I can even hardcode the parameters in this call to these values, the missing triangles bug appears not before the 512th frame.
To be honest, I used PIX the first time now that you mentioned it.

Are the correct vertex buffers bound?

Probably. When I launch the modelviewer, there is only one vertex buffer and one index buffer thats get set at all, so there is not much chance of mixing it up, I guess. From the pictures I would rather guess the index buffer to be the problem, but it 's no definite saying, because the polygons don't share vertices.

It is unlikely an ATI driver bug. More likely they have made fixes which have exposed some error on your side, and you should be glad for this chance to find and fix it.

That's right. But I am really curious. This one would really be a long time lurker.

Thanks for helping,

Matt

PARTNERS