diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 4d9f1d4500c..9734f01e359 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -670,7 +670,9 @@ d3d12_destroy_screen(struct d3d12_screen *screen) if (screen->d3d12_mod) util_dl_close(screen->d3d12_mod); +#ifdef HAVE_GALLIUM_D3D12_GRAPHICS glsl_type_singleton_decref(); +#endif // HAVE_GALLIUM_D3D12_GRAPHICS FREE(screen); } @@ -1248,7 +1250,9 @@ d3d12_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *in bool d3d12_init_screen_base(struct d3d12_screen *screen, struct sw_winsys *winsys, LUID *adapter_luid) { +#ifdef HAVE_GALLIUM_D3D12_GRAPHICS glsl_type_singleton_init_or_ref(); +#endif // HAVE_GALLIUM_D3D12_GRAPHICS d3d12_debug = static_cast(debug_get_option_d3d12_debug()); screen->winsys = winsys; diff --git a/src/gallium/drivers/d3d12/d3d12_screen.h b/src/gallium/drivers/d3d12/d3d12_screen.h index ba667f053c2..5c5adea8eee 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.h +++ b/src/gallium/drivers/d3d12/d3d12_screen.h @@ -29,8 +29,11 @@ #include "util/slab.h" #include "d3d12_descriptor_pool.h" -#include "nir.h" +#include "util/list.h" +#include "util/set.h" #ifdef HAVE_GALLIUM_D3D12_GRAPHICS +#include "compiler/glsl_types.h" +#include "nir.h" #include "dxil_versions.h" #endif // HAVE_GALLIUM_D3D12_GRAPHICS @@ -122,6 +125,7 @@ struct d3d12_screen { D3D_FEATURE_LEVEL max_feature_level; #ifdef HAVE_GALLIUM_D3D12_GRAPHICS enum dxil_shader_model max_shader_model; + nir_shader_compiler_options nir_options; #endif // HAVE_GALLIUM_D3D12_GRAPHICS D3D12_FEATURE_DATA_ARCHITECTURE architecture; D3D12_FEATURE_DATA_D3D12_OPTIONS opts; @@ -135,8 +139,6 @@ struct d3d12_screen { D3D12_FEATURE_DATA_D3D12_OPTIONS19 opts19; #endif - nir_shader_compiler_options nir_options; - /* description */ uint32_t vendor_id; uint32_t device_id; diff --git a/src/gallium/drivers/d3d12/meson.build b/src/gallium/drivers/d3d12/meson.build index 2176d5b41cd..d71527d0273 100644 --- a/src/gallium/drivers/d3d12/meson.build +++ b/src/gallium/drivers/d3d12/meson.build @@ -148,9 +148,9 @@ if is_xbox == false files_libd3d12 += files('d3d12_dxcore_screen.cpp') endif -libd3d12_deps = [idep_nir_headers, dep_dxheaders, idep_mesautil] +libd3d12_deps = [dep_dxheaders, idep_mesautil] if with_gallium_d3d12_graphics - libd3d12_deps += [idep_libdxil_compiler] + libd3d12_deps += [idep_nir_headers, idep_libdxil_compiler] endif libd3d12 = static_library( diff --git a/src/gallium/winsys/d3d12/wgl/meson.build b/src/gallium/winsys/d3d12/wgl/meson.build index 06c793331f3..c2c5de3aa88 100644 --- a/src/gallium/winsys/d3d12/wgl/meson.build +++ b/src/gallium/winsys/d3d12/wgl/meson.build @@ -8,12 +8,20 @@ else files_libd3d12winsys += files('d3d12_wgl_framebuffer.cpp') endif +libd3d12wgl_compiler_args = [] +_with_gallium_d3d12_graphics = get_option('gallium-d3d12-graphics') +if not _with_gallium_d3d12_graphics.disabled() + libd3d12wgl_compiler_args += '-DHAVE_GALLIUM_D3D12_GRAPHICS' +endif + libd3d12winsys = static_library( 'd3d12winsys', files_libd3d12winsys, include_directories : [inc_src, inc_wgl, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers], dependencies : [dep_dxheaders, idep_nir_headers, idep_libdxil_compiler, idep_mesautil], gnu_symbol_visibility : 'hidden', + c_args: libd3d12wgl_compiler_args, + cpp_args: libd3d12wgl_compiler_args, ) winsys_d3d12_wgl = declare_dependency(