Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d3d12: Move sampler DescriptorHeap selection in D3D12GSRender #1642

Merged
merged 1 commit into from
Mar 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,19 @@ void D3D12GSRender::end()
size_t texture_count = std::get<2>(m_current_pso);
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);

m_device->CopyDescriptorsSimple(16,
Expand Down
13 changes: 0 additions & 13 deletions rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,6 @@ void D3D12GSRender::upload_textures(ID3D12GraphicsCommandList *command_list, siz
.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]),
CD3DX12_CPU_DESCRIPTOR_HANDLE(m_current_sampler_descriptors->GetCPUDescriptorHandleForHeapStart())
.Offset((UINT)i, m_descriptor_stride_samplers));
Expand Down