mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
d3d12: Make descriptor heap a little more compact.
This commit is contained in:
parent
5a064be490
commit
0e98da2306
4 changed files with 55 additions and 65 deletions
|
@ -229,7 +229,7 @@ D3D12_INDEX_BUFFER_VIEW D3D12GSRender::uploadIndexBuffers(bool indexed_draw)
|
||||||
return indexBufferView;
|
return indexBufferView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12GSRender::setScaleOffset()
|
void D3D12GSRender::setScaleOffset(size_t descriptorIndex)
|
||||||
{
|
{
|
||||||
float scaleOffsetMat[16] =
|
float scaleOffsetMat[16] =
|
||||||
{
|
{
|
||||||
|
@ -273,11 +273,11 @@ void D3D12GSRender::setScaleOffset()
|
||||||
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
||||||
constantBufferViewDesc.SizeInBytes = (UINT)256;
|
constantBufferViewDesc.SizeInBytes = (UINT)256;
|
||||||
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_scaleOffsetDescriptorHeap->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
||||||
.Offset((INT)getCurrentResourceStorage().m_currentScaleOffsetBufferIndex, g_descriptorStrideSRVCBVUAV));
|
.Offset((INT)descriptorIndex, g_descriptorStrideSRVCBVUAV));
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12GSRender::FillVertexShaderConstantsBuffer()
|
void D3D12GSRender::FillVertexShaderConstantsBuffer(size_t descriptorIndex)
|
||||||
{
|
{
|
||||||
for (const auto &entry : transform_constants)
|
for (const auto &entry : transform_constants)
|
||||||
local_transform_constants[entry.first] = entry.second;
|
local_transform_constants[entry.first] = entry.second;
|
||||||
|
@ -305,11 +305,11 @@ void D3D12GSRender::FillVertexShaderConstantsBuffer()
|
||||||
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
||||||
constantBufferViewDesc.SizeInBytes = (UINT)bufferSize;
|
constantBufferViewDesc.SizeInBytes = (UINT)bufferSize;
|
||||||
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_constantsBufferDescriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
||||||
.Offset((INT)getCurrentResourceStorage().m_constantsBufferIndex, g_descriptorStrideSRVCBVUAV));
|
.Offset((INT)descriptorIndex, g_descriptorStrideSRVCBVUAV));
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12GSRender::FillPixelShaderConstantsBuffer()
|
void D3D12GSRender::FillPixelShaderConstantsBuffer(size_t descriptorIndex)
|
||||||
{
|
{
|
||||||
// Get constant from fragment program
|
// Get constant from fragment program
|
||||||
const std::vector<size_t> &fragmentOffset = m_cachePSO.getFragmentConstantOffsetsCache(&fragment_program);
|
const std::vector<size_t> &fragmentOffset = m_cachePSO.getFragmentConstantOffsetsCache(&fragment_program);
|
||||||
|
@ -366,8 +366,8 @@ void D3D12GSRender::FillPixelShaderConstantsBuffer()
|
||||||
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
constantBufferViewDesc.BufferLocation = m_constantsData.m_heap->GetGPUVirtualAddress() + heapOffset;
|
||||||
constantBufferViewDesc.SizeInBytes = (UINT)bufferSize;
|
constantBufferViewDesc.SizeInBytes = (UINT)bufferSize;
|
||||||
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
m_device->CreateConstantBufferView(&constantBufferViewDesc,
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_constantsBufferDescriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
||||||
.Offset((INT)getCurrentResourceStorage().m_constantsBufferIndex, g_descriptorStrideSRVCBVUAV));
|
.Offset((INT)descriptorIndex, g_descriptorStrideSRVCBVUAV));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,7 @@ static void unloadD3D12FunctionPointers()
|
||||||
|
|
||||||
void D3D12GSRender::ResourceStorage::Reset()
|
void D3D12GSRender::ResourceStorage::Reset()
|
||||||
{
|
{
|
||||||
m_constantsBufferIndex = 0;
|
m_descriptorsHeapIndex = 0;
|
||||||
m_currentScaleOffsetBufferIndex = 0;
|
|
||||||
m_currentTextureIndex = 0;
|
|
||||||
m_currentSamplerIndex = 0;
|
m_currentSamplerIndex = 0;
|
||||||
m_samplerDescriptorHeapIndex = 0;
|
m_samplerDescriptorHeapIndex = 0;
|
||||||
|
|
||||||
|
@ -65,9 +63,7 @@ void D3D12GSRender::ResourceStorage::Init(ID3D12Device *device)
|
||||||
ThrowIfFailed(m_commandList->Close());
|
ThrowIfFailed(m_commandList->Close());
|
||||||
|
|
||||||
D3D12_DESCRIPTOR_HEAP_DESC descriptorHeapDesc = { D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 10000, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
|
D3D12_DESCRIPTOR_HEAP_DESC descriptorHeapDesc = { D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 10000, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
|
||||||
ThrowIfFailed(device->CreateDescriptorHeap(&descriptorHeapDesc, IID_PPV_ARGS(&m_constantsBufferDescriptorsHeap)));
|
ThrowIfFailed(device->CreateDescriptorHeap(&descriptorHeapDesc, IID_PPV_ARGS(&m_descriptorsHeap)));
|
||||||
ThrowIfFailed(device->CreateDescriptorHeap(&descriptorHeapDesc, IID_PPV_ARGS(&m_scaleOffsetDescriptorHeap)));
|
|
||||||
ThrowIfFailed(device->CreateDescriptorHeap(&descriptorHeapDesc, IID_PPV_ARGS(&m_textureDescriptorsHeap)));
|
|
||||||
|
|
||||||
D3D12_DESCRIPTOR_HEAP_DESC samplerHeapDesc = { D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER , 2048, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
|
D3D12_DESCRIPTOR_HEAP_DESC samplerHeapDesc = { D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER , 2048, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
|
||||||
ThrowIfFailed(device->CreateDescriptorHeap(&samplerHeapDesc, IID_PPV_ARGS(&m_samplerDescriptorHeap[0])));
|
ThrowIfFailed(device->CreateDescriptorHeap(&samplerHeapDesc, IID_PPV_ARGS(&m_samplerDescriptorHeap[0])));
|
||||||
|
@ -205,16 +201,14 @@ D3D12GSRender::D3D12GSRender()
|
||||||
// Samplers
|
// Samplers
|
||||||
CD3DX12_DESCRIPTOR_RANGE(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, textureCount, 0),
|
CD3DX12_DESCRIPTOR_RANGE(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, textureCount, 0),
|
||||||
};
|
};
|
||||||
CD3DX12_ROOT_PARAMETER RP[4];
|
CD3DX12_ROOT_PARAMETER RP[2];
|
||||||
RP[0].InitAsDescriptorTable(1, &descriptorRange[0]);
|
RP[0].InitAsDescriptorTable((textureCount > 0) ? 3 : 2, &descriptorRange[0]);
|
||||||
RP[1].InitAsDescriptorTable(1, &descriptorRange[1]);
|
RP[1].InitAsDescriptorTable(1, &descriptorRange[3]);
|
||||||
RP[2].InitAsDescriptorTable(1, &descriptorRange[2]);
|
|
||||||
RP[3].InitAsDescriptorTable(1, &descriptorRange[3]);
|
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> rootSignatureBlob;
|
Microsoft::WRL::ComPtr<ID3DBlob> rootSignatureBlob;
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
||||||
ThrowIfFailed(wrapD3D12SerializeRootSignature(
|
ThrowIfFailed(wrapD3D12SerializeRootSignature(
|
||||||
&CD3DX12_ROOT_SIGNATURE_DESC((textureCount > 0) ? 4 : 2, RP, 0, 0, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT),
|
&CD3DX12_ROOT_SIGNATURE_DESC((textureCount > 0) ? 2 : 1, RP, 0, 0, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT),
|
||||||
D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob));
|
D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob));
|
||||||
|
|
||||||
m_device->CreateRootSignature(0,
|
m_device->CreateRootSignature(0,
|
||||||
|
@ -442,26 +436,11 @@ void D3D12GSRender::end()
|
||||||
|
|
||||||
std::chrono::time_point<std::chrono::system_clock> constantsDurationStart = std::chrono::system_clock::now();
|
std::chrono::time_point<std::chrono::system_clock> constantsDurationStart = std::chrono::system_clock::now();
|
||||||
|
|
||||||
|
size_t currentDescriptorIndex = getCurrentResourceStorage().m_descriptorsHeapIndex;
|
||||||
// Constants
|
// Constants
|
||||||
setScaleOffset();
|
setScaleOffset(currentDescriptorIndex);
|
||||||
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(1, getCurrentResourceStorage().m_scaleOffsetDescriptorHeap.GetAddressOf());
|
FillVertexShaderConstantsBuffer(currentDescriptorIndex + 1);
|
||||||
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(0,
|
FillPixelShaderConstantsBuffer(currentDescriptorIndex + 2);
|
||||||
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_scaleOffsetDescriptorHeap->GetGPUDescriptorHandleForHeapStart())
|
|
||||||
.Offset((INT)getCurrentResourceStorage().m_currentScaleOffsetBufferIndex, g_descriptorStrideSRVCBVUAV)
|
|
||||||
);
|
|
||||||
getCurrentResourceStorage().m_currentScaleOffsetBufferIndex++;
|
|
||||||
|
|
||||||
size_t currentBufferIndex = getCurrentResourceStorage().m_constantsBufferIndex;
|
|
||||||
FillVertexShaderConstantsBuffer();
|
|
||||||
getCurrentResourceStorage().m_constantsBufferIndex++;
|
|
||||||
FillPixelShaderConstantsBuffer();
|
|
||||||
getCurrentResourceStorage().m_constantsBufferIndex++;
|
|
||||||
|
|
||||||
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(1, getCurrentResourceStorage().m_constantsBufferDescriptorsHeap.GetAddressOf());
|
|
||||||
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(1,
|
|
||||||
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_constantsBufferDescriptorsHeap->GetGPUDescriptorHandleForHeapStart())
|
|
||||||
.Offset((INT)currentBufferIndex, g_descriptorStrideSRVCBVUAV)
|
|
||||||
);
|
|
||||||
|
|
||||||
std::chrono::time_point<std::chrono::system_clock> constantsDurationEnd = std::chrono::system_clock::now();
|
std::chrono::time_point<std::chrono::system_clock> constantsDurationEnd = std::chrono::system_clock::now();
|
||||||
m_timers.m_constantsDuration += std::chrono::duration_cast<std::chrono::microseconds>(constantsDurationEnd - constantsDurationStart).count();
|
m_timers.m_constantsDuration += std::chrono::duration_cast<std::chrono::microseconds>(constantsDurationEnd - constantsDurationStart).count();
|
||||||
|
@ -471,7 +450,7 @@ void D3D12GSRender::end()
|
||||||
std::chrono::time_point<std::chrono::system_clock> textureDurationStart = std::chrono::system_clock::now();
|
std::chrono::time_point<std::chrono::system_clock> textureDurationStart = std::chrono::system_clock::now();
|
||||||
if (m_PSO->second > 0)
|
if (m_PSO->second > 0)
|
||||||
{
|
{
|
||||||
size_t usedTexture = UploadTextures(getCurrentResourceStorage().m_commandList.Get());
|
size_t usedTexture = UploadTextures(getCurrentResourceStorage().m_commandList.Get(), currentDescriptorIndex + 3);
|
||||||
|
|
||||||
// Fill empty slots
|
// Fill empty slots
|
||||||
for (; usedTexture < m_PSO->second; usedTexture++)
|
for (; usedTexture < m_PSO->second; usedTexture++)
|
||||||
|
@ -486,8 +465,8 @@ void D3D12GSRender::end()
|
||||||
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0,
|
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0,
|
||||||
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0);
|
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0);
|
||||||
m_device->CreateShaderResourceView(m_dummyTexture, &srvDesc,
|
m_device->CreateShaderResourceView(m_dummyTexture, &srvDesc,
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_textureDescriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
||||||
.Offset((INT)getCurrentResourceStorage().m_currentTextureIndex + (INT)usedTexture, g_descriptorStrideSRVCBVUAV)
|
.Offset((INT)currentDescriptorIndex + 3 + (INT)usedTexture, g_descriptorStrideSRVCBVUAV)
|
||||||
);
|
);
|
||||||
|
|
||||||
D3D12_SAMPLER_DESC samplerDesc = {};
|
D3D12_SAMPLER_DESC samplerDesc = {};
|
||||||
|
@ -501,21 +480,35 @@ void D3D12GSRender::end()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(1, getCurrentResourceStorage().m_textureDescriptorsHeap.GetAddressOf());
|
ID3D12DescriptorHeap *descriptors[] =
|
||||||
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(2,
|
{
|
||||||
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_textureDescriptorsHeap->GetGPUDescriptorHandleForHeapStart())
|
getCurrentResourceStorage().m_descriptorsHeap.Get(),
|
||||||
.Offset((INT)getCurrentResourceStorage().m_currentTextureIndex, g_descriptorStrideSRVCBVUAV)
|
getCurrentResourceStorage().m_samplerDescriptorHeap[getCurrentResourceStorage().m_samplerDescriptorHeapIndex].Get(),
|
||||||
);
|
};
|
||||||
|
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(2, descriptors);
|
||||||
|
|
||||||
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(1, getCurrentResourceStorage().m_samplerDescriptorHeap[getCurrentResourceStorage().m_samplerDescriptorHeapIndex].GetAddressOf());
|
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(0,
|
||||||
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(3,
|
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetGPUDescriptorHandleForHeapStart())
|
||||||
|
.Offset((INT)currentDescriptorIndex, g_descriptorStrideSRVCBVUAV)
|
||||||
|
);
|
||||||
|
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(1,
|
||||||
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_samplerDescriptorHeap[getCurrentResourceStorage().m_samplerDescriptorHeapIndex]->GetGPUDescriptorHandleForHeapStart())
|
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_samplerDescriptorHeap[getCurrentResourceStorage().m_samplerDescriptorHeapIndex]->GetGPUDescriptorHandleForHeapStart())
|
||||||
.Offset((INT)getCurrentResourceStorage().m_currentSamplerIndex, g_descriptorStrideSamplers)
|
.Offset((INT)getCurrentResourceStorage().m_currentSamplerIndex, g_descriptorStrideSamplers)
|
||||||
);
|
);
|
||||||
|
|
||||||
getCurrentResourceStorage().m_currentTextureIndex += usedTexture;
|
|
||||||
getCurrentResourceStorage().m_currentSamplerIndex += usedTexture;
|
getCurrentResourceStorage().m_currentSamplerIndex += usedTexture;
|
||||||
|
getCurrentResourceStorage().m_descriptorsHeapIndex += usedTexture + 3;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getCurrentResourceStorage().m_commandList->SetDescriptorHeaps(1, getCurrentResourceStorage().m_descriptorsHeap.GetAddressOf());
|
||||||
|
getCurrentResourceStorage().m_commandList->SetGraphicsRootDescriptorTable(0,
|
||||||
|
CD3DX12_GPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetGPUDescriptorHandleForHeapStart())
|
||||||
|
.Offset((INT)currentDescriptorIndex, g_descriptorStrideSRVCBVUAV)
|
||||||
|
);
|
||||||
|
getCurrentResourceStorage().m_descriptorsHeapIndex += 3;
|
||||||
|
}
|
||||||
|
|
||||||
std::chrono::time_point<std::chrono::system_clock> textureDurationEnd = std::chrono::system_clock::now();
|
std::chrono::time_point<std::chrono::system_clock> textureDurationEnd = std::chrono::system_clock::now();
|
||||||
m_timers.m_textureDuration += std::chrono::duration_cast<std::chrono::microseconds>(textureDurationEnd - textureDurationStart).count();
|
m_timers.m_textureDuration += std::chrono::duration_cast<std::chrono::microseconds>(textureDurationEnd - textureDurationStart).count();
|
||||||
|
|
||||||
|
|
|
@ -374,15 +374,11 @@ private:
|
||||||
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
|
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
|
||||||
ComPtr<ID3D12GraphicsCommandList> m_commandList;
|
ComPtr<ID3D12GraphicsCommandList> m_commandList;
|
||||||
|
|
||||||
// Constants storage
|
// Descriptor heap
|
||||||
ComPtr<ID3D12DescriptorHeap> m_constantsBufferDescriptorsHeap;
|
ComPtr<ID3D12DescriptorHeap> m_descriptorsHeap;
|
||||||
size_t m_constantsBufferIndex;
|
size_t m_descriptorsHeapIndex;
|
||||||
ComPtr<ID3D12DescriptorHeap> m_scaleOffsetDescriptorHeap;
|
|
||||||
size_t m_currentScaleOffsetBufferIndex;
|
|
||||||
|
|
||||||
// Texture storage
|
// Sampler heap
|
||||||
ComPtr<ID3D12DescriptorHeap> m_textureDescriptorsHeap;
|
|
||||||
size_t m_currentTextureIndex;
|
|
||||||
ComPtr<ID3D12DescriptorHeap> m_samplerDescriptorHeap[2];
|
ComPtr<ID3D12DescriptorHeap> m_samplerDescriptorHeap[2];
|
||||||
size_t m_samplerDescriptorHeapIndex;
|
size_t m_samplerDescriptorHeapIndex;
|
||||||
size_t m_currentSamplerIndex;
|
size_t m_currentSamplerIndex;
|
||||||
|
@ -481,16 +477,16 @@ private:
|
||||||
D3D12_INDEX_BUFFER_VIEW uploadIndexBuffers(bool indexed_draw = false);
|
D3D12_INDEX_BUFFER_VIEW uploadIndexBuffers(bool indexed_draw = false);
|
||||||
|
|
||||||
|
|
||||||
void setScaleOffset();
|
void setScaleOffset(size_t descriptorIndex);
|
||||||
void FillVertexShaderConstantsBuffer();
|
void FillVertexShaderConstantsBuffer(size_t descriptorIndex);
|
||||||
void FillPixelShaderConstantsBuffer();
|
void FillPixelShaderConstantsBuffer(size_t descriptorIndex);
|
||||||
/**
|
/**
|
||||||
* Fetch all textures recorded in the state in the render target cache and in the texture cache.
|
* Fetch all textures recorded in the state in the render target cache and in the texture cache.
|
||||||
* If a texture is not cached, populate cmdlist with uploads command.
|
* If a texture is not cached, populate cmdlist with uploads command.
|
||||||
* Create necessary resource view/sampler descriptors in the per frame storage struct.
|
* Create necessary resource view/sampler descriptors in the per frame storage struct.
|
||||||
* returns the number of texture uploaded.
|
* returns the number of texture uploaded.
|
||||||
*/
|
*/
|
||||||
size_t UploadTextures(ID3D12GraphicsCommandList *cmdlist);
|
size_t UploadTextures(ID3D12GraphicsCommandList *cmdlist, size_t descriptorIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates render target if necessary.
|
* Creates render target if necessary.
|
||||||
|
|
|
@ -284,7 +284,7 @@ size_t getTextureSize(const rsx::texture &texture)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist, size_t descriptorIndex)
|
||||||
{
|
{
|
||||||
size_t usedTexture = 0;
|
size_t usedTexture = 0;
|
||||||
|
|
||||||
|
@ -452,7 +452,8 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_device->CreateShaderResourceView(vramTexture, &srvDesc,
|
m_device->CreateShaderResourceView(vramTexture, &srvDesc,
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_textureDescriptorsHeap->GetCPUDescriptorHandleForHeapStart()).Offset((UINT)getCurrentResourceStorage().m_currentTextureIndex + (UINT)usedTexture, g_descriptorStrideSRVCBVUAV));
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_descriptorsHeap->GetCPUDescriptorHandleForHeapStart())
|
||||||
|
.Offset((UINT)descriptorIndex + (UINT)usedTexture, g_descriptorStrideSRVCBVUAV));
|
||||||
|
|
||||||
if (getCurrentResourceStorage().m_currentSamplerIndex + 16 > 2048)
|
if (getCurrentResourceStorage().m_currentSamplerIndex + 16 > 2048)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue