I identify two problems.
I have a frame that take up to 217,000 µs to be made (0.217 seconds => 5FPS).
I have 133,000 from a pluggin to make a volumetric fog :
13942 | - DrawIndexed(6) | 3476 | 133291.744
13943 | - OMSetRenderTargets({ Render Target View 6929 }, No Resource) | |
13944 | - RSSetViewports({ { 0.00, 0.00, 5120.00, 2160.00 } }) | |
13945 | - ResolveSubresource(RenderTexture-2D-5120x2160, TempBuffer 59 5120x2160) | 3477 | 405.504
13946 | - OMSetRenderTargets({ Render Target View 6929 }, No Resource) | |
13947 | - RSSetViewports({ { 0.00, 0.00, 5120.00, 2160.00 } }) | |
13948 | - Map(Buffer-1-1048576, 0) | |
13949 | - Map(Buffer-2-131072, 0) | |
13950 | - Unmap(Buffer-1-1048576, 0, (68 bytes)) | |
13951 | - Unmap(Buffer-2-131072, 0, (11 bytes)) | |
13952 | - PSSetShaderResources(0, { RenderTexture-SRV-1515-color-5120x2160 }) | |
13953 | - PSSetSamplers(0, { SamplerState-1-111-1 }) | |
13954 | - PSSetShaderResources(1, { RenderTexture-SRV-1521-color-5120x2160 }) | |
13955 | - PSSetShaderResources(2, { RenderTexture-SRV-1529-depth-5120x2160 }) | |
13956 | - PSSetSamplers(2, { SamplerState-0-111-0 }) | |
13957 | - OMSetBlendState(BlendState-2-1, {}) | |
13958 | - IASetVertexBuffers(0, ID3D11Buffer *[8]) | |
13959 | - IASetInputLayout(InputLayout-14) | |
13960 | - IASetIndexBuffer(Buffer-2-131072) | |
13961 | - VSSetShader(Unlit/FullVolumeCloudsURP LAYERS Fog of War) | |
13962 | - PSSetShader(Unlit/FullVolumeCloudsURP LAYERS Fog of War) | |
13963 | - Map(ConstantBuffer-171-656, 0) | |
13964 | - Unmap(ConstantBuffer-171-656, 0, (656 bytes)) | |
13965 | - VSSetConstantBuffers(1, { ConstantBuffer-171-656 }) | |
I will see with the author of the asset for this part.
And then I have this line that repeat 1,700 times, and if I add all times it takes up to 60,000µs :
8214 | - DrawIndexedInstanced(6912, 1) | 2318 | 63.488
8215 | - IASetVertexBuffers(0, ID3D11Buffer *[8]) | |
8216 | - IASetIndexBuffer(Hex_Mesh) | |
8217 | - VSSetConstantBuffers1(1, { Buffer 2154 }) | |
8218 | - PSSetConstantBuffers1(2, { Buffer 2154 }) | |
8219 | - DrawIndexedInstanced(6912, 1) | 2319 | 63.488
8220 | - IASetVertexBuffers(0, ID3D11Buffer *[8]) | |
8221 | - IASetIndexBuffer(Hex_Mesh) | |
8222 | - VSSetConstantBuffers1(1, { Buffer 2154 }) | |
8223 | - PSSetConstantBuffers1(2, { Buffer 2154 }) | |
8224 | - DrawIndexedInstanced(6912, 1) | 2320 | 64.128
8225 | - IASetVertexBuffers(0, ID3D11Buffer *[8]) | |
8226 | - IASetIndexBuffer(Hex_Mesh) | |
8227 | - VSSetConstantBuffers1(1, { Buffer 2154 }) | |
8228 | - PSSetConstantBuffers1(2, { Buffer 2154 }) | |
in my game here a HexChunk that contain :
- HexMesh
- A canvas
- HexFeature that contain all feature in the grid
- 64 HexCell gameobject
Here HexMesh with the “Hex_Mesh” mesh that repeat in my log :
I try to make it static and adding “Enable GPU Instancing” in the Hex_Map_Triplanar_Infinite material but performance don’t change. Any idea ?