Hi,
I am moving from DX11 to DX12 and I started fighting with texture resources. I provide only an simplified example.
Let's say, I have this root parameters:
CD3DX12_DESCRIPTOR_RANGE diffuseTextureTable;
diffuseTextureTable.Init(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 16, 0, 0);
CD3DX12_ROOT_PARAMETER signatureParameters[3];
signatureParameters[0].InitAsConstantBufferView(0); // Per draw
signatureParameters[1].InitAsConstantBufferView(1); // Per frame
signatureParameters[2].InitAsDescriptorTable(1, &diffuseTextureTable, D3D12_SHADER_VISIBILITY_PIXEL); // 16
My shader has one per draw constant buffer, one per frame buffer and table of 16 SRVs.
Every model can have up to 16 diffuse textures.
Well, the question is, how can I set textures for a model before rendering ? I read that changing heaps is costly. That's the only thing I thought that's the way.
Do i have to really load all textures into memory in initial time ? What If i can want to load some textures after initial time ? Is it possible to copy new texture descriptors into heap cheaply ?
Thank you very much :-)