vkd3d: Move ID3D12Device impl_froms to header
Basic casts should not be function calls.
This commit is contained in:
parent
bfaf72386f
commit
cabc31fc4c
|
@ -2430,11 +2430,6 @@ void d3d12_device_return_query_pool(struct d3d12_device *device, const struct vk
|
|||
}
|
||||
|
||||
/* ID3D12Device */
|
||||
static inline struct d3d12_device *impl_from_ID3D12Device(d3d12_device_iface *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device_iface);
|
||||
}
|
||||
|
||||
extern ULONG STDMETHODCALLTYPE d3d12_device_vkd3d_ext_AddRef(ID3D12DeviceExt *iface);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(d3d12_device_iface *iface,
|
||||
|
@ -4545,7 +4540,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(d3d12_
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl =
|
||||
CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
d3d12_device_QueryInterface,
|
||||
|
@ -5163,21 +5158,6 @@ static bool d3d12_device_supports_feature_level(struct d3d12_device *device, D3D
|
|||
return feature_level <= device->d3d12_caps.max_feature_level;
|
||||
}
|
||||
|
||||
struct d3d12_device *unsafe_impl_from_ID3D12Device(d3d12_device_iface *iface)
|
||||
{
|
||||
if (!iface)
|
||||
return NULL;
|
||||
|
||||
#ifdef VKD3D_ENABLE_PROFILING
|
||||
assert(iface->lpVtbl == &d3d12_device_vtbl ||
|
||||
iface->lpVtbl == &d3d12_device_vtbl_profiled);
|
||||
#else
|
||||
assert(iface->lpVtbl == &d3d12_device_vtbl);
|
||||
#endif
|
||||
|
||||
return impl_from_ID3D12Device(iface);
|
||||
}
|
||||
|
||||
extern CONST_VTBL struct ID3D12DeviceExtVtbl d3d12_device_vkd3d_ext_vtbl;
|
||||
|
||||
static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||
|
|
|
@ -215,7 +215,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState_profiled(d3d12
|
|||
DEVICE_PROFILED_CALL_HRESULT(CreatePipelineState, iface, desc, riid, pipeline_state);
|
||||
}
|
||||
|
||||
static CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl_profiled =
|
||||
CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl_profiled =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
d3d12_device_QueryInterface,
|
||||
|
|
|
@ -2742,7 +2742,7 @@ fail:
|
|||
VKD3D_EXPORT HRESULT vkd3d_create_image_resource(ID3D12Device *device,
|
||||
const struct vkd3d_image_resource_create_info *create_info, ID3D12Resource **resource)
|
||||
{
|
||||
struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device((d3d12_device_iface *)device);
|
||||
struct d3d12_device *d3d12_device = impl_from_ID3D12Device((d3d12_device_iface *)device);
|
||||
struct d3d12_resource *object;
|
||||
HRESULT hr;
|
||||
|
||||
|
|
|
@ -2813,7 +2813,26 @@ void d3d12_device_unmap_vkd3d_queue(struct d3d12_device *device,
|
|||
bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent);
|
||||
void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason,
|
||||
const char *message, ...) VKD3D_PRINTF_FUNC(3, 4);
|
||||
struct d3d12_device *unsafe_impl_from_ID3D12Device(d3d12_device_iface *iface);
|
||||
|
||||
static inline struct d3d12_device *impl_from_ID3D12Device(d3d12_device_iface *iface)
|
||||
{
|
||||
extern CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl;
|
||||
#ifdef VKD3D_ENABLE_PROFILING
|
||||
extern CONST_VTBL struct ID3D12Device6Vtbl d3d12_device_vtbl_profiled;
|
||||
#endif
|
||||
if (!iface)
|
||||
return NULL;
|
||||
|
||||
#ifdef VKD3D_ENABLE_PROFILING
|
||||
assert(iface->lpVtbl == &d3d12_device_vtbl ||
|
||||
iface->lpVtbl == &d3d12_device_vtbl_profiled);
|
||||
#else
|
||||
assert(iface->lpVtbl == &d3d12_device_vtbl);
|
||||
#endif
|
||||
|
||||
return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device_iface);
|
||||
}
|
||||
|
||||
bool d3d12_device_validate_shader_meta(struct d3d12_device *device, const struct vkd3d_shader_meta *meta);
|
||||
|
||||
HRESULT d3d12_device_get_scratch_buffer(struct d3d12_device *device, VkDeviceSize min_size, struct vkd3d_scratch_buffer *scratch);
|
||||
|
|
Loading…
Reference in New Issue