Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualme_12

Posted 09 September 2013 - 04:54 AM

Sorry for the late response, had a lot of things going on lately and no time to work on this project. Anyways...

 

I tried to use DrawInstancedIndirect with half success. I am not 100% sure what data has to be stored in ID3D11Buffer *pBufferForArgs.

 

 

I have created the buffer with no specific initial data and tried to copy the structure count with: 

m_pdevicecontext->CopyStructureCount(pbDrawIndirectArgs, 0, puavSimulationSateNew);

This draws nothing at all!

 

 

After that I tried to play a bit with the initial data of pbDrawIndirectArgs.

 

IndirectArgs indirectArgs;
indirectArgs._one = 0;
indirectArgs._two = 10;
indirectArgs._three = 0;
indirectArgs._four = 0;


D3D11_SUBRESOURCE_DATA InitData;
InitData.pSysMem = &indirectArgs;
InitData.SysMemPitch = 0;
InitData.SysMemSlicePitch = 0;


HRESULT result = m_pdevice->CreateBuffer(&bufferDesc, &InitData, &pbDrawIndirectArgs);

Now the strange thing happens. As soon as I set indirectArgs._two to anything but 0 it actually draws my particles.

 

After that I removed the CopyStructureCount call. And again I had a different behavior. Now the particles are blinking as if only a few at a time are drawn.

 

In conclusion I guess CopyStructureCount does actually work but only if i set indirectArgs._two to anything but 0. 

 

This totally confuses me and I have no idea why...


#1me_12

Posted 09 September 2013 - 04:44 AM

Sorry for the late response, had a lot of things going on lately and no time to work on this project. Anyways...

 

I tried to use DrawInstancedIndirect with half success. I am not 100% sure what data has to be stored in ID3D11Buffer *pBufferForArgs.

 

 

I have created the buffer with no specific initial data and tried to copy the structure count with: 

m_pdevicecontext->CopyStructureCount(pbDrawIndirectArgs, 0, puavSimulationSateNew);

This draws nothing at all!

 

 

After that I tried to play a bit with the initial data of pbDrawIndirectArgs.

 

IndirectArgs indirectArgs;
indirectArgs._one = 0;
indirectArgs._two = 10;
indirectArgs._three = 0;
indirectArgs._four = 0;


D3D11_SUBRESOURCE_DATA InitData;
InitData.pSysMem = &indirectArgs;
InitData.SysMemPitch = 0;
InitData.SysMemSlicePitch = 0;


HRESULT result = m_pdevice->CreateBuffer(&bufferDesc, &InitData, &pbDrawIndirectArgs);

Now the strange thing happens. As soon as I set indirectArgs._two to anything but 0 it actually draws my particles.

 

After that I removed the CopyStructureCount call. And again I had a different behavior. Now the particles are blinking as if only a few at a time are drawn.

 

In Conlusion I guess CopyStructureCount does actually work but only if i set indirectArgs._two to anything but 0. 

 

This totally confuses me and I have no idea why...


PARTNERS