@@ -57,17 +57,16 @@ D3D11Device::~D3D11Device()
5757 Assert (!m_device);
5858}
5959
60- bool D3D11Device::CreateDeviceAndMainSwapChain (std::string_view adapter, FeatureMask disabled_features,
61- const WindowInfo& wi, GPUVSyncMode vsync_mode,
62- bool allow_present_throttle,
60+ bool D3D11Device::CreateDeviceAndMainSwapChain (std::string_view adapter, CreateFlags create_flags, const WindowInfo& wi,
61+ GPUVSyncMode vsync_mode, bool allow_present_throttle,
6362 const ExclusiveFullscreenMode* exclusive_fullscreen_mode,
6463 std::optional<bool > exclusive_fullscreen_control, Error* error)
6564{
6665 std::unique_lock lock (s_instance_mutex);
6766
68- UINT create_flags = 0 ;
67+ UINT d3d_create_flags = 0 ;
6968 if (m_debug_device)
70- create_flags |= D3D11_CREATE_DEVICE_DEBUG;
69+ d3d_create_flags |= D3D11_CREATE_DEVICE_DEBUG;
7170
7271 m_dxgi_factory = D3DCommon::CreateFactory (m_debug_device, error);
7372 if (!m_dxgi_factory)
@@ -82,7 +81,7 @@ bool D3D11Device::CreateDeviceAndMainSwapChain(std::string_view adapter, Feature
8281 ComPtr<ID3D11Device> temp_device;
8382 ComPtr<ID3D11DeviceContext> temp_context;
8483 HRESULT hr;
85- if (!D3DCommon::CreateD3D11Device (dxgi_adapter.Get (), create_flags , requested_feature_levels.data (),
84+ if (!D3DCommon::CreateD3D11Device (dxgi_adapter.Get (), d3d_create_flags , requested_feature_levels.data (),
8685 static_cast <UINT>(requested_feature_levels.size ()), &temp_device, nullptr ,
8786 &temp_context, error))
8887 {
@@ -129,7 +128,7 @@ bool D3D11Device::CreateDeviceAndMainSwapChain(std::string_view adapter, Feature
129128 D3DCommon::GetFeatureLevelString (D3DCommon::GetRenderAPIVersionForFeatureLevel (m_max_feature_level)));
130129
131130 SetDriverType (driver_type);
132- SetFeatures (disabled_features );
131+ SetFeatures (create_flags );
133132
134133 if (!wi.IsSurfaceless ())
135134 {
@@ -155,7 +154,7 @@ void D3D11Device::DestroyDevice()
155154 m_device.Reset ();
156155}
157156
158- void D3D11Device::SetFeatures (FeatureMask disabled_features )
157+ void D3D11Device::SetFeatures (CreateFlags create_flags )
159158{
160159 const D3D_FEATURE_LEVEL feature_level = m_device->GetFeatureLevel ();
161160
@@ -173,17 +172,17 @@ void D3D11Device::SetFeatures(FeatureMask disabled_features)
173172 }
174173 }
175174
176- m_features.dual_source_blend = !(disabled_features & FEATURE_MASK_DUAL_SOURCE_BLEND );
175+ m_features.dual_source_blend = !HasCreateFlag (create_flags, CreateFlags::DisableDualSourceBlend );
177176 m_features.framebuffer_fetch = false ;
178177 m_features.per_sample_shading = (feature_level >= D3D_FEATURE_LEVEL_10_1);
179178 m_features.noperspective_interpolation = true ;
180179 m_features.texture_copy_to_self = false ;
181- m_features.texture_buffers = !(disabled_features & FEATURE_MASK_TEXTURE_BUFFERS );
180+ m_features.texture_buffers = !HasCreateFlag (create_flags, CreateFlags::DisableTextureBuffers );
182181 m_features.texture_buffers_emulated_with_ssbo = false ;
183182 m_features.feedback_loops = false ;
184- m_features.geometry_shaders = !(disabled_features & FEATURE_MASK_GEOMETRY_SHADERS );
183+ m_features.geometry_shaders = !HasCreateFlag (create_flags, CreateFlags::DisableGeometryShaders );
185184 m_features.compute_shaders =
186- (!(disabled_features & FEATURE_MASK_COMPUTE_SHADERS ) && feature_level >= D3D_FEATURE_LEVEL_11_0);
185+ (!HasCreateFlag (create_flags, CreateFlags::DisableComputeShaders ) && feature_level >= D3D_FEATURE_LEVEL_11_0);
187186 m_features.partial_msaa_resolve = false ;
188187 m_features.memory_import = false ;
189188 m_features.exclusive_fullscreen = true ;
@@ -194,7 +193,7 @@ void D3D11Device::SetFeatures(FeatureMask disabled_features)
194193 m_features.pipeline_cache = false ;
195194 m_features.prefer_unused_textures = false ;
196195 m_features.raster_order_views = false ;
197- if (!(disabled_features & FEATURE_MASK_RASTER_ORDER_VIEWS ))
196+ if (!! HasCreateFlag (create_flags, CreateFlags::DisableRasterOrderViews ))
198197 {
199198 D3D11_FEATURE_DATA_D3D11_OPTIONS2 data = {};
200199 m_features.raster_order_views =
@@ -203,11 +202,11 @@ void D3D11Device::SetFeatures(FeatureMask disabled_features)
203202 }
204203
205204 m_features.dxt_textures =
206- (!(disabled_features & FEATURE_MASK_COMPRESSED_TEXTURES ) &&
205+ (!HasCreateFlag (create_flags, CreateFlags::DisableCompressedTextures ) &&
207206 (SupportsTextureFormat (GPUTexture::Format::BC1) && SupportsTextureFormat (GPUTexture::Format::BC2) &&
208207 SupportsTextureFormat (GPUTexture::Format::BC3)));
209- m_features.bptc_textures =
210- (!(disabled_features & FEATURE_MASK_COMPRESSED_TEXTURES) && SupportsTextureFormat (GPUTexture::Format::BC7));
208+ m_features.bptc_textures = (! HasCreateFlag (create_flags, CreateFlags::DisableCompressedTextures) &&
209+ SupportsTextureFormat (GPUTexture::Format::BC7));
211210}
212211
213212D3D11SwapChain::D3D11SwapChain (const WindowInfo& wi, GPUVSyncMode vsync_mode, bool allow_present_throttle,
0 commit comments