vkd3d: De-virtualize query for descriptor size.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
719a38a5fe
commit
2f6a91e772
|
@ -3808,20 +3808,7 @@ static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(d3d1
|
||||||
{
|
{
|
||||||
TRACE("iface %p, descriptor_heap_type %#x.\n", iface, descriptor_heap_type);
|
TRACE("iface %p, descriptor_heap_type %#x.\n", iface, descriptor_heap_type);
|
||||||
|
|
||||||
switch (descriptor_heap_type)
|
return d3d12_device_get_descriptor_handle_increment_size(descriptor_heap_type);
|
||||||
{
|
|
||||||
case D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV:
|
|
||||||
case D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER:
|
|
||||||
return sizeof(struct d3d12_desc);
|
|
||||||
|
|
||||||
case D3D12_DESCRIPTOR_HEAP_TYPE_RTV:
|
|
||||||
case D3D12_DESCRIPTOR_HEAP_TYPE_DSV:
|
|
||||||
return sizeof(struct d3d12_rtv_desc);
|
|
||||||
|
|
||||||
default:
|
|
||||||
FIXME("Unhandled type %#x.\n", descriptor_heap_type);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(d3d12_device_iface *iface,
|
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(d3d12_device_iface *iface,
|
||||||
|
@ -3960,7 +3947,7 @@ static inline void d3d12_device_copy_descriptors(struct d3d12_device *device,
|
||||||
unsigned int dst_range_size, src_range_size, copy_count;
|
unsigned int dst_range_size, src_range_size, copy_count;
|
||||||
unsigned int increment;
|
unsigned int increment;
|
||||||
|
|
||||||
increment = d3d12_device_get_descriptor_handle_increment_size(device, descriptor_heap_type);
|
increment = d3d12_device_get_descriptor_handle_increment_size(descriptor_heap_type);
|
||||||
|
|
||||||
dst_range_idx = dst_idx = 0;
|
dst_range_idx = dst_idx = 0;
|
||||||
src_range_idx = src_idx = 0;
|
src_range_idx = src_idx = 0;
|
||||||
|
|
|
@ -5677,7 +5677,7 @@ HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device,
|
||||||
struct d3d12_descriptor_heap *object;
|
struct d3d12_descriptor_heap *object;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(descriptor_size = d3d12_device_get_descriptor_handle_increment_size(device, desc->Type)))
|
if (!(descriptor_size = d3d12_device_get_descriptor_handle_increment_size(desc->Type)))
|
||||||
{
|
{
|
||||||
WARN("No descriptor size for descriptor type %#x.\n", desc->Type);
|
WARN("No descriptor size for descriptor type %#x.\n", desc->Type);
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
|
@ -2989,10 +2989,23 @@ static inline ULONG d3d12_device_release(struct d3d12_device *device)
|
||||||
return ID3D12Device9_Release(&device->ID3D12Device_iface);
|
return ID3D12Device9_Release(&device->ID3D12Device_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int d3d12_device_get_descriptor_handle_increment_size(struct d3d12_device *device,
|
static inline unsigned int d3d12_device_get_descriptor_handle_increment_size(
|
||||||
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type)
|
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
|
||||||
{
|
{
|
||||||
return ID3D12Device9_GetDescriptorHandleIncrementSize(&device->ID3D12Device_iface, descriptor_type);
|
switch (descriptor_heap_type)
|
||||||
|
{
|
||||||
|
case D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV:
|
||||||
|
case D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER:
|
||||||
|
return sizeof(struct d3d12_desc);
|
||||||
|
|
||||||
|
case D3D12_DESCRIPTOR_HEAP_TYPE_RTV:
|
||||||
|
case D3D12_DESCRIPTOR_HEAP_TYPE_DSV:
|
||||||
|
return sizeof(struct d3d12_rtv_desc);
|
||||||
|
|
||||||
|
default:
|
||||||
|
FIXME("Unhandled type %#x.\n", descriptor_heap_type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool d3d12_device_use_ssbo_raw_buffer(struct d3d12_device *device)
|
static inline bool d3d12_device_use_ssbo_raw_buffer(struct d3d12_device *device)
|
||||||
|
|
Loading…
Reference in New Issue