Skip to content

Commit

Permalink
(D3D12) Get rid of some implicit memsets
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jul 17, 2023
1 parent 62e4779 commit 11d5775
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gfx/drivers/d3d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -3603,17 +3603,19 @@ static bool d3d12_gfx_frame(
}

{
D3D12_SAMPLER_DESC desc;
D3D12_CPU_DESCRIPTOR_HANDLE handle = {
d3d12->pass[i].samplers.ptr
- d3d12->desc.sampler_heap.gpu.ptr
+ d3d12->desc.sampler_heap.cpu.ptr
+ texture_sem->binding
* d3d12->desc.sampler_heap.stride
};
D3D12_SAMPLER_DESC desc = { D3D12_FILTER_MIN_MAG_MIP_LINEAR };

if (texture_sem->filter == RARCH_FILTER_NEAREST)
desc.Filter = D3D12_FILTER_MIN_MAG_MIP_POINT;
else
desc.Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR;

switch (texture_sem->wrap)
{
Expand All @@ -3637,10 +3639,15 @@ static bool d3d12_gfx_frame(

desc.AddressV = desc.AddressU;
desc.AddressW = desc.AddressU;
desc.MipLODBias = 0.0f;
desc.MaxAnisotropy = 1;
desc.ComparisonFunc = D3D12_COMPARISON_FUNC_NEVER;
desc.BorderColor[0] = 0.0f;
desc.BorderColor[1] = 0.0f;
desc.BorderColor[2] = 0.0f;
desc.BorderColor[3] = 0.0f;
desc.MinLOD = -D3D12_FLOAT32_MAX;
desc.MaxLOD = D3D12_FLOAT32_MAX;
desc.MaxLOD = D3D12_FLOAT32_MAX;

d3d12->device->lpVtbl->CreateSampler(d3d12->device, &desc, handle);
}
Expand Down

0 comments on commit 11d5775

Please sign in to comment.