diff --git a/gfx/common/d3d11_common.h b/gfx/common/d3d11_common.h index eab57683bd..ff98880d26 100644 --- a/gfx/common/d3d11_common.h +++ b/gfx/common/d3d11_common.h @@ -2635,15 +2635,15 @@ static INLINE void D3D11SetVertexBuffer( UINT stride, UINT offset) { - D3D11SetVertexBuffers(device_context, slot, 1, &vertex_buffer, &stride, &offset); + D3D11SetVertexBuffers(device_context, slot, 1, (ID3D11Buffer** const)&vertex_buffer, &stride, &offset); } static INLINE void D3D11SetVShaderConstantBuffer( D3D11DeviceContext device_context, UINT slot, D3D11Buffer const constant_buffer) { - D3D11SetVShaderConstantBuffers(device_context, slot, 1, &constant_buffer); + D3D11SetVShaderConstantBuffers(device_context, slot, 1, (ID3D11Buffer** const)&constant_buffer); } static INLINE void D3D11SetPShaderConstantBuffer( D3D11DeviceContext device_context, UINT slot, D3D11Buffer const constant_buffer) { - D3D11SetPShaderConstantBuffers(device_context, slot, 1, &constant_buffer); + D3D11SetPShaderConstantBuffers(device_context, slot, 1, (ID3D11Buffer** const)&constant_buffer); } diff --git a/gfx/common/d3d12_common.c b/gfx/common/d3d12_common.c index 7ec2db3a4e..13c5f7bc42 100644 --- a/gfx/common/d3d12_common.c +++ b/gfx/common/d3d12_common.c @@ -19,7 +19,7 @@ #include "dxgi_common.h" #include "d3dcompiler_common.h" -#include "verbosity.h" +#include "../verbosity.h" #ifdef __MINGW32__ /* clang-format off */ @@ -61,39 +61,51 @@ static const char* d3d12_dll_name = "d3d12.dll"; HRESULT WINAPI D3D12CreateDevice( IUnknown* pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid, void** ppDevice) { + static PFN_D3D12_CREATE_DEVICE fp; +#ifdef HAVE_DYNAMIC if (!d3d12_dll) d3d12_dll = dylib_load(d3d12_dll_name); - if (d3d12_dll) - { - static PFN_D3D12_CREATE_DEVICE fp; + if (!d3d12_dll) + goto error; - if (!fp) - fp = (PFN_D3D12_CREATE_DEVICE)dylib_proc(d3d12_dll, "D3D12CreateDevice"); + if (!fp) + fp = (PFN_D3D12_CREATE_DEVICE)dylib_proc(d3d12_dll, "D3D12CreateDevice"); +#else + fp = D3D12CreateDevice; +#endif - if (fp) - return fp(pAdapter, MinimumFeatureLevel, riid, ppDevice); - } + if (fp) + return fp(pAdapter, MinimumFeatureLevel, riid, ppDevice); +#ifdef HAVE_DYNAMIC +error: +#endif return TYPE_E_CANTLOADLIBRARY; } HRESULT WINAPI D3D12GetDebugInterface(REFIID riid, void** ppvDebug) { + static PFN_D3D12_GET_DEBUG_INTERFACE fp; +#ifdef HAVE_DYNAMIC if (!d3d12_dll) d3d12_dll = dylib_load(d3d12_dll_name); - if (d3d12_dll) - { - static PFN_D3D12_GET_DEBUG_INTERFACE fp; + if (!d3d12_dll) + goto error; - if (!fp) - fp = (PFN_D3D12_GET_DEBUG_INTERFACE)dylib_proc(d3d12_dll, "D3D12GetDebugInterface"); + if (!fp) + fp = (PFN_D3D12_GET_DEBUG_INTERFACE)dylib_proc(d3d12_dll, "D3D12GetDebugInterface"); +#else + fp = D3D12GetDebugInterface; +#endif - if (fp) - return fp(riid, ppvDebug); - } + if (fp) + return fp(riid, ppvDebug); +#ifdef HAVE_DYNAMIC +error: +#endif return TYPE_E_CANTLOADLIBRARY; } @@ -103,21 +115,27 @@ HRESULT WINAPI D3D12SerializeRootSignature( ID3DBlob** ppBlob, ID3DBlob** ppErrorBlob) { + static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE fp; +#ifdef HAVE_DYNAMIC if (!d3d12_dll) d3d12_dll = dylib_load(d3d12_dll_name); - if (d3d12_dll) - { - static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE fp; + if (!d3d12_dll) + goto error; - if (!fp) - fp = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)dylib_proc( + if (!fp) + fp = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)dylib_proc( d3d12_dll, "D3D12SerializeRootSignature"); +#else + fp = D3D12SerializeRootSignature; +#endif - if (fp) - return fp(pRootSignature, Version, ppBlob, ppErrorBlob); - } + if (fp) + return fp(pRootSignature, Version, ppBlob, ppErrorBlob); +#ifdef HAVE_DYNAMIC +error: +#endif return TYPE_E_CANTLOADLIBRARY; } @@ -126,26 +144,30 @@ HRESULT WINAPI D3D12SerializeVersionedRootSignature( ID3DBlob** ppBlob, ID3DBlob** ppErrorBlob) { + static PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE fp; +#ifdef HAVE_DYNAMIC if (!d3d12_dll) d3d12_dll = dylib_load(d3d12_dll_name); - if (d3d12_dll) - { - static PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE fp; + if (!d3d12_dll) + goto error; - if (!fp) - fp = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)dylib_proc( + if (!fp) + fp = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)dylib_proc( d3d12_dll, "D3D12SerializeRootSignature"); +#else + fp = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)D3D12SerializeRootSignature; +#endif - if (fp) - return fp(pRootSignature, ppBlob, ppErrorBlob); - } + if (fp) + return fp(pRootSignature, ppBlob, ppErrorBlob); +#ifdef HAVE_DYNAMIC +error: +#endif return TYPE_E_CANTLOADLIBRARY; } -#include - bool d3d12_init_base(d3d12_video_t* d3d12) { @@ -384,7 +406,7 @@ bool d3d12_init_pipeline(d3d12_video_t* d3d12) D3DBlob ps_code; static const char stock[] = -#include "gfx/drivers/d3d_shaders/opaque_sm5.hlsl.h" +#include "../drivers/d3d_shaders/opaque_sm5.hlsl.h" ; static const D3D12_INPUT_ELEMENT_DESC inputElementDesc[] = { @@ -532,13 +554,16 @@ void d3d12_init_texture( } { - D3D12_SHADER_RESOURCE_VIEW_DESC view_desc = { - .Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, - .Format = texture->desc.Format, - .ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D, - .Texture2D.MipLevels = texture->desc.MipLevels, - }; - D3D12_CPU_DESCRIPTOR_HANDLE handle = { heap->cpu.ptr + heap_index * heap->stride }; + D3D12_CPU_DESCRIPTOR_HANDLE handle; + D3D12_SHADER_RESOURCE_VIEW_DESC view_desc = { 0 }; + + view_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + view_desc.Format = texture->desc.Format; + view_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; + view_desc.Texture2D.MipLevels = texture->desc.MipLevels; + + handle.ptr = heap->cpu.ptr + heap_index * heap->stride; + D3D12CreateShaderResourceView(device, texture->handle, &view_desc, handle); texture->gpu_descriptor.ptr = heap->gpu.ptr + heap_index * heap->stride; } @@ -546,17 +571,16 @@ void d3d12_init_texture( void d3d12_upload_texture(D3D12GraphicsCommandList cmd, d3d12_texture_t* texture) { - D3D12_TEXTURE_COPY_LOCATION src = { - .pResource = texture->upload_buffer, - .Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, - .PlacedFootprint = texture->layout, - }; + D3D12_TEXTURE_COPY_LOCATION src = { 0 }; + D3D12_TEXTURE_COPY_LOCATION dst = { 0 }; - D3D12_TEXTURE_COPY_LOCATION dst = { - .pResource = texture->handle, - .Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, - .SubresourceIndex = 0, - }; + src.pResource = texture->upload_buffer; + src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; + src.PlacedFootprint = texture->layout; + + dst.pResource = texture->handle; + dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + dst.SubresourceIndex = 0; d3d12_resource_transition( cmd, texture->handle, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, diff --git a/gfx/common/d3d12_common.h b/gfx/common/d3d12_common.h index 6a56b17434..650b0655b0 100644 --- a/gfx/common/d3d12_common.h +++ b/gfx/common/d3d12_common.h @@ -15,6 +15,8 @@ #pragma once +#include + #ifdef __MINGW32__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #define _In_ @@ -40,7 +42,7 @@ #ifndef COM_RELEASE_DECLARED #define COM_RELEASE_DECLARED #if defined(__cplusplus) && !defined(CINTERFACE) -static inline ULONG Release(IUnknown* object) +static INLINE ULONG Release(IUnknown* object) { if (object) return object->Release(); @@ -48,7 +50,7 @@ static inline ULONG Release(IUnknown* object) return 0; } #else -static inline ULONG Release(void* object) +static INLINE ULONG Release(void* object) { if (object) return ((IUnknown*)object)->lpVtbl->Release(object); @@ -85,35 +87,35 @@ typedef ID3D12DebugCommandQueue* D3D12DebugCommandQueue; typedef ID3D12DebugCommandList* D3D12DebugCommandList; typedef ID3D12InfoQueue* D3D12InfoQueue; -static inline ULONG D3D12Release(void* object) +static INLINE ULONG D3D12Release(void* object) { return ((ID3D12Object*)object)->lpVtbl->Release(object); } -static inline ULONG D3D12ReleaseDeviceChild(D3D12DeviceChild device_child) +static INLINE ULONG D3D12ReleaseDeviceChild(D3D12DeviceChild device_child) { return device_child->lpVtbl->Release(device_child); } -static inline ULONG D3D12ReleaseRootSignature(D3D12RootSignature root_signature) +static INLINE ULONG D3D12ReleaseRootSignature(D3D12RootSignature root_signature) { return root_signature->lpVtbl->Release(root_signature); } -static inline ULONG +static INLINE ULONG D3D12ReleaseRootSignatureDeserializer(D3D12RootSignatureDeserializer root_signature_deserializer) { return root_signature_deserializer->lpVtbl->Release(root_signature_deserializer); } -static inline const D3D12_ROOT_SIGNATURE_DESC* +static INLINE const D3D12_ROOT_SIGNATURE_DESC* D3D12GetRootSignatureDesc(D3D12RootSignatureDeserializer root_signature_deserializer) { return root_signature_deserializer->lpVtbl->GetRootSignatureDesc(root_signature_deserializer); } -static inline ULONG D3D12ReleaseVersionedRootSignatureDeserializer( +static INLINE ULONG D3D12ReleaseVersionedRootSignatureDeserializer( D3D12VersionedRootSignatureDeserializer versioned_root_signature_deserializer) { return versioned_root_signature_deserializer->lpVtbl->Release( versioned_root_signature_deserializer); } -static inline HRESULT D3D12GetRootSignatureDescAtVersion( +static INLINE HRESULT D3D12GetRootSignatureDescAtVersion( D3D12VersionedRootSignatureDeserializer versioned_root_signature_deserializer, D3D_ROOT_SIGNATURE_VERSION convert_to_version, const D3D12_VERSIONED_ROOT_SIGNATURE_DESC** desc) @@ -121,35 +123,35 @@ static inline HRESULT D3D12GetRootSignatureDescAtVersion( return versioned_root_signature_deserializer->lpVtbl->GetRootSignatureDescAtVersion( versioned_root_signature_deserializer, convert_to_version, desc); } -static inline const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* D3D12GetUnconvertedRootSignatureDesc( +static INLINE const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* D3D12GetUnconvertedRootSignatureDesc( D3D12VersionedRootSignatureDeserializer versioned_root_signature_deserializer) { return versioned_root_signature_deserializer->lpVtbl->GetUnconvertedRootSignatureDesc( versioned_root_signature_deserializer); } -static inline ULONG D3D12ReleasePageable(D3D12Pageable pageable) +static INLINE ULONG D3D12ReleasePageable(D3D12Pageable pageable) { return pageable->lpVtbl->Release(pageable); } -static inline ULONG D3D12ReleaseHeap(D3D12Heap heap) { return heap->lpVtbl->Release(heap); } -static inline ULONG D3D12ReleaseResource(void* resource) +static INLINE ULONG D3D12ReleaseHeap(D3D12Heap heap) { return heap->lpVtbl->Release(heap); } +static INLINE ULONG D3D12ReleaseResource(void* resource) { return ((ID3D12Resource*)resource)->lpVtbl->Release(resource); } -static inline HRESULT +static INLINE HRESULT D3D12Map(void* resource, UINT subresource, D3D12_RANGE* read_range, void** data) { return ((ID3D12Resource*)resource)->lpVtbl->Map(resource, subresource, read_range, data); } -static inline void D3D12Unmap(void* resource, UINT subresource, D3D12_RANGE* written_range) +static INLINE void D3D12Unmap(void* resource, UINT subresource, D3D12_RANGE* written_range) { ((ID3D12Resource*)resource)->lpVtbl->Unmap(resource, subresource, written_range); } -static inline D3D12_GPU_VIRTUAL_ADDRESS D3D12GetGPUVirtualAddress(void* resource) +static INLINE D3D12_GPU_VIRTUAL_ADDRESS D3D12GetGPUVirtualAddress(void* resource) { return ((ID3D12Resource*)resource)->lpVtbl->GetGPUVirtualAddress(resource); } -static inline HRESULT D3D12WriteToSubresource( +static INLINE HRESULT D3D12WriteToSubresource( void* resource, UINT dst_subresource, D3D12_BOX* dst_box, @@ -161,7 +163,7 @@ static inline HRESULT D3D12WriteToSubresource( ->lpVtbl->WriteToSubresource( resource, dst_subresource, dst_box, src_data, src_row_pitch, src_depth_pitch); } -static inline HRESULT D3D12ReadFromSubresource( +static INLINE HRESULT D3D12ReadFromSubresource( void* resource, void* dst_data, UINT dst_row_pitch, @@ -173,78 +175,78 @@ static inline HRESULT D3D12ReadFromSubresource( ->lpVtbl->ReadFromSubresource( resource, dst_data, dst_row_pitch, dst_depth_pitch, src_subresource, src_box); } -static inline HRESULT D3D12GetHeapProperties( +static INLINE HRESULT D3D12GetHeapProperties( void* resource, D3D12_HEAP_PROPERTIES* heap_properties, D3D12_HEAP_FLAGS* heap_flags) { return ((ID3D12Resource*)resource) ->lpVtbl->GetHeapProperties(resource, heap_properties, heap_flags); } -static inline ULONG D3D12ReleaseCommandAllocator(D3D12CommandAllocator command_allocator) +static INLINE ULONG D3D12ReleaseCommandAllocator(D3D12CommandAllocator command_allocator) { return command_allocator->lpVtbl->Release(command_allocator); } -static inline HRESULT D3D12ResetCommandAllocator(D3D12CommandAllocator command_allocator) +static INLINE HRESULT D3D12ResetCommandAllocator(D3D12CommandAllocator command_allocator) { return command_allocator->lpVtbl->Reset(command_allocator); } -static inline ULONG D3D12ReleaseFence(D3D12Fence fence) { return fence->lpVtbl->Release(fence); } -static inline UINT64 D3D12GetCompletedValue(D3D12Fence fence) +static INLINE ULONG D3D12ReleaseFence(D3D12Fence fence) { return fence->lpVtbl->Release(fence); } +static INLINE UINT64 D3D12GetCompletedValue(D3D12Fence fence) { return fence->lpVtbl->GetCompletedValue(fence); } -static inline HRESULT D3D12SetEventOnCompletion(D3D12Fence fence, UINT64 value, HANDLE h_event) +static INLINE HRESULT D3D12SetEventOnCompletion(D3D12Fence fence, UINT64 value, HANDLE h_event) { return fence->lpVtbl->SetEventOnCompletion(fence, value, h_event); } -static inline HRESULT D3D12SignalFence(D3D12Fence fence, UINT64 value) +static INLINE HRESULT D3D12SignalFence(D3D12Fence fence, UINT64 value) { return fence->lpVtbl->Signal(fence, value); } -static inline ULONG D3D12ReleasePipelineState(D3D12PipelineState pipeline_state) +static INLINE ULONG D3D12ReleasePipelineState(D3D12PipelineState pipeline_state) { return pipeline_state->lpVtbl->Release(pipeline_state); } -static inline HRESULT D3D12GetCachedBlob(D3D12PipelineState pipeline_state, ID3DBlob** blob) +static INLINE HRESULT D3D12GetCachedBlob(D3D12PipelineState pipeline_state, ID3DBlob** blob) { return pipeline_state->lpVtbl->GetCachedBlob(pipeline_state, blob); } -static inline ULONG D3D12ReleaseDescriptorHeap(D3D12DescriptorHeap descriptor_heap) +static INLINE ULONG D3D12ReleaseDescriptorHeap(D3D12DescriptorHeap descriptor_heap) { return descriptor_heap->lpVtbl->Release(descriptor_heap); } -static inline ULONG D3D12ReleaseQueryHeap(D3D12QueryHeap query_heap) +static INLINE ULONG D3D12ReleaseQueryHeap(D3D12QueryHeap query_heap) { return query_heap->lpVtbl->Release(query_heap); } -static inline ULONG D3D12ReleaseCommandSignature(D3D12CommandSignature command_signature) +static INLINE ULONG D3D12ReleaseCommandSignature(D3D12CommandSignature command_signature) { return command_signature->lpVtbl->Release(command_signature); } -static inline ULONG D3D12ReleaseCommandList(D3D12CommandList command_list) +static INLINE ULONG D3D12ReleaseCommandList(D3D12CommandList command_list) { return command_list->lpVtbl->Release(command_list); } -static inline ULONG D3D12ReleaseGraphicsCommandList(D3D12GraphicsCommandList graphics_command_list) +static INLINE ULONG D3D12ReleaseGraphicsCommandList(D3D12GraphicsCommandList graphics_command_list) { return graphics_command_list->lpVtbl->Release(graphics_command_list); } -static inline HRESULT D3D12CloseGraphicsCommandList(D3D12GraphicsCommandList graphics_command_list) +static INLINE HRESULT D3D12CloseGraphicsCommandList(D3D12GraphicsCommandList graphics_command_list) { return graphics_command_list->lpVtbl->Close(graphics_command_list); } -static inline HRESULT D3D12ResetGraphicsCommandList( +static INLINE HRESULT D3D12ResetGraphicsCommandList( D3D12GraphicsCommandList graphics_command_list, D3D12CommandAllocator allocator, D3D12PipelineState initial_state) { return graphics_command_list->lpVtbl->Reset(graphics_command_list, allocator, initial_state); } -static inline void +static INLINE void D3D12ClearState(D3D12GraphicsCommandList graphics_command_list, D3D12PipelineState pipeline_state) { graphics_command_list->lpVtbl->ClearState(graphics_command_list, pipeline_state); } -static inline void D3D12DrawInstanced( +static INLINE void D3D12DrawInstanced( D3D12GraphicsCommandList graphics_command_list, UINT vertex_count_per_instance, UINT instance_count, @@ -255,7 +257,7 @@ static inline void D3D12DrawInstanced( graphics_command_list, vertex_count_per_instance, instance_count, start_vertex_location, start_instance_location); } -static inline void D3D12DrawIndexedInstanced( +static INLINE void D3D12DrawIndexedInstanced( D3D12GraphicsCommandList graphics_command_list, UINT index_count_per_instance, UINT instance_count, @@ -267,7 +269,7 @@ static inline void D3D12DrawIndexedInstanced( graphics_command_list, index_count_per_instance, instance_count, start_index_location, base_vertex_location, start_instance_location); } -static inline void D3D12Dispatch( +static INLINE void D3D12Dispatch( D3D12GraphicsCommandList graphics_command_list, UINT thread_group_count_x, UINT thread_group_count_y, @@ -276,7 +278,7 @@ static inline void D3D12Dispatch( graphics_command_list->lpVtbl->Dispatch( graphics_command_list, thread_group_count_x, thread_group_count_y, thread_group_count_z); } -static inline void D3D12CopyBufferRegion( +static INLINE void D3D12CopyBufferRegion( D3D12GraphicsCommandList graphics_command_list, D3D12Resource dst_buffer, UINT64 dst_offset, @@ -288,7 +290,7 @@ static inline void D3D12CopyBufferRegion( graphics_command_list, dst_buffer, dst_offset, (ID3D12Resource*)src_buffer, src_offset, num_bytes); } -static inline void D3D12CopyTextureRegion( +static INLINE void D3D12CopyTextureRegion( D3D12GraphicsCommandList graphics_command_list, D3D12_TEXTURE_COPY_LOCATION* dst, UINT dst_x, @@ -300,13 +302,13 @@ static inline void D3D12CopyTextureRegion( graphics_command_list->lpVtbl->CopyTextureRegion( graphics_command_list, dst, dst_x, dst_y, dst_z, src, src_box); } -static inline void D3D12CopyResource( +static INLINE void D3D12CopyResource( D3D12GraphicsCommandList graphics_command_list, void* dst_resource, void* src_resource) { graphics_command_list->lpVtbl->CopyResource( graphics_command_list, (ID3D12Resource*)dst_resource, (ID3D12Resource*)src_resource); } -static inline void D3D12CopyTiles( +static INLINE void D3D12CopyTiles( D3D12GraphicsCommandList graphics_command_list, void* tiled_resource, D3D12_TILED_RESOURCE_COORDINATE* tile_region_start_coordinate, @@ -319,7 +321,7 @@ static inline void D3D12CopyTiles( graphics_command_list, (ID3D12Resource*)tiled_resource, tile_region_start_coordinate, tile_region_size, (ID3D12Resource*)buffer, buffer_start_offset_in_bytes, flags); } -static inline void D3D12ResolveSubresource( +static INLINE void D3D12ResolveSubresource( D3D12GraphicsCommandList graphics_command_list, void* dst_resource, UINT dst_subresource, @@ -331,54 +333,54 @@ static inline void D3D12ResolveSubresource( graphics_command_list, (ID3D12Resource*)dst_resource, dst_subresource, (ID3D12Resource*)src_resource, src_subresource, format); } -static inline void D3D12IASetPrimitiveTopology( +static INLINE void D3D12IASetPrimitiveTopology( D3D12GraphicsCommandList graphics_command_list, D3D12_PRIMITIVE_TOPOLOGY primitive_topology) { graphics_command_list->lpVtbl->IASetPrimitiveTopology(graphics_command_list, primitive_topology); } -static inline void D3D12RSSetViewports( +static INLINE void D3D12RSSetViewports( D3D12GraphicsCommandList graphics_command_list, UINT num_viewports, D3D12_VIEWPORT* viewports) { graphics_command_list->lpVtbl->RSSetViewports(graphics_command_list, num_viewports, viewports); } -static inline void D3D12RSSetScissorRects( +static INLINE void D3D12RSSetScissorRects( D3D12GraphicsCommandList graphics_command_list, UINT num_rects, D3D12_RECT* rects) { graphics_command_list->lpVtbl->RSSetScissorRects(graphics_command_list, num_rects, rects); } -static inline void +static INLINE void D3D12OMSetStencilRef(D3D12GraphicsCommandList graphics_command_list, UINT stencil_ref) { graphics_command_list->lpVtbl->OMSetStencilRef(graphics_command_list, stencil_ref); } -static inline void D3D12SetPipelineState( +static INLINE void D3D12SetPipelineState( D3D12GraphicsCommandList graphics_command_list, D3D12PipelineState pipeline_state) { graphics_command_list->lpVtbl->SetPipelineState(graphics_command_list, pipeline_state); } -static inline void D3D12ResourceBarrier( +static INLINE void D3D12ResourceBarrier( D3D12GraphicsCommandList graphics_command_list, UINT num_barriers, D3D12_RESOURCE_BARRIER* barriers) { graphics_command_list->lpVtbl->ResourceBarrier(graphics_command_list, num_barriers, barriers); } -static inline void D3D12ExecuteBundle( +static INLINE void D3D12ExecuteBundle( D3D12GraphicsCommandList graphics_command_list, D3D12GraphicsCommandList command_list) { graphics_command_list->lpVtbl->ExecuteBundle(graphics_command_list, command_list); } -static inline void D3D12SetComputeRootSignature( +static INLINE void D3D12SetComputeRootSignature( D3D12GraphicsCommandList graphics_command_list, D3D12RootSignature root_signature) { graphics_command_list->lpVtbl->SetComputeRootSignature(graphics_command_list, root_signature); } -static inline void D3D12SetGraphicsRootSignature( +static INLINE void D3D12SetGraphicsRootSignature( D3D12GraphicsCommandList graphics_command_list, D3D12RootSignature root_signature) { graphics_command_list->lpVtbl->SetGraphicsRootSignature(graphics_command_list, root_signature); } -static inline void D3D12SetComputeRootDescriptorTable( +static INLINE void D3D12SetComputeRootDescriptorTable( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) @@ -386,7 +388,7 @@ static inline void D3D12SetComputeRootDescriptorTable( graphics_command_list->lpVtbl->SetComputeRootDescriptorTable( graphics_command_list, root_parameter_index, base_descriptor); } -static inline void D3D12SetGraphicsRootDescriptorTable( +static INLINE void D3D12SetGraphicsRootDescriptorTable( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) @@ -394,7 +396,7 @@ static inline void D3D12SetGraphicsRootDescriptorTable( graphics_command_list->lpVtbl->SetGraphicsRootDescriptorTable( graphics_command_list, root_parameter_index, base_descriptor); } -static inline void D3D12SetComputeRoot32BitConstant( +static INLINE void D3D12SetComputeRoot32BitConstant( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, UINT src_data, @@ -403,7 +405,7 @@ static inline void D3D12SetComputeRoot32BitConstant( graphics_command_list->lpVtbl->SetComputeRoot32BitConstant( graphics_command_list, root_parameter_index, src_data, dest_offset_in32_bit_values); } -static inline void D3D12SetGraphicsRoot32BitConstant( +static INLINE void D3D12SetGraphicsRoot32BitConstant( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, UINT src_data, @@ -412,7 +414,7 @@ static inline void D3D12SetGraphicsRoot32BitConstant( graphics_command_list->lpVtbl->SetGraphicsRoot32BitConstant( graphics_command_list, root_parameter_index, src_data, dest_offset_in32_bit_values); } -static inline void D3D12SetComputeRoot32BitConstants( +static INLINE void D3D12SetComputeRoot32BitConstants( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, UINT num32_bit_values_to_set, @@ -423,7 +425,7 @@ static inline void D3D12SetComputeRoot32BitConstants( graphics_command_list, root_parameter_index, num32_bit_values_to_set, src_data, dest_offset_in32_bit_values); } -static inline void D3D12SetGraphicsRoot32BitConstants( +static INLINE void D3D12SetGraphicsRoot32BitConstants( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, UINT num32_bit_values_to_set, @@ -434,7 +436,7 @@ static inline void D3D12SetGraphicsRoot32BitConstants( graphics_command_list, root_parameter_index, num32_bit_values_to_set, src_data, dest_offset_in32_bit_values); } -static inline void D3D12SetComputeRootConstantBufferView( +static INLINE void D3D12SetComputeRootConstantBufferView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -442,7 +444,7 @@ static inline void D3D12SetComputeRootConstantBufferView( graphics_command_list->lpVtbl->SetComputeRootConstantBufferView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void D3D12SetGraphicsRootConstantBufferView( +static INLINE void D3D12SetGraphicsRootConstantBufferView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -450,7 +452,7 @@ static inline void D3D12SetGraphicsRootConstantBufferView( graphics_command_list->lpVtbl->SetGraphicsRootConstantBufferView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void D3D12SetComputeRootShaderResourceView( +static INLINE void D3D12SetComputeRootShaderResourceView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -458,7 +460,7 @@ static inline void D3D12SetComputeRootShaderResourceView( graphics_command_list->lpVtbl->SetComputeRootShaderResourceView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void D3D12SetGraphicsRootShaderResourceView( +static INLINE void D3D12SetGraphicsRootShaderResourceView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -466,7 +468,7 @@ static inline void D3D12SetGraphicsRootShaderResourceView( graphics_command_list->lpVtbl->SetGraphicsRootShaderResourceView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void D3D12SetComputeRootUnorderedAccessView( +static INLINE void D3D12SetComputeRootUnorderedAccessView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -474,7 +476,7 @@ static inline void D3D12SetComputeRootUnorderedAccessView( graphics_command_list->lpVtbl->SetComputeRootUnorderedAccessView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void D3D12SetGraphicsRootUnorderedAccessView( +static INLINE void D3D12SetGraphicsRootUnorderedAccessView( D3D12GraphicsCommandList graphics_command_list, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS buffer_location) @@ -482,12 +484,12 @@ static inline void D3D12SetGraphicsRootUnorderedAccessView( graphics_command_list->lpVtbl->SetGraphicsRootUnorderedAccessView( graphics_command_list, root_parameter_index, buffer_location); } -static inline void +static INLINE void D3D12IASetIndexBuffer(D3D12GraphicsCommandList graphics_command_list, D3D12_INDEX_BUFFER_VIEW* view) { graphics_command_list->lpVtbl->IASetIndexBuffer(graphics_command_list, view); } -static inline void D3D12IASetVertexBuffers( +static INLINE void D3D12IASetVertexBuffers( D3D12GraphicsCommandList graphics_command_list, UINT start_slot, UINT num_views, @@ -496,7 +498,7 @@ static inline void D3D12IASetVertexBuffers( graphics_command_list->lpVtbl->IASetVertexBuffers( graphics_command_list, start_slot, num_views, views); } -static inline void D3D12SOSetTargets( +static INLINE void D3D12SOSetTargets( D3D12GraphicsCommandList graphics_command_list, UINT start_slot, UINT num_views, @@ -504,7 +506,7 @@ static inline void D3D12SOSetTargets( { graphics_command_list->lpVtbl->SOSetTargets(graphics_command_list, start_slot, num_views, views); } -static inline void D3D12OMSetRenderTargets( +static INLINE void D3D12OMSetRenderTargets( D3D12GraphicsCommandList graphics_command_list, UINT num_render_target_descriptors, D3D12_CPU_DESCRIPTOR_HANDLE* render_target_descriptors, @@ -515,7 +517,7 @@ static inline void D3D12OMSetRenderTargets( graphics_command_list, num_render_target_descriptors, render_target_descriptors, r_ts_single_handle_to_descriptor_range, depth_stencil_descriptor); } -static inline void D3D12ClearDepthStencilView( +static INLINE void D3D12ClearDepthStencilView( D3D12GraphicsCommandList graphics_command_list, D3D12_CPU_DESCRIPTOR_HANDLE depth_stencil_view, D3D12_CLEAR_FLAGS clear_flags, @@ -527,13 +529,13 @@ static inline void D3D12ClearDepthStencilView( graphics_command_list->lpVtbl->ClearDepthStencilView( graphics_command_list, depth_stencil_view, clear_flags, depth, stencil, num_rects, rects); } -static inline void D3D12DiscardResource( +static INLINE void D3D12DiscardResource( D3D12GraphicsCommandList graphics_command_list, void* resource, D3D12_DISCARD_REGION* region) { graphics_command_list->lpVtbl->DiscardResource( graphics_command_list, (ID3D12Resource*)resource, region); } -static inline void D3D12BeginQuery( +static INLINE void D3D12BeginQuery( D3D12GraphicsCommandList graphics_command_list, D3D12QueryHeap query_heap, D3D12_QUERY_TYPE type, @@ -541,7 +543,7 @@ static inline void D3D12BeginQuery( { graphics_command_list->lpVtbl->BeginQuery(graphics_command_list, query_heap, type, index); } -static inline void D3D12EndQuery( +static INLINE void D3D12EndQuery( D3D12GraphicsCommandList graphics_command_list, D3D12QueryHeap query_heap, D3D12_QUERY_TYPE type, @@ -549,7 +551,7 @@ static inline void D3D12EndQuery( { graphics_command_list->lpVtbl->EndQuery(graphics_command_list, query_heap, type, index); } -static inline void D3D12ResolveQueryData( +static INLINE void D3D12ResolveQueryData( D3D12GraphicsCommandList graphics_command_list, D3D12QueryHeap query_heap, D3D12_QUERY_TYPE type, @@ -562,7 +564,7 @@ static inline void D3D12ResolveQueryData( graphics_command_list, query_heap, type, start_index, num_queries, (ID3D12Resource*)destination_buffer, aligned_destination_buffer_offset); } -static inline void D3D12SetPredication( +static INLINE void D3D12SetPredication( D3D12GraphicsCommandList graphics_command_list, void* buffer, UINT64 aligned_buffer_offset, @@ -571,21 +573,21 @@ static inline void D3D12SetPredication( graphics_command_list->lpVtbl->SetPredication( graphics_command_list, (ID3D12Resource*)buffer, aligned_buffer_offset, operation); } -static inline void D3D12SetGraphicsCommandListMarker( +static INLINE void D3D12SetGraphicsCommandListMarker( D3D12GraphicsCommandList graphics_command_list, UINT metadata, void* data, UINT size) { graphics_command_list->lpVtbl->SetMarker(graphics_command_list, metadata, data, size); } -static inline void D3D12BeginGraphicsCommandListEvent( +static INLINE void D3D12BeginGraphicsCommandListEvent( D3D12GraphicsCommandList graphics_command_list, UINT metadata, void* data, UINT size) { graphics_command_list->lpVtbl->BeginEvent(graphics_command_list, metadata, data, size); } -static inline void D3D12EndGraphicsCommandListEvent(D3D12GraphicsCommandList graphics_command_list) +static INLINE void D3D12EndGraphicsCommandListEvent(D3D12GraphicsCommandList graphics_command_list) { graphics_command_list->lpVtbl->EndEvent(graphics_command_list); } -static inline void D3D12ExecuteIndirect( +static INLINE void D3D12ExecuteIndirect( D3D12GraphicsCommandList graphics_command_list, D3D12CommandSignature command_signature, UINT max_command_count, @@ -599,11 +601,11 @@ static inline void D3D12ExecuteIndirect( (ID3D12Resource*)argument_buffer, argument_buffer_offset, (ID3D12Resource*)count_buffer, count_buffer_offset); } -static inline ULONG D3D12ReleaseCommandQueue(D3D12CommandQueue command_queue) +static INLINE ULONG D3D12ReleaseCommandQueue(D3D12CommandQueue command_queue) { return command_queue->lpVtbl->Release(command_queue); } -static inline void D3D12UpdateTileMappings( +static INLINE void D3D12UpdateTileMappings( D3D12CommandQueue command_queue, void* resource, UINT num_resource_regions, @@ -621,7 +623,7 @@ static inline void D3D12UpdateTileMappings( resource_region_start_coordinates, resource_region_sizes, heap, num_ranges, range_flags, heap_range_start_offsets, range_tile_counts, flags); } -static inline void D3D12CopyTileMappings( +static INLINE void D3D12CopyTileMappings( D3D12CommandQueue command_queue, void* dst_resource, D3D12_TILED_RESOURCE_COORDINATE* dst_region_start_coordinate, @@ -634,71 +636,71 @@ static inline void D3D12CopyTileMappings( command_queue, (ID3D12Resource*)dst_resource, dst_region_start_coordinate, (ID3D12Resource*)src_resource, src_region_start_coordinate, region_size, flags); } -static inline void +static INLINE void D3D12SetCommandQueueMarker(D3D12CommandQueue command_queue, UINT metadata, void* data, UINT size) { command_queue->lpVtbl->SetMarker(command_queue, metadata, data, size); } -static inline void +static INLINE void D3D12BeginCommandQueueEvent(D3D12CommandQueue command_queue, UINT metadata, void* data, UINT size) { command_queue->lpVtbl->BeginEvent(command_queue, metadata, data, size); } -static inline void D3D12EndCommandQueueEvent(D3D12CommandQueue command_queue) +static INLINE void D3D12EndCommandQueueEvent(D3D12CommandQueue command_queue) { command_queue->lpVtbl->EndEvent(command_queue); } -static inline HRESULT +static INLINE HRESULT D3D12SignalCommandQueue(D3D12CommandQueue command_queue, D3D12Fence fence, UINT64 value) { return command_queue->lpVtbl->Signal(command_queue, fence, value); } -static inline HRESULT D3D12Wait(D3D12CommandQueue command_queue, D3D12Fence fence, UINT64 value) +static INLINE HRESULT D3D12Wait(D3D12CommandQueue command_queue, D3D12Fence fence, UINT64 value) { return command_queue->lpVtbl->Wait(command_queue, fence, value); } -static inline HRESULT D3D12GetTimestampFrequency(D3D12CommandQueue command_queue, UINT64* frequency) +static INLINE HRESULT D3D12GetTimestampFrequency(D3D12CommandQueue command_queue, UINT64* frequency) { return command_queue->lpVtbl->GetTimestampFrequency(command_queue, frequency); } -static inline HRESULT D3D12GetClockCalibration( +static INLINE HRESULT D3D12GetClockCalibration( D3D12CommandQueue command_queue, UINT64* gpu_timestamp, UINT64* cpu_timestamp) { return command_queue->lpVtbl->GetClockCalibration(command_queue, gpu_timestamp, cpu_timestamp); } -static inline ULONG D3D12ReleaseDevice(D3D12Device device) +static INLINE ULONG D3D12ReleaseDevice(D3D12Device device) { return device->lpVtbl->Release(device); } -static inline UINT D3D12GetNodeCount(D3D12Device device) +static INLINE UINT D3D12GetNodeCount(D3D12Device device) { return device->lpVtbl->GetNodeCount(device); } -static inline HRESULT D3D12CreateCommandQueue( +static INLINE HRESULT D3D12CreateCommandQueue( D3D12Device device, D3D12_COMMAND_QUEUE_DESC* desc, ID3D12CommandQueue** out) { return device->lpVtbl->CreateCommandQueue( device, desc, __uuidof(ID3D12CommandQueue), (void**)out); } -static inline HRESULT D3D12CreateCommandAllocator( +static INLINE HRESULT D3D12CreateCommandAllocator( D3D12Device device, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator** out) { return device->lpVtbl->CreateCommandAllocator( device, type, __uuidof(ID3D12CommandAllocator), (void**)out); } -static inline HRESULT D3D12CreateGraphicsPipelineState( +static INLINE HRESULT D3D12CreateGraphicsPipelineState( D3D12Device device, D3D12_GRAPHICS_PIPELINE_STATE_DESC* desc, ID3D12PipelineState** out) { return device->lpVtbl->CreateGraphicsPipelineState( device, desc, __uuidof(ID3D12PipelineState), (void**)out); } -static inline HRESULT D3D12CreateComputePipelineState( +static INLINE HRESULT D3D12CreateComputePipelineState( D3D12Device device, D3D12_COMPUTE_PIPELINE_STATE_DESC* desc, ID3D12PipelineState** out) { return device->lpVtbl->CreateComputePipelineState( device, desc, __uuidof(ID3D12PipelineState), (void**)out); } -static inline HRESULT D3D12CreateCommandList( +static INLINE HRESULT D3D12CreateCommandList( D3D12Device device, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, @@ -710,7 +712,7 @@ static inline HRESULT D3D12CreateCommandList( device, node_mask, type, command_allocator, initial_state, __uuidof(ID3D12CommandList), (void**)out); } -static inline HRESULT D3D12CheckFeatureSupport( +static INLINE HRESULT D3D12CheckFeatureSupport( D3D12Device device, D3D12_FEATURE feature, void* feature_support_data, @@ -719,7 +721,7 @@ static inline HRESULT D3D12CheckFeatureSupport( return device->lpVtbl->CheckFeatureSupport( device, feature, feature_support_data, feature_support_data_size); } -static inline HRESULT D3D12CreateDescriptorHeap( +static INLINE HRESULT D3D12CreateDescriptorHeap( D3D12Device device, D3D12_DESCRIPTOR_HEAP_DESC* descriptor_heap_desc, D3D12DescriptorHeap* out) @@ -727,12 +729,12 @@ static inline HRESULT D3D12CreateDescriptorHeap( return device->lpVtbl->CreateDescriptorHeap( device, descriptor_heap_desc, __uuidof(ID3D12DescriptorHeap), (void**)out); } -static inline UINT D3D12GetDescriptorHandleIncrementSize( +static INLINE UINT D3D12GetDescriptorHandleIncrementSize( D3D12Device device, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { return device->lpVtbl->GetDescriptorHandleIncrementSize(device, descriptor_heap_type); } -static inline HRESULT D3D12CreateRootSignature( +static INLINE HRESULT D3D12CreateRootSignature( D3D12Device device, UINT node_mask, void* blob_with_root_signature, @@ -743,14 +745,14 @@ static inline HRESULT D3D12CreateRootSignature( device, node_mask, blob_with_root_signature, blob_length_in_bytes, __uuidof(ID3D12RootSignature), (void**)out); } -static inline void D3D12CreateConstantBufferView( +static INLINE void D3D12CreateConstantBufferView( D3D12Device device, D3D12_CONSTANT_BUFFER_VIEW_DESC* desc, D3D12_CPU_DESCRIPTOR_HANDLE dest_descriptor) { device->lpVtbl->CreateConstantBufferView(device, desc, dest_descriptor); } -static inline void D3D12CreateShaderResourceView( +static INLINE void D3D12CreateShaderResourceView( D3D12Device device, D3D12Resource resource, D3D12_SHADER_RESOURCE_VIEW_DESC* desc, @@ -758,7 +760,7 @@ static inline void D3D12CreateShaderResourceView( { device->lpVtbl->CreateShaderResourceView(device, resource, desc, dest_descriptor); } -static inline void D3D12CreateUnorderedAccessView( +static INLINE void D3D12CreateUnorderedAccessView( D3D12Device device, void* resource, void* counter_resource, @@ -769,7 +771,7 @@ static inline void D3D12CreateUnorderedAccessView( device, (ID3D12Resource*)resource, (ID3D12Resource*)counter_resource, desc, dest_descriptor); } -static inline void D3D12CreateRenderTargetView( +static INLINE void D3D12CreateRenderTargetView( D3D12Device device, void* resource, D3D12_RENDER_TARGET_VIEW_DESC* desc, @@ -777,7 +779,7 @@ static inline void D3D12CreateRenderTargetView( { device->lpVtbl->CreateRenderTargetView(device, (ID3D12Resource*)resource, desc, dest_descriptor); } -static inline void D3D12CreateDepthStencilView( +static INLINE void D3D12CreateDepthStencilView( D3D12Device device, void* resource, D3D12_DEPTH_STENCIL_VIEW_DESC* desc, @@ -785,12 +787,12 @@ static inline void D3D12CreateDepthStencilView( { device->lpVtbl->CreateDepthStencilView(device, (ID3D12Resource*)resource, desc, dest_descriptor); } -static inline void D3D12CreateSampler( +static INLINE void D3D12CreateSampler( D3D12Device device, D3D12_SAMPLER_DESC* desc, D3D12_CPU_DESCRIPTOR_HANDLE dest_descriptor) { device->lpVtbl->CreateSampler(device, desc, dest_descriptor); } -static inline void D3D12CopyDescriptors( +static INLINE void D3D12CopyDescriptors( D3D12Device device, UINT num_dest_descriptor_ranges, D3D12_CPU_DESCRIPTOR_HANDLE* dest_descriptor_range_starts, @@ -805,7 +807,7 @@ static inline void D3D12CopyDescriptors( dest_descriptor_range_sizes, num_src_descriptor_ranges, src_descriptor_range_starts, src_descriptor_range_sizes, descriptor_heaps_type); } -static inline void D3D12CopyDescriptorsSimple( +static INLINE void D3D12CopyDescriptorsSimple( D3D12Device device, UINT num_descriptors, D3D12_CPU_DESCRIPTOR_HANDLE dest_descriptor_range_start, @@ -816,7 +818,7 @@ static inline void D3D12CopyDescriptorsSimple( device, num_descriptors, dest_descriptor_range_start, src_descriptor_range_start, descriptor_heaps_type); } -static inline D3D12_RESOURCE_ALLOCATION_INFO D3D12GetResourceAllocationInfo( +static INLINE D3D12_RESOURCE_ALLOCATION_INFO D3D12GetResourceAllocationInfo( D3D12Device device, UINT visible_mask, UINT num_resource_descs, @@ -825,12 +827,12 @@ static inline D3D12_RESOURCE_ALLOCATION_INFO D3D12GetResourceAllocationInfo( return device->lpVtbl->GetResourceAllocationInfo( device, visible_mask, num_resource_descs, resource_descs); } -static inline D3D12_HEAP_PROPERTIES +static INLINE D3D12_HEAP_PROPERTIES D3D12GetCustomHeapProperties(D3D12Device device, UINT node_mask, D3D12_HEAP_TYPE heap_type) { return device->lpVtbl->GetCustomHeapProperties(device, node_mask, heap_type); } -static inline HRESULT D3D12CreateCommittedResource( +static INLINE HRESULT D3D12CreateCommittedResource( D3D12Device device, D3D12_HEAP_PROPERTIES* heap_properties, D3D12_HEAP_FLAGS heap_flags, @@ -843,11 +845,11 @@ static inline HRESULT D3D12CreateCommittedResource( device, heap_properties, heap_flags, desc, initial_resource_state, optimized_clear_value, __uuidof(ID3D12Resource), (void**)out); } -static inline HRESULT D3D12CreateHeap(D3D12Device device, D3D12_HEAP_DESC* desc, ID3D12Heap** out) +static INLINE HRESULT D3D12CreateHeap(D3D12Device device, D3D12_HEAP_DESC* desc, ID3D12Heap** out) { return device->lpVtbl->CreateHeap(device, desc, __uuidof(ID3D12Heap), (void**)out); } -static inline HRESULT D3D12CreatePlacedResource( +static INLINE HRESULT D3D12CreatePlacedResource( D3D12Device device, D3D12Heap heap, UINT64 heap_offset, @@ -860,7 +862,7 @@ static inline HRESULT D3D12CreatePlacedResource( device, heap, heap_offset, desc, initial_state, optimized_clear_value, __uuidof(ID3D12Resource), (void**)out); } -static inline HRESULT D3D12CreateReservedResource( +static INLINE HRESULT D3D12CreateReservedResource( D3D12Device device, D3D12_RESOURCE_DESC* desc, D3D12_RESOURCE_STATES initial_state, @@ -870,17 +872,17 @@ static inline HRESULT D3D12CreateReservedResource( return device->lpVtbl->CreateReservedResource( device, desc, initial_state, optimized_clear_value, __uuidof(ID3D12Resource), (void**)out); } -static inline HRESULT D3D12CreateFence( +static INLINE HRESULT D3D12CreateFence( D3D12Device device, UINT64 initial_value, D3D12_FENCE_FLAGS flags, ID3D12Fence** out) { return device->lpVtbl->CreateFence( device, initial_value, flags, __uuidof(ID3D12Fence), (void**)out); } -static inline HRESULT D3D12GetDeviceRemovedReason(D3D12Device device) +static INLINE HRESULT D3D12GetDeviceRemovedReason(D3D12Device device) { return device->lpVtbl->GetDeviceRemovedReason(device); } -static inline void D3D12GetCopyableFootprints( +static INLINE void D3D12GetCopyableFootprints( D3D12Device device, D3D12_RESOURCE_DESC* resource_desc, UINT first_subresource, @@ -895,16 +897,16 @@ static inline void D3D12GetCopyableFootprints( device, resource_desc, first_subresource, num_subresources, base_offset, layouts, num_rows, row_size_in_bytes, total_bytes); } -static inline HRESULT +static INLINE HRESULT D3D12CreateQueryHeap(D3D12Device device, D3D12_QUERY_HEAP_DESC* desc, ID3D12Heap** out) { return device->lpVtbl->CreateQueryHeap(device, desc, __uuidof(ID3D12Heap), (void**)out); } -static inline HRESULT D3D12SetStablePowerState(D3D12Device device, BOOL enable) +static INLINE HRESULT D3D12SetStablePowerState(D3D12Device device, BOOL enable) { return device->lpVtbl->SetStablePowerState(device, enable); } -static inline HRESULT D3D12CreateCommandSignature( +static INLINE HRESULT D3D12CreateCommandSignature( D3D12Device device, D3D12_COMMAND_SIGNATURE_DESC* desc, D3D12RootSignature root_signature, @@ -913,7 +915,7 @@ static inline HRESULT D3D12CreateCommandSignature( return device->lpVtbl->CreateCommandSignature( device, desc, root_signature, __uuidof(ID3D12CommandSignature), (void**)out); } -static inline void D3D12GetResourceTiling( +static INLINE void D3D12GetResourceTiling( D3D12Device device, void* tiled_resource, UINT* num_tiles_for_entire_resource, @@ -928,20 +930,20 @@ static inline void D3D12GetResourceTiling( standard_tile_shape_for_non_packed_mips, num_subresource_tilings, first_subresource_tiling_to_get, subresource_tilings_for_non_packed_mips); } -static inline LUID D3D12GetAdapterLuid(D3D12Device device) +static INLINE LUID D3D12GetAdapterLuid(D3D12Device device) { return device->lpVtbl->GetAdapterLuid(device); } -static inline ULONG D3D12ReleasePipelineLibrary(D3D12PipelineLibrary pipeline_library) +static INLINE ULONG D3D12ReleasePipelineLibrary(D3D12PipelineLibrary pipeline_library) { return pipeline_library->lpVtbl->Release(pipeline_library); } -static inline HRESULT +static INLINE HRESULT D3D12StorePipeline(D3D12PipelineLibrary pipeline_library, LPCWSTR name, D3D12PipelineState pipeline) { return pipeline_library->lpVtbl->StorePipeline(pipeline_library, name, pipeline); } -static inline HRESULT D3D12LoadGraphicsPipeline( +static INLINE HRESULT D3D12LoadGraphicsPipeline( D3D12PipelineLibrary pipeline_library, LPCWSTR name, D3D12_GRAPHICS_PIPELINE_STATE_DESC* desc, @@ -950,7 +952,7 @@ static inline HRESULT D3D12LoadGraphicsPipeline( return pipeline_library->lpVtbl->LoadGraphicsPipeline( pipeline_library, name, desc, __uuidof(ID3D12PipelineState), (void**)out); } -static inline HRESULT D3D12LoadComputePipeline( +static INLINE HRESULT D3D12LoadComputePipeline( D3D12PipelineLibrary pipeline_library, LPCWSTR name, D3D12_COMPUTE_PIPELINE_STATE_DESC* desc, @@ -959,82 +961,82 @@ static inline HRESULT D3D12LoadComputePipeline( return pipeline_library->lpVtbl->LoadComputePipeline( pipeline_library, name, desc, __uuidof(ID3D12PipelineState), (void**)out); } -static inline SIZE_T D3D12GetSerializedSize(D3D12PipelineLibrary pipeline_library) +static INLINE SIZE_T D3D12GetSerializedSize(D3D12PipelineLibrary pipeline_library) { return pipeline_library->lpVtbl->GetSerializedSize(pipeline_library); } -static inline HRESULT +static INLINE HRESULT D3D12Serialize(D3D12PipelineLibrary pipeline_library, void* data, SIZE_T data_size_in_bytes) { return pipeline_library->lpVtbl->Serialize(pipeline_library, data, data_size_in_bytes); } -static inline ULONG D3D12ReleaseDebug(D3D12Debug debug) { return debug->lpVtbl->Release(debug); } -static inline void D3D12EnableDebugLayer(D3D12Debug debug) +static INLINE ULONG D3D12ReleaseDebug(D3D12Debug debug) { return debug->lpVtbl->Release(debug); } +static INLINE void D3D12EnableDebugLayer(D3D12Debug debug) { debug->lpVtbl->EnableDebugLayer(debug); } -static inline ULONG D3D12ReleaseDebugDevice(D3D12DebugDevice debug_device) +static INLINE ULONG D3D12ReleaseDebugDevice(D3D12DebugDevice debug_device) { return debug_device->lpVtbl->Release(debug_device); } -static inline HRESULT +static INLINE HRESULT D3D12SetDebugDeviceFeatureMask(D3D12DebugDevice debug_device, D3D12_DEBUG_FEATURE mask) { return debug_device->lpVtbl->SetFeatureMask(debug_device, mask); } -static inline D3D12_DEBUG_FEATURE D3D12GetDebugDeviceFeatureMask(D3D12DebugDevice debug_device) +static INLINE D3D12_DEBUG_FEATURE D3D12GetDebugDeviceFeatureMask(D3D12DebugDevice debug_device) { return debug_device->lpVtbl->GetFeatureMask(debug_device); } -static inline HRESULT +static INLINE HRESULT D3D12ReportLiveDeviceObjects(D3D12DebugDevice debug_device, D3D12_RLDO_FLAGS flags) { return debug_device->lpVtbl->ReportLiveDeviceObjects(debug_device, flags); } -static inline ULONG D3D12ReleaseDebugCommandQueue(D3D12DebugCommandQueue debug_command_queue) +static INLINE ULONG D3D12ReleaseDebugCommandQueue(D3D12DebugCommandQueue debug_command_queue) { return debug_command_queue->lpVtbl->Release(debug_command_queue); } -static inline BOOL D3D12AssertDebugCommandQueueResourceState( +static INLINE BOOL D3D12AssertDebugCommandQueueResourceState( D3D12DebugCommandQueue debug_command_queue, void* resource, UINT subresource, UINT state) { return debug_command_queue->lpVtbl->AssertResourceState( debug_command_queue, (ID3D12Resource*)resource, subresource, state); } -static inline ULONG D3D12ReleaseDebugCommandList(D3D12DebugCommandList debug_command_list) +static INLINE ULONG D3D12ReleaseDebugCommandList(D3D12DebugCommandList debug_command_list) { return debug_command_list->lpVtbl->Release(debug_command_list); } -static inline BOOL D3D12AssertDebugCommandListResourceState( +static INLINE BOOL D3D12AssertDebugCommandListResourceState( D3D12DebugCommandList debug_command_list, void* resource, UINT subresource, UINT state) { return debug_command_list->lpVtbl->AssertResourceState( debug_command_list, (ID3D12Resource*)resource, subresource, state); } -static inline HRESULT D3D12SetDebugCommandListFeatureMask( +static INLINE HRESULT D3D12SetDebugCommandListFeatureMask( D3D12DebugCommandList debug_command_list, D3D12_DEBUG_FEATURE mask) { return debug_command_list->lpVtbl->SetFeatureMask(debug_command_list, mask); } -static inline D3D12_DEBUG_FEATURE +static INLINE D3D12_DEBUG_FEATURE D3D12GetDebugCommandListFeatureMask(D3D12DebugCommandList debug_command_list) { return debug_command_list->lpVtbl->GetFeatureMask(debug_command_list); } -static inline ULONG D3D12ReleaseInfoQueue(D3D12InfoQueue info_queue) +static INLINE ULONG D3D12ReleaseInfoQueue(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->Release(info_queue); } -static inline HRESULT +static INLINE HRESULT D3D12SetMessageCountLimit(D3D12InfoQueue info_queue, UINT64 message_count_limit) { return info_queue->lpVtbl->SetMessageCountLimit(info_queue, message_count_limit); } -static inline void D3D12ClearStoredMessages(D3D12InfoQueue info_queue) +static INLINE void D3D12ClearStoredMessages(D3D12InfoQueue info_queue) { info_queue->lpVtbl->ClearStoredMessages(info_queue); } -static inline HRESULT D3D12GetMessageA( +static INLINE HRESULT D3D12GetMessageA( D3D12InfoQueue info_queue, UINT64 message_index, D3D12_MESSAGE* message, @@ -1042,101 +1044,101 @@ static inline HRESULT D3D12GetMessageA( { return info_queue->lpVtbl->GetMessageA(info_queue, message_index, message, message_byte_length); } -static inline UINT64 D3D12GetNumMessagesAllowedByStorageFilter(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetNumMessagesAllowedByStorageFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetNumMessagesAllowedByStorageFilter(info_queue); } -static inline UINT64 D3D12GetNumMessagesDeniedByStorageFilter(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetNumMessagesDeniedByStorageFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetNumMessagesDeniedByStorageFilter(info_queue); } -static inline UINT64 D3D12GetNumStoredMessages(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetNumStoredMessages(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetNumStoredMessages(info_queue); } -static inline UINT64 D3D12GetNumStoredMessagesAllowedByRetrievalFilter(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetNumStoredMessagesAllowedByRetrievalFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetNumStoredMessagesAllowedByRetrievalFilter(info_queue); } -static inline UINT64 D3D12GetNumMessagesDiscardedByMessageCountLimit(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetNumMessagesDiscardedByMessageCountLimit(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetNumMessagesDiscardedByMessageCountLimit(info_queue); } -static inline UINT64 D3D12GetMessageCountLimit(D3D12InfoQueue info_queue) +static INLINE UINT64 D3D12GetMessageCountLimit(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetMessageCountLimit(info_queue); } -static inline HRESULT +static INLINE HRESULT D3D12AddStorageFilterEntries(D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter) { return info_queue->lpVtbl->AddStorageFilterEntries(info_queue, filter); } -static inline HRESULT D3D12GetStorageFilter( +static INLINE HRESULT D3D12GetStorageFilter( D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter, SIZE_T* filter_byte_length) { return info_queue->lpVtbl->GetStorageFilter(info_queue, filter, filter_byte_length); } -static inline void D3D12ClearStorageFilter(D3D12InfoQueue info_queue) +static INLINE void D3D12ClearStorageFilter(D3D12InfoQueue info_queue) { info_queue->lpVtbl->ClearStorageFilter(info_queue); } -static inline HRESULT D3D12PushEmptyStorageFilter(D3D12InfoQueue info_queue) +static INLINE HRESULT D3D12PushEmptyStorageFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->PushEmptyStorageFilter(info_queue); } -static inline HRESULT D3D12PushCopyOfStorageFilter(D3D12InfoQueue info_queue) +static INLINE HRESULT D3D12PushCopyOfStorageFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->PushCopyOfStorageFilter(info_queue); } -static inline HRESULT +static INLINE HRESULT D3D12PushStorageFilter(D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter) { return info_queue->lpVtbl->PushStorageFilter(info_queue, filter); } -static inline void D3D12PopStorageFilter(D3D12InfoQueue info_queue) +static INLINE void D3D12PopStorageFilter(D3D12InfoQueue info_queue) { info_queue->lpVtbl->PopStorageFilter(info_queue); } -static inline UINT D3D12GetStorageFilterStackSize(D3D12InfoQueue info_queue) +static INLINE UINT D3D12GetStorageFilterStackSize(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetStorageFilterStackSize(info_queue); } -static inline HRESULT +static INLINE HRESULT D3D12AddRetrievalFilterEntries(D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter) { return info_queue->lpVtbl->AddRetrievalFilterEntries(info_queue, filter); } -static inline HRESULT D3D12GetRetrievalFilter( +static INLINE HRESULT D3D12GetRetrievalFilter( D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter, SIZE_T* filter_byte_length) { return info_queue->lpVtbl->GetRetrievalFilter(info_queue, filter, filter_byte_length); } -static inline void D3D12ClearRetrievalFilter(D3D12InfoQueue info_queue) +static INLINE void D3D12ClearRetrievalFilter(D3D12InfoQueue info_queue) { info_queue->lpVtbl->ClearRetrievalFilter(info_queue); } -static inline HRESULT D3D12PushEmptyRetrievalFilter(D3D12InfoQueue info_queue) +static INLINE HRESULT D3D12PushEmptyRetrievalFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->PushEmptyRetrievalFilter(info_queue); } -static inline HRESULT D3D12PushCopyOfRetrievalFilter(D3D12InfoQueue info_queue) +static INLINE HRESULT D3D12PushCopyOfRetrievalFilter(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->PushCopyOfRetrievalFilter(info_queue); } -static inline HRESULT +static INLINE HRESULT D3D12PushRetrievalFilter(D3D12InfoQueue info_queue, D3D12_INFO_QUEUE_FILTER* filter) { return info_queue->lpVtbl->PushRetrievalFilter(info_queue, filter); } -static inline void D3D12PopRetrievalFilter(D3D12InfoQueue info_queue) +static INLINE void D3D12PopRetrievalFilter(D3D12InfoQueue info_queue) { info_queue->lpVtbl->PopRetrievalFilter(info_queue); } -static inline UINT D3D12GetRetrievalFilterStackSize(D3D12InfoQueue info_queue) +static INLINE UINT D3D12GetRetrievalFilterStackSize(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetRetrievalFilterStackSize(info_queue); } -static inline HRESULT D3D12AddMessage( +static INLINE HRESULT D3D12AddMessage( D3D12InfoQueue info_queue, D3D12_MESSAGE_CATEGORY category, D3D12_MESSAGE_SEVERITY severity, @@ -1145,64 +1147,64 @@ static inline HRESULT D3D12AddMessage( { return info_queue->lpVtbl->AddMessage(info_queue, category, severity, i_d, description); } -static inline HRESULT D3D12AddApplicationMessage( +static INLINE HRESULT D3D12AddApplicationMessage( D3D12InfoQueue info_queue, D3D12_MESSAGE_SEVERITY severity, LPCSTR description) { return info_queue->lpVtbl->AddApplicationMessage(info_queue, severity, description); } -static inline HRESULT +static INLINE HRESULT D3D12SetBreakOnCategory(D3D12InfoQueue info_queue, D3D12_MESSAGE_CATEGORY category, BOOL b_enable) { return info_queue->lpVtbl->SetBreakOnCategory(info_queue, category, b_enable); } -static inline HRESULT +static INLINE HRESULT D3D12SetBreakOnSeverity(D3D12InfoQueue info_queue, D3D12_MESSAGE_SEVERITY severity, BOOL b_enable) { return info_queue->lpVtbl->SetBreakOnSeverity(info_queue, severity, b_enable); } -static inline HRESULT +static INLINE HRESULT D3D12SetBreakOnID(D3D12InfoQueue info_queue, D3D12_MESSAGE_ID i_d, BOOL b_enable) { return info_queue->lpVtbl->SetBreakOnID(info_queue, i_d, b_enable); } -static inline BOOL +static INLINE BOOL D3D12GetBreakOnCategory(D3D12InfoQueue info_queue, D3D12_MESSAGE_CATEGORY category) { return info_queue->lpVtbl->GetBreakOnCategory(info_queue, category); } -static inline BOOL +static INLINE BOOL D3D12GetBreakOnSeverity(D3D12InfoQueue info_queue, D3D12_MESSAGE_SEVERITY severity) { return info_queue->lpVtbl->GetBreakOnSeverity(info_queue, severity); } -static inline BOOL D3D12GetBreakOnID(D3D12InfoQueue info_queue, D3D12_MESSAGE_ID i_d) +static INLINE BOOL D3D12GetBreakOnID(D3D12InfoQueue info_queue, D3D12_MESSAGE_ID i_d) { return info_queue->lpVtbl->GetBreakOnID(info_queue, i_d); } -static inline void D3D12SetMuteDebugOutput(D3D12InfoQueue info_queue, BOOL b_mute) +static INLINE void D3D12SetMuteDebugOutput(D3D12InfoQueue info_queue, BOOL b_mute) { info_queue->lpVtbl->SetMuteDebugOutput(info_queue, b_mute); } -static inline BOOL D3D12GetMuteDebugOutput(D3D12InfoQueue info_queue) +static INLINE BOOL D3D12GetMuteDebugOutput(D3D12InfoQueue info_queue) { return info_queue->lpVtbl->GetMuteDebugOutput(info_queue); } /* end of auto-generated */ -static inline HRESULT D3D12GetDebugInterface_(D3D12Debug* out) +static INLINE HRESULT D3D12GetDebugInterface_(D3D12Debug* out) { return D3D12GetDebugInterface(__uuidof(ID3D12Debug), (void**)out); } -static inline HRESULT +static INLINE HRESULT D3D12CreateDevice_(DXGIAdapter adapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, D3D12Device* out) { return D3D12CreateDevice( (IUnknown*)adapter, MinimumFeatureLevel, __uuidof(ID3D12Device), (void**)out); } -static inline HRESULT D3D12CreateGraphicsCommandList( +static INLINE HRESULT D3D12CreateGraphicsCommandList( D3D12Device device, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, @@ -1215,7 +1217,7 @@ static inline HRESULT D3D12CreateGraphicsCommandList( __uuidof(ID3D12GraphicsCommandList), (void**)out); } -static inline void D3D12ClearRenderTargetView( +static INLINE void D3D12ClearRenderTargetView( D3D12GraphicsCommandList command_list, D3D12_CPU_DESCRIPTOR_HANDLE render_target_view, const FLOAT colorRGBA[4], @@ -1226,14 +1228,14 @@ static inline void D3D12ClearRenderTargetView( command_list, render_target_view, colorRGBA, num_rects, rects); } -static inline void D3D12ExecuteCommandLists( +static INLINE void D3D12ExecuteCommandLists( D3D12CommandQueue command_queue, UINT num_command_lists, const D3D12CommandList* command_lists) { command_queue->lpVtbl->ExecuteCommandLists(command_queue, num_command_lists, command_lists); } -static inline void D3D12ExecuteGraphicsCommandLists( +static INLINE void D3D12ExecuteGraphicsCommandLists( D3D12CommandQueue command_queue, UINT num_command_lists, const D3D12GraphicsCommandList* command_lists) @@ -1242,13 +1244,13 @@ static inline void D3D12ExecuteGraphicsCommandLists( command_queue, num_command_lists, (ID3D12CommandList* const*)command_lists); } -static inline HRESULT +static INLINE HRESULT DXGIGetSwapChainBuffer(DXGISwapChain swapchain, UINT buffer, D3D12Resource* surface) { return swapchain->lpVtbl->GetBuffer( swapchain, buffer, __uuidof(ID3D12Resource), (void**)surface); } -static inline void D3D12SetDescriptorHeaps( +static INLINE void D3D12SetDescriptorHeaps( D3D12GraphicsCommandList command_list, UINT num_descriptor_heaps, const D3D12DescriptorHeap* descriptor_heaps) @@ -1256,18 +1258,18 @@ static inline void D3D12SetDescriptorHeaps( command_list->lpVtbl->SetDescriptorHeaps(command_list, num_descriptor_heaps, descriptor_heaps); } #if 0 /* function prototype is wrong ... */ -static inline D3D12_CPU_DESCRIPTOR_HANDLE D3D12GetCPUDescriptorHandleForHeapStart( +static INLINE D3D12_CPU_DESCRIPTOR_HANDLE D3D12GetCPUDescriptorHandleForHeapStart( D3D12DescriptorHeap descriptor_heap) { return descriptor_heap->lpVtbl->GetCPUDescriptorHandleForHeapStart(descriptor_heap); } -static inline D3D12_GPU_DESCRIPTOR_HANDLE D3D12GetGPUDescriptorHandleForHeapStart( +static INLINE D3D12_GPU_DESCRIPTOR_HANDLE D3D12GetGPUDescriptorHandleForHeapStart( D3D12DescriptorHeap descriptor_heap) { return descriptor_heap->lpVtbl->GetGPUDescriptorHandleForHeapStart(descriptor_heap); } #else -static inline D3D12_CPU_DESCRIPTOR_HANDLE +static INLINE D3D12_CPU_DESCRIPTOR_HANDLE D3D12GetCPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap) { D3D12_CPU_DESCRIPTOR_HANDLE out; @@ -1275,7 +1277,7 @@ D3D12GetCPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap) descriptor_heap->lpVtbl->GetCPUDescriptorHandleForHeapStart)(descriptor_heap, &out); return out; } -static inline D3D12_GPU_DESCRIPTOR_HANDLE +static INLINE D3D12_GPU_DESCRIPTOR_HANDLE D3D12GetGPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap) { D3D12_GPU_DESCRIPTOR_HANDLE out; @@ -1289,7 +1291,8 @@ D3D12GetGPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap) #include #include -#include "gfx/video_driver.h" + +#include "../video_driver.h" typedef struct d3d12_vertex_t { @@ -1439,35 +1442,34 @@ void d3d12_upload_texture(D3D12GraphicsCommandList cmd, d3d12_texture_t* texture void d3d12_create_fullscreen_quad_vbo( D3D12Device device, D3D12_VERTEX_BUFFER_VIEW* view, D3D12Resource* vbo); -static inline void d3d12_resource_transition( +static INLINE void d3d12_resource_transition( D3D12GraphicsCommandList cmd, D3D12Resource resource, D3D12_RESOURCE_STATES state_before, D3D12_RESOURCE_STATES state_after) { - D3D12_RESOURCE_BARRIER barrier = { - .Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION, - .Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE, - .Transition.pResource = resource, - .Transition.StateBefore = state_before, - .Transition.StateAfter = state_after, - .Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, - }; + D3D12_RESOURCE_BARRIER barrier = { 0 }; + barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; + barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; + barrier.Transition.pResource = resource; + barrier.Transition.StateBefore = state_before; + barrier.Transition.StateAfter = state_after; + barrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES; D3D12ResourceBarrier(cmd, 1, &barrier); } -static inline void d3d12_set_texture(D3D12GraphicsCommandList cmd, const d3d12_texture_t* texture) +static INLINE void d3d12_set_texture(D3D12GraphicsCommandList cmd, const d3d12_texture_t* texture) { D3D12SetGraphicsRootDescriptorTable(cmd, ROOT_INDEX_TEXTURE_TABLE, texture->gpu_descriptor); } -static inline void +static INLINE void d3d12_set_sampler(D3D12GraphicsCommandList cmd, D3D12_GPU_DESCRIPTOR_HANDLE sampler) { D3D12SetGraphicsRootDescriptorTable(cmd, ROOT_INDEX_SAMPLER_TABLE, sampler); } -static inline void d3d12_update_texture( +static INLINE void d3d12_update_texture( int width, int height, int pitch, @@ -1492,7 +1494,7 @@ static inline void d3d12_update_texture( DXGI_FORMAT d3d12_get_closest_match( D3D12Device device, DXGI_FORMAT desired_format, D3D12_FORMAT_SUPPORT1 desired_format_support); -static inline DXGI_FORMAT +static INLINE DXGI_FORMAT d3d12_get_closest_match_texture2D(D3D12Device device, DXGI_FORMAT desired_format) { return d3d12_get_closest_match( diff --git a/gfx/common/d3dcompiler_common.c b/gfx/common/d3dcompiler_common.c index 3e523468a6..98646496a9 100644 --- a/gfx/common/d3dcompiler_common.c +++ b/gfx/common/d3dcompiler_common.c @@ -14,6 +14,11 @@ */ #include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_DYNAMIC #include #endif diff --git a/gfx/common/d3dcompiler_common.h b/gfx/common/d3dcompiler_common.h index e2ba1bef46..dd5931db97 100644 --- a/gfx/common/d3dcompiler_common.h +++ b/gfx/common/d3dcompiler_common.h @@ -16,6 +16,7 @@ #pragma once #include +#include #ifdef __MINGW32__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index 608dc5a3bd..20b2d09fc8 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -16,14 +16,15 @@ #include #include -#include "driver.h" -#include "verbosity.h" -#include "configuration.h" -#include "gfx/video_driver.h" -#include "gfx/common/win32_common.h" -#include "gfx/common/dxgi_common.h" -#include "gfx/common/d3d12_common.h" -#include "gfx/common/d3dcompiler_common.h" +#include "../video_driver.h" +#include "../common/win32_common.h" +#include "../common/dxgi_common.h" +#include "../common/d3d12_common.h" +#include "../common/d3dcompiler_common.h" + +#include "../../driver.h" +#include "../../verbosity.h" +#include "../../configuration.h" static void d3d12_set_filtering(void* data, unsigned index, bool smooth) {