d3d12: Move shared code that include d3d12 headers into d3d12_common.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16767>
This commit is contained in:
@@ -24,16 +24,13 @@
|
||||
#ifndef D3D12_RESOURCE_STATE_H
|
||||
#define D3D12_RESOURCE_STATE_H
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <directx/d3d12.h>
|
||||
|
||||
#include "util/list.h"
|
||||
|
||||
#include "d3d12_common.h"
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
||||
#endif
|
||||
|
@@ -28,12 +28,7 @@
|
||||
#include "util/hash_table.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct d3d12_bo;
|
||||
struct d3d12_descriptor_heap;
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include <dxguids/dxguids.h>
|
||||
|
||||
struct d3d12_bufmgr {
|
||||
|
@@ -28,11 +28,7 @@
|
||||
#include "util/u_atomic.h"
|
||||
#include "util/list.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct d3d12_bufmgr;
|
||||
struct d3d12_screen;
|
||||
|
36
src/gallium/drivers/d3d12/d3d12_common.h
Normal file
36
src/gallium/drivers/d3d12/d3d12_common.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright © Yonggang Luo
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef D3D12_COMMON_STATE_H
|
||||
#define D3D12_COMMON_STATE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
|
||||
#endif
|
@@ -44,7 +44,6 @@
|
||||
#include "util/u_simple_shaders.h"
|
||||
#include "util/u_dl.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include <dxguids/dxguids.h>
|
||||
|
||||
extern "C" {
|
||||
|
@@ -37,8 +37,6 @@
|
||||
#include "util/u_suballoc.h"
|
||||
#include "util/u_threaded_context.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
|
||||
#define D3D12_GFX_SHADER_STAGES (PIPE_SHADER_TYPES - 1)
|
||||
|
||||
enum d3d12_dirty_flags
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "util/u_dynarray.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include <dxguids/dxguids.h>
|
||||
|
||||
struct d3d12_descriptor_pool {
|
||||
|
@@ -24,12 +24,7 @@
|
||||
#ifndef D3D12_DESCRIPTOR_POOL_H
|
||||
#define D3D12_DESCRIPTOR_POOL_H
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct d3d12_descriptor_pool;
|
||||
struct d3d12_descriptor_heap;
|
||||
|
@@ -26,11 +26,7 @@
|
||||
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct pipe_screen;
|
||||
struct d3d12_screen;
|
||||
|
@@ -26,12 +26,7 @@
|
||||
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct d3d12_context;
|
||||
struct d3d12_root_signature;
|
||||
|
@@ -38,7 +38,6 @@
|
||||
|
||||
#include "frontend/sw_winsys.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include <dxguids/dxguids.h>
|
||||
#include <memory>
|
||||
|
||||
|
@@ -30,7 +30,7 @@ struct pipe_screen;
|
||||
#include "util/u_transfer.h"
|
||||
#include "util/u_threaded_context.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
enum d3d12_resource_binding_type {
|
||||
D3D12_RESOURCE_BINDING_TYPE_SRV,
|
||||
|
@@ -31,12 +31,7 @@
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
struct pb_manager;
|
||||
|
||||
|
@@ -26,8 +26,6 @@
|
||||
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
|
||||
struct d3d12_descriptor_handle;
|
||||
struct pipe_context;
|
||||
|
||||
|
@@ -30,12 +30,8 @@
|
||||
// Uses an std::vector with individual D3D resources as backing storage instead of an D3D12 Texture Array
|
||||
// Supports dynamic pool capacity extension (by pushing back a new D3D12Resource) of the pool
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
#include "d3d12_common.h"
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_util.h"
|
||||
|
||||
void
|
||||
|
@@ -21,12 +21,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
#include "d3d12_util.h"
|
||||
#include "d3d12_context.h"
|
||||
|
@@ -26,11 +26,7 @@
|
||||
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
void
|
||||
d3d12_screen_video_init(struct pipe_screen *pscreen);
|
||||
|
@@ -23,12 +23,7 @@
|
||||
|
||||
#include "d3d12_video_texture_array_dpb_manager.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#endif
|
||||
|
||||
#define D3D12_IGNORE_SDK_LAYERS
|
||||
#include <directx/d3d12.h>
|
||||
#include "d3d12_common.h"
|
||||
|
||||
#include "d3d12_util.h"
|
||||
|
||||
|
Reference in New Issue
Block a user