mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Merge pull request #1642 from vlj/d3d12
d3d12: Move sampler DescriptorHeap selection in D3D12GSRender
This commit is contained in:
commit
7542d38681
2 changed files with 13 additions and 13 deletions
|
@ -345,6 +345,19 @@ void D3D12GSRender::end()
|
||||||
size_t texture_count = std::get<2>(m_current_pso);
|
size_t texture_count = std::get<2>(m_current_pso);
|
||||||
if (texture_count > 0)
|
if (texture_count > 0)
|
||||||
{
|
{
|
||||||
|
if (get_current_resource_storage().current_sampler_index + 16 > 2048)
|
||||||
|
{
|
||||||
|
get_current_resource_storage().sampler_descriptors_heap_index = 1;
|
||||||
|
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(),
|
||||||
|
};
|
||||||
|
get_current_resource_storage().command_list->SetDescriptorHeaps(2, descriptors);
|
||||||
|
}
|
||||||
|
|
||||||
upload_textures(get_current_resource_storage().command_list.Get(), texture_count);
|
upload_textures(get_current_resource_storage().command_list.Get(), texture_count);
|
||||||
|
|
||||||
m_device->CopyDescriptorsSimple(16,
|
m_device->CopyDescriptorsSimple(16,
|
||||||
|
|
|
@ -361,19 +361,6 @@ void D3D12GSRender::upload_textures(ID3D12GraphicsCommandList *command_list, siz
|
||||||
.Offset((UINT)i, m_descriptor_stride_srv_cbv_uav)
|
.Offset((UINT)i, m_descriptor_stride_srv_cbv_uav)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (get_current_resource_storage().current_sampler_index + 16 > 2048)
|
|
||||||
{
|
|
||||||
get_current_resource_storage().sampler_descriptors_heap_index = 1;
|
|
||||||
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(m_current_sampler_descriptors->GetCPUDescriptorHandleForHeapStart())
|
CD3DX12_CPU_DESCRIPTOR_HANDLE(m_current_sampler_descriptors->GetCPUDescriptorHandleForHeapStart())
|
||||||
.Offset((UINT)i, m_descriptor_stride_samplers));
|
.Offset((UINT)i, m_descriptor_stride_samplers));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue