mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
Move inline functions to files that actually need them,
move enums at the top of the header files
This commit is contained in:
parent
77466d6f85
commit
f08958dbc1
@ -29,6 +29,22 @@
|
||||
|
||||
#define D3D10_MAX_GPU_COUNT 16
|
||||
|
||||
enum d3d10_video_flags
|
||||
{
|
||||
D3D10_ST_FLAG_VSYNC = (1 << 0),
|
||||
D3D10_ST_FLAG_RESIZE_CHAIN = (1 << 1),
|
||||
D3D10_ST_FLAG_KEEP_ASPECT = (1 << 2),
|
||||
D3D10_ST_FLAG_RESIZE_VIEWPORT = (1 << 3),
|
||||
D3D10_ST_FLAG_RESIZE_RTS = (1 << 4), /* RT = Render Target */
|
||||
D3D10_ST_FLAG_INIT_HISTORY = (1 << 5),
|
||||
D3D10_ST_FLAG_SPRITES_ENABLE = (1 << 6),
|
||||
D3D10_ST_FLAG_OVERLAYS_ENABLE = (1 << 7),
|
||||
D3D10_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 8),
|
||||
D3D10_ST_FLAG_MENU_ENABLE = (1 << 9),
|
||||
D3D10_ST_FLAG_MENU_FULLSCREEN = (1 << 10)
|
||||
};
|
||||
|
||||
|
||||
typedef const ID3D10SamplerState* D3D10SamplerStateRef;
|
||||
|
||||
typedef ID3D10InputLayout* D3D10InputLayout;
|
||||
@ -126,21 +142,6 @@ typedef struct d3d10_shader_t
|
||||
D3D10InputLayout layout;
|
||||
} d3d10_shader_t;
|
||||
|
||||
enum d3d10_video_flags
|
||||
{
|
||||
D3D10_ST_FLAG_VSYNC = (1 << 0),
|
||||
D3D10_ST_FLAG_RESIZE_CHAIN = (1 << 1),
|
||||
D3D10_ST_FLAG_KEEP_ASPECT = (1 << 2),
|
||||
D3D10_ST_FLAG_RESIZE_VIEWPORT = (1 << 3),
|
||||
D3D10_ST_FLAG_RESIZE_RTS = (1 << 4), /* RT = Render Target */
|
||||
D3D10_ST_FLAG_INIT_HISTORY = (1 << 5),
|
||||
D3D10_ST_FLAG_SPRITES_ENABLE = (1 << 6),
|
||||
D3D10_ST_FLAG_OVERLAYS_ENABLE = (1 << 7),
|
||||
D3D10_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 8),
|
||||
D3D10_ST_FLAG_MENU_ENABLE = (1 << 9),
|
||||
D3D10_ST_FLAG_MENU_FULLSCREEN = (1 << 10)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned cur_mon_id;
|
||||
|
@ -34,6 +34,44 @@
|
||||
|
||||
#define D3D11_MAX_GPU_COUNT 16
|
||||
|
||||
enum d3d11_state_flags
|
||||
{
|
||||
D3D11_ST_FLAG_VSYNC = (1 << 0),
|
||||
D3D11_ST_FLAG_WAITABLE_SWAPCHAINS = (1 << 1),
|
||||
D3D11_ST_FLAG_WAIT_FOR_VBLANK = (1 << 2),
|
||||
D3D11_ST_FLAG_RESIZE_CHAIN = (1 << 3),
|
||||
D3D11_ST_FLAG_KEEP_ASPECT = (1 << 4),
|
||||
D3D11_ST_FLAG_RESIZE_VIEWPORT = (1 << 5),
|
||||
D3D11_ST_FLAG_RESIZE_RTS = (1 << 6), /* RT = Render Target */
|
||||
D3D11_ST_FLAG_INIT_HISTORY = (1 << 7),
|
||||
D3D11_ST_FLAG_HAS_FLIP_MODEL = (1 << 8),
|
||||
D3D11_ST_FLAG_HAS_ALLOW_TEARING = (1 << 9),
|
||||
D3D11_ST_FLAG_HW_IFACE_ENABLE = (1 << 10),
|
||||
D3D11_ST_FLAG_HDR_SUPPORT = (1 << 11),
|
||||
D3D11_ST_FLAG_HDR_ENABLE = (1 << 12),
|
||||
D3D11_ST_FLAG_SPRITES_ENABLE = (1 << 13),
|
||||
D3D11_ST_FLAG_OVERLAYS_ENABLE = (1 << 14),
|
||||
D3D11_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 15),
|
||||
D3D11_ST_FLAG_MENU_ENABLE = (1 << 16),
|
||||
D3D11_ST_FLAG_MENU_FULLSCREEN = (1 << 17)
|
||||
};
|
||||
|
||||
enum d3d11_feature_level_hint
|
||||
{
|
||||
D3D11_FEATURE_LEVEL_HINT_DONTCARE,
|
||||
D3D11_FEATURE_LEVEL_HINT_1_0_CORE,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_2,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_3,
|
||||
D3D11_FEATURE_LEVEL_HINT_10_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_10_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_11_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_11_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_2
|
||||
};
|
||||
|
||||
typedef const ID3D11ShaderResourceView* D3D11ShaderResourceViewRef;
|
||||
typedef const ID3D11SamplerState* D3D11SamplerStateRef;
|
||||
typedef const ID3D11BlendState* D3D11BlendStateRef;
|
||||
@ -88,23 +126,6 @@ typedef ID3D11SwitchToRef* D3D11SwitchToRef;
|
||||
typedef ID3D11TracingDevice* D3D11TracingDevice;
|
||||
typedef ID3D11InfoQueue* D3D11InfoQueue;
|
||||
|
||||
|
||||
enum d3d11_feature_level_hint
|
||||
{
|
||||
D3D11_FEATURE_LEVEL_HINT_DONTCARE,
|
||||
D3D11_FEATURE_LEVEL_HINT_1_0_CORE,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_2,
|
||||
D3D11_FEATURE_LEVEL_HINT_9_3,
|
||||
D3D11_FEATURE_LEVEL_HINT_10_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_10_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_11_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_11_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_0,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_1,
|
||||
D3D11_FEATURE_LEVEL_HINT_12_2
|
||||
};
|
||||
|
||||
typedef struct d3d11_vertex_t
|
||||
{
|
||||
float position[2];
|
||||
@ -168,28 +189,6 @@ typedef struct d3d11_shader_t
|
||||
D3D11InputLayout layout;
|
||||
} d3d11_shader_t;
|
||||
|
||||
enum d3d11_state_flags
|
||||
{
|
||||
D3D11_ST_FLAG_VSYNC = (1 << 0),
|
||||
D3D11_ST_FLAG_WAITABLE_SWAPCHAINS = (1 << 1),
|
||||
D3D11_ST_FLAG_WAIT_FOR_VBLANK = (1 << 2),
|
||||
D3D11_ST_FLAG_RESIZE_CHAIN = (1 << 3),
|
||||
D3D11_ST_FLAG_KEEP_ASPECT = (1 << 4),
|
||||
D3D11_ST_FLAG_RESIZE_VIEWPORT = (1 << 5),
|
||||
D3D11_ST_FLAG_RESIZE_RTS = (1 << 6), /* RT = Render Target */
|
||||
D3D11_ST_FLAG_INIT_HISTORY = (1 << 7),
|
||||
D3D11_ST_FLAG_HAS_FLIP_MODEL = (1 << 8),
|
||||
D3D11_ST_FLAG_HAS_ALLOW_TEARING = (1 << 9),
|
||||
D3D11_ST_FLAG_HW_IFACE_ENABLE = (1 << 10),
|
||||
D3D11_ST_FLAG_HDR_SUPPORT = (1 << 11),
|
||||
D3D11_ST_FLAG_HDR_ENABLE = (1 << 12),
|
||||
D3D11_ST_FLAG_SPRITES_ENABLE = (1 << 13),
|
||||
D3D11_ST_FLAG_OVERLAYS_ENABLE = (1 << 14),
|
||||
D3D11_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 15),
|
||||
D3D11_ST_FLAG_MENU_ENABLE = (1 << 16),
|
||||
D3D11_ST_FLAG_MENU_FULLSCREEN = (1 << 17)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned cur_mon_id;
|
||||
|
@ -140,6 +140,11 @@ HRESULT WINAPI D3D12SerializeVersionedRootSignature(
|
||||
}
|
||||
#endif
|
||||
|
||||
static INLINE D3D12_GPU_VIRTUAL_ADDRESS D3D12GetGPUVirtualAddress(void* resource)
|
||||
{
|
||||
return ((ID3D12Resource*)resource)->lpVtbl->GetGPUVirtualAddress((ID3D12Resource*)resource);
|
||||
}
|
||||
|
||||
D3D12_GPU_VIRTUAL_ADDRESS
|
||||
d3d12_create_buffer(D3D12Device device, UINT size_in_bytes, D3D12Resource* buffer)
|
||||
{
|
||||
|
@ -44,6 +44,45 @@
|
||||
cmd->lpVtbl->ResourceBarrier(cmd, 1, &_barrier); \
|
||||
}
|
||||
|
||||
enum d3d12_video_flags
|
||||
{
|
||||
D3D12_ST_FLAG_RESIZE_CHAIN = (1 << 0),
|
||||
D3D12_ST_FLAG_KEEP_ASPECT = (1 << 1),
|
||||
D3D12_ST_FLAG_RESIZE_VIEWPORT = (1 << 2),
|
||||
D3D12_ST_FLAG_RESIZE_RTS = (1 << 3),
|
||||
D3D12_ST_FLAG_INIT_HISTORY = (1 << 4),
|
||||
D3D12_ST_FLAG_OVERLAYS_ENABLE = (1 << 5),
|
||||
D3D12_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 6),
|
||||
D3D12_ST_FLAG_SPRITES_ENABLE = (1 << 7),
|
||||
D3D12_ST_FLAG_MENU_ENABLE = (1 << 8),
|
||||
D3D12_ST_FLAG_MENU_FULLSCREEN = (1 << 9),
|
||||
D3D12_ST_FLAG_HDR_SUPPORT = (1 << 10),
|
||||
D3D12_ST_FLAG_HDR_ENABLE = (1 << 11),
|
||||
D3D12_ST_FLAG_VSYNC = (1 << 12),
|
||||
D3D12_ST_FLAG_WAITABLE_SWAPCHAINS = (1 << 13),
|
||||
D3D12_ST_FLAG_WAIT_FOR_VBLANK = (1 << 14),
|
||||
D3D12_ST_FLAG_HW_IFACE_ENABLE = (1 << 15)
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ROOT_ID_TEXTURE_T = 0,
|
||||
ROOT_ID_SAMPLER_T,
|
||||
ROOT_ID_UBO,
|
||||
ROOT_ID_PC,
|
||||
ROOT_ID_MAX
|
||||
} root_signature_parameter_index_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CS_ROOT_ID_TEXTURE_T = 0,
|
||||
CS_ROOT_ID_UAV_T,
|
||||
CS_ROOT_ID_CONSTANTS,
|
||||
CS_ROOT_ID_MAX
|
||||
} compute_root_index_t;
|
||||
|
||||
|
||||
|
||||
typedef const ID3D12PipelineState* D3D12PipelineStateRef;
|
||||
|
||||
/* auto-generated */
|
||||
@ -152,26 +191,6 @@ typedef struct ALIGN(16)
|
||||
float time;
|
||||
} d3d12_uniform_t;
|
||||
|
||||
enum d3d12_video_flags
|
||||
{
|
||||
D3D12_ST_FLAG_RESIZE_CHAIN = (1 << 0),
|
||||
D3D12_ST_FLAG_KEEP_ASPECT = (1 << 1),
|
||||
D3D12_ST_FLAG_RESIZE_VIEWPORT = (1 << 2),
|
||||
D3D12_ST_FLAG_RESIZE_RTS = (1 << 3),
|
||||
D3D12_ST_FLAG_INIT_HISTORY = (1 << 4),
|
||||
D3D12_ST_FLAG_OVERLAYS_ENABLE = (1 << 5),
|
||||
D3D12_ST_FLAG_OVERLAYS_FULLSCREEN = (1 << 6),
|
||||
D3D12_ST_FLAG_SPRITES_ENABLE = (1 << 7),
|
||||
D3D12_ST_FLAG_MENU_ENABLE = (1 << 8),
|
||||
D3D12_ST_FLAG_MENU_FULLSCREEN = (1 << 9),
|
||||
D3D12_ST_FLAG_HDR_SUPPORT = (1 << 10),
|
||||
D3D12_ST_FLAG_HDR_ENABLE = (1 << 11),
|
||||
D3D12_ST_FLAG_VSYNC = (1 << 12),
|
||||
D3D12_ST_FLAG_WAITABLE_SWAPCHAINS = (1 << 13),
|
||||
D3D12_ST_FLAG_WAIT_FOR_VBLANK = (1 << 14),
|
||||
D3D12_ST_FLAG_HW_IFACE_ENABLE = (1 << 15)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned cur_mon_id;
|
||||
@ -335,23 +354,6 @@ typedef struct
|
||||
uint16_t flags;
|
||||
} d3d12_video_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ROOT_ID_TEXTURE_T = 0,
|
||||
ROOT_ID_SAMPLER_T,
|
||||
ROOT_ID_UBO,
|
||||
ROOT_ID_PC,
|
||||
ROOT_ID_MAX
|
||||
} root_signature_parameter_index_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CS_ROOT_ID_TEXTURE_T = 0,
|
||||
CS_ROOT_ID_UAV_T,
|
||||
CS_ROOT_ID_CONSTANTS,
|
||||
CS_ROOT_ID_MAX
|
||||
} compute_root_index_t;
|
||||
|
||||
static INLINE HRESULT
|
||||
D3D12Map(void* resource, UINT subresource, D3D12_RANGE* read_range, void** data)
|
||||
{
|
||||
@ -365,31 +367,8 @@ static INLINE void D3D12Unmap(void* resource, UINT subresource, D3D12_RANGE* wri
|
||||
->lpVtbl->Unmap((ID3D12Resource*)resource, subresource, written_range);
|
||||
}
|
||||
|
||||
static INLINE D3D12_GPU_VIRTUAL_ADDRESS D3D12GetGPUVirtualAddress(void* resource)
|
||||
{
|
||||
return ((ID3D12Resource*)resource)->lpVtbl->GetGPUVirtualAddress((ID3D12Resource*)resource);
|
||||
}
|
||||
|
||||
/* end of auto-generated */
|
||||
|
||||
static INLINE D3D12_CPU_DESCRIPTOR_HANDLE
|
||||
D3D12GetCPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap)
|
||||
{
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE out;
|
||||
((void(STDMETHODCALLTYPE*)(ID3D12DescriptorHeap*, D3D12_CPU_DESCRIPTOR_HANDLE*))
|
||||
descriptor_heap->lpVtbl->GetCPUDescriptorHandleForHeapStart)(descriptor_heap, &out);
|
||||
return out;
|
||||
}
|
||||
|
||||
static INLINE D3D12_GPU_DESCRIPTOR_HANDLE
|
||||
D3D12GetGPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap)
|
||||
{
|
||||
D3D12_GPU_DESCRIPTOR_HANDLE out;
|
||||
((void(STDMETHODCALLTYPE*)(ID3D12DescriptorHeap*, D3D12_GPU_DESCRIPTOR_HANDLE*))
|
||||
descriptor_heap->lpVtbl->GetGPUDescriptorHandleForHeapStart)(descriptor_heap, &out);
|
||||
return out;
|
||||
}
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
D3D12_GPU_VIRTUAL_ADDRESS
|
||||
|
@ -71,6 +71,24 @@
|
||||
/*
|
||||
* D3D12 COMMON
|
||||
*/
|
||||
static INLINE D3D12_CPU_DESCRIPTOR_HANDLE
|
||||
D3D12GetCPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap)
|
||||
{
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE out;
|
||||
((void(STDMETHODCALLTYPE*)(ID3D12DescriptorHeap*, D3D12_CPU_DESCRIPTOR_HANDLE*))
|
||||
descriptor_heap->lpVtbl->GetCPUDescriptorHandleForHeapStart)(descriptor_heap, &out);
|
||||
return out;
|
||||
}
|
||||
|
||||
static INLINE D3D12_GPU_DESCRIPTOR_HANDLE
|
||||
D3D12GetGPUDescriptorHandleForHeapStart(D3D12DescriptorHeap descriptor_heap)
|
||||
{
|
||||
D3D12_GPU_DESCRIPTOR_HANDLE out;
|
||||
((void(STDMETHODCALLTYPE*)(ID3D12DescriptorHeap*, D3D12_GPU_DESCRIPTOR_HANDLE*))
|
||||
descriptor_heap->lpVtbl->GetGPUDescriptorHandleForHeapStart)(descriptor_heap, &out);
|
||||
return out;
|
||||
}
|
||||
|
||||
static D3D12_CPU_DESCRIPTOR_HANDLE d3d12_descriptor_heap_slot_alloc(d3d12_descriptor_heap_t* heap)
|
||||
{
|
||||
int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user