summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorSil Vilerino <sivileri@microsoft.com>2022-05-23 07:10:36 -0700
committerMarge Bot <emma+marge@anholt.net>2022-05-24 16:36:31 +0000
commite5ddd8ad941d224f4abf64403e0bb8762950b9a2 (patch)
tree3be321b1e380e6a052e137316562e2551b305a84 /src/gallium/drivers
parent4a9e068a6e1336e5c85569df5d051ad0aa0f4098 (diff)
meson: Add build option for gallium-d3d12-video feature
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6511 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16597>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/d3d12/d3d12_context.cpp8
-rw-r--r--src/gallium/drivers/d3d12/d3d12_context.h3
-rw-r--r--src/gallium/drivers/d3d12/d3d12_screen.cpp4
-rw-r--r--src/gallium/drivers/d3d12/meson.build31
4 files changed, 30 insertions, 16 deletions
diff --git a/src/gallium/drivers/d3d12/d3d12_context.cpp b/src/gallium/drivers/d3d12/d3d12_context.cpp
index 75780c64548..6911f816e4e 100644
--- a/src/gallium/drivers/d3d12/d3d12_context.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_context.cpp
@@ -34,10 +34,11 @@
#include "d3d12_root_signature.h"
#include "d3d12_screen.h"
#include "d3d12_surface.h"
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
#include "d3d12_video_dec.h"
#include "d3d12_video_enc.h"
#include "d3d12_video_buffer.h"
-
+#endif
#include "util/u_atomic.h"
#include "util/u_blitter.h"
#include "util/u_dual_blend.h"
@@ -2378,6 +2379,7 @@ d3d12_get_reset_status(struct pipe_context *pctx)
}
}
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
struct pipe_video_codec*
d3d12_video_create_codec(struct pipe_context *context,
const struct pipe_video_codec *templat)
@@ -2391,6 +2393,7 @@ d3d12_video_create_codec(struct pipe_context *context,
return nullptr;
}
}
+#endif
struct pipe_context *
d3d12_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
@@ -2506,10 +2509,11 @@ d3d12_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
d3d12_context_query_init(&ctx->base);
d3d12_context_blit_init(&ctx->base);
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
// Add d3d12 video functions entrypoints
ctx->base.create_video_codec = d3d12_video_create_codec;
ctx->base.create_video_buffer = d3d12_video_buffer_create;
-
+#endif
slab_create_child(&ctx->transfer_pool, &d3d12_screen(pscreen)->transfer_pool);
slab_create_child(&ctx->transfer_pool_unsync, &d3d12_screen(pscreen)->transfer_pool);
diff --git a/src/gallium/drivers/d3d12/d3d12_context.h b/src/gallium/drivers/d3d12/d3d12_context.h
index 42d8b0c51b8..c7501b5b07a 100644
--- a/src/gallium/drivers/d3d12/d3d12_context.h
+++ b/src/gallium/drivers/d3d12/d3d12_context.h
@@ -355,8 +355,9 @@ d3d12_need_zero_one_depth_range(struct d3d12_context *ctx);
void
d3d12_init_sampler_view_descriptor(struct d3d12_sampler_view *sampler_view);
-
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
struct pipe_video_codec* d3d12_video_create_codec( struct pipe_context *context,
const struct pipe_video_codec *t);
+#endif
#endif
diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp
index 04d1ebc388b..2b7dd3aae71 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp
@@ -28,7 +28,9 @@
#include "d3d12_context.h"
#include "d3d12_debug.h"
#include "d3d12_fence.h"
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
#include "d3d12_video_screen.h"
+#endif
#include "d3d12_format.h"
#include "d3d12_residency.h"
#include "d3d12_resource.h"
@@ -1240,7 +1242,9 @@ d3d12_init_screen(struct d3d12_screen *screen, IUnknown *adapter)
d3d12_screen_fence_init(&screen->base);
d3d12_screen_resource_init(&screen->base);
+#ifdef HAVE_GALLIUM_D3D12_VIDEO
d3d12_screen_video_init(&screen->base);
+#endif
slab_create_parent(&screen->transfer_pool, sizeof(struct d3d12_transfer), 16);
struct pb_desc desc;
diff --git a/src/gallium/drivers/d3d12/meson.build b/src/gallium/drivers/d3d12/meson.build
index a67d8410558..72f8ae2cd31 100644
--- a/src/gallium/drivers/d3d12/meson.build
+++ b/src/gallium/drivers/d3d12/meson.build
@@ -47,21 +47,26 @@ files_libd3d12 = files(
'd3d12_surface.cpp',
'd3d12_tcs_variant.cpp',
'D3D12ResourceState.cpp',
- 'd3d12_video_dec.cpp',
- 'd3d12_video_dec_references_mgr.cpp',
- 'd3d12_video_dec_h264.cpp',
- 'd3d12_video_buffer.cpp',
- 'd3d12_video_enc.cpp',
- 'd3d12_video_enc_h264.cpp',
- 'd3d12_video_encoder_references_manager_h264.cpp',
- 'd3d12_video_encoder_nalu_writer_h264.cpp',
- 'd3d12_video_encoder_bitstream_builder_h264.cpp',
- 'd3d12_video_encoder_bitstream.cpp',
- 'd3d12_video_texture_array_dpb_manager.cpp',
- 'd3d12_video_array_of_textures_dpb_manager.cpp',
- 'd3d12_video_screen.cpp',
)
+if with_gallium_d3d12_video
+ files_libd3d12 += [
+ 'd3d12_video_dec.cpp',
+ 'd3d12_video_dec_references_mgr.cpp',
+ 'd3d12_video_dec_h264.cpp',
+ 'd3d12_video_buffer.cpp',
+ 'd3d12_video_enc.cpp',
+ 'd3d12_video_enc_h264.cpp',
+ 'd3d12_video_encoder_references_manager_h264.cpp',
+ 'd3d12_video_encoder_nalu_writer_h264.cpp',
+ 'd3d12_video_encoder_bitstream_builder_h264.cpp',
+ 'd3d12_video_encoder_bitstream.cpp',
+ 'd3d12_video_texture_array_dpb_manager.cpp',
+ 'd3d12_video_array_of_textures_dpb_manager.cpp',
+ 'd3d12_video_screen.cpp',
+ ]
+endif
+
if host_machine.system() == 'windows'
files_libd3d12 += files('d3d12_dxgi_screen.cpp')
endif