d3d12: Clean up d3d12_compiler.h
authorJesse Natalie <jenatali@microsoft.com>
Thu, 26 Nov 2020 01:07:05 +0000 (17:07 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Dec 2020 17:10:47 +0000 (17:10 +0000)
Move some stuff from d3d12_context.h to d3d12_compiler.h, and
fix d3d12_compiler.h to not include d3d12_context.h.

This serves two purposes:
1. Putting declarations and definitions where they really belong.
2. Making it so only C++ code needs d3d12.h simplifies the helpers
   we need to add to add to support d3d12.h for Linux.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>

src/gallium/drivers/d3d12/d3d12_compiler.h
src/gallium/drivers/d3d12/d3d12_context.h

index d838201..e1bb144 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef D3D12_COMPILER_H
 #define D3D12_COMPILER_H
 
-#include "d3d12_context.h"
+#include "dxil_nir_lower_int_samplers.h"
 
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
@@ -40,6 +40,16 @@ struct pipe_screen;
 extern "C" {
 #endif
 
+enum d3d12_state_var {
+   D3D12_STATE_VAR_Y_FLIP = 0,
+   D3D12_STATE_VAR_PT_SPRITE,
+   D3D12_STATE_VAR_FIRST_VERTEX,
+   D3D12_STATE_VAR_DEPTH_TRANSFORM,
+   D3D12_MAX_STATE_VARS
+};
+
+#define D3D12_MAX_POINT_SIZE 255.0f
+
 struct d3d12_validation_tools *d3d12_validator_create();
 
 void d3d12_validator_destroy(struct d3d12_validation_tools *validator);
@@ -169,6 +179,7 @@ struct d3d12_shader_selector {
    struct d3d12_gs_variant_key gs_key;
 };
 
+struct d3d12_context;
 
 struct d3d12_shader_selector *
 d3d12_create_shader(struct d3d12_context *ctx,
index 08d8b15..dd0245d 100644 (file)
@@ -40,7 +40,6 @@
 #include <d3d12.h>
 
 #define D3D12_GFX_SHADER_STAGES (PIPE_SHADER_TYPES - 1)
-#define D3D12_MAX_POINT_SIZE 255.0f
 
 enum d3d12_dirty_flags
 {
@@ -88,14 +87,6 @@ enum d3d12_binding_type {
    D3D12_NUM_BINDING_TYPES
 };
 
-enum d3d12_state_var {
-   D3D12_STATE_VAR_Y_FLIP = 0,
-   D3D12_STATE_VAR_PT_SPRITE,
-   D3D12_STATE_VAR_FIRST_VERTEX,
-   D3D12_STATE_VAR_DEPTH_TRANSFORM,
-   D3D12_MAX_STATE_VARS
-};
-
 enum resource_dimension
 {
    RESOURCE_DIMENSION_UNKNOWN = 0,