mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
d3d12: Set command heap only when necessary.
This commit is contained in:
parent
404b15b3c3
commit
8417e21e8d
3 changed files with 14 additions and 6 deletions
|
@ -301,12 +301,6 @@ void D3D12GSRender::end()
|
||||||
{
|
{
|
||||||
upload_and_bind_textures(get_current_resource_storage().command_list.Get(), currentDescriptorIndex + 3, std::get<2>(*m_current_pso) > 0);
|
upload_and_bind_textures(get_current_resource_storage().command_list.Get(), currentDescriptorIndex + 3, std::get<2>(*m_current_pso) > 0);
|
||||||
|
|
||||||
ID3D12DescriptorHeap *descriptors[] =
|
|
||||||
{
|
|
||||||
get_current_resource_storage().descriptors_heap.Get(),
|
|
||||||
get_current_resource_storage().sampler_descriptor_heap[get_current_resource_storage().sampler_descriptors_heap_index].Get(),
|
|
||||||
};
|
|
||||||
get_current_resource_storage().command_list->SetDescriptorHeaps(2, descriptors);
|
|
||||||
|
|
||||||
get_current_resource_storage().command_list->SetGraphicsRootDescriptorTable(0,
|
get_current_resource_storage().command_list->SetGraphicsRootDescriptorTable(0,
|
||||||
CD3DX12_GPU_DESCRIPTOR_HANDLE(get_current_resource_storage().descriptors_heap->GetGPUDescriptorHandleForHeapStart())
|
CD3DX12_GPU_DESCRIPTOR_HANDLE(get_current_resource_storage().descriptors_heap->GetGPUDescriptorHandleForHeapStart())
|
||||||
|
|
|
@ -85,6 +85,13 @@ void resource_storage::reset()
|
||||||
void resource_storage::set_new_command_list()
|
void resource_storage::set_new_command_list()
|
||||||
{
|
{
|
||||||
CHECK_HRESULT(command_list->Reset(command_allocator.Get(), nullptr));
|
CHECK_HRESULT(command_list->Reset(command_allocator.Get(), nullptr));
|
||||||
|
|
||||||
|
ID3D12DescriptorHeap *descriptors[] =
|
||||||
|
{
|
||||||
|
descriptors_heap.Get(),
|
||||||
|
sampler_descriptor_heap[sampler_descriptors_heap_index].Get(),
|
||||||
|
};
|
||||||
|
command_list->SetDescriptorHeaps(2, descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resource_storage::init(ID3D12Device *device)
|
void resource_storage::init(ID3D12Device *device)
|
||||||
|
|
|
@ -335,6 +335,13 @@ void D3D12GSRender::upload_and_bind_textures(ID3D12GraphicsCommandList *command_
|
||||||
{
|
{
|
||||||
get_current_resource_storage().sampler_descriptors_heap_index = 1;
|
get_current_resource_storage().sampler_descriptors_heap_index = 1;
|
||||||
get_current_resource_storage().current_sampler_index = 0;
|
get_current_resource_storage().current_sampler_index = 0;
|
||||||
|
|
||||||
|
ID3D12DescriptorHeap *descriptors[] =
|
||||||
|
{
|
||||||
|
get_current_resource_storage().descriptors_heap.Get(),
|
||||||
|
get_current_resource_storage().sampler_descriptor_heap[get_current_resource_storage().sampler_descriptors_heap_index].Get(),
|
||||||
|
};
|
||||||
|
command_list->SetDescriptorHeaps(2, descriptors);
|
||||||
}
|
}
|
||||||
m_device->CreateSampler(&get_sampler_desc(textures[i]),
|
m_device->CreateSampler(&get_sampler_desc(textures[i]),
|
||||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().sampler_descriptor_heap[get_current_resource_storage().sampler_descriptors_heap_index]->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().sampler_descriptor_heap[get_current_resource_storage().sampler_descriptors_heap_index]->GetCPUDescriptorHandleForHeapStart())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue