@@ -252,21 +252,52 @@ static HRESULT EnableAgilitySDK(HMODULE Runtime, UINT SDKVersion,
252252 return ExperimentalFeaturesFunc (0 , nullptr , nullptr , nullptr );
253253}
254254
255- static HRESULT EnableExperimentalShaderModels (HMODULE Runtime) {
256- D3D12EnableExperimentalFeaturesFn func =
255+ static HRESULT
256+ EnableExperimentalShaderModels (HMODULE hRuntime,
257+ UUID AdditionalFeatures[] = nullptr ,
258+ size_t NumAdditionalFeatures = 0 ) {
259+ D3D12EnableExperimentalFeaturesFn pD3D12EnableExperimentalFeatures =
257260 (D3D12EnableExperimentalFeaturesFn)GetProcAddress (
258- Runtime , " D3D12EnableExperimentalFeatures" );
259- if (func == nullptr ) {
261+ hRuntime , " D3D12EnableExperimentalFeatures" );
262+ if (pD3D12EnableExperimentalFeatures == nullptr ) {
260263 return HRESULT_FROM_WIN32 (GetLastError ());
261264 }
262- return func (1 , &D3D12ExperimentalShaderModelsID, nullptr , nullptr );
265+
266+ std::vector<UUID> Features;
267+
268+ Features.push_back (D3D12ExperimentalShaderModels);
269+
270+ if (AdditionalFeatures != nullptr && NumAdditionalFeatures > 0 ) {
271+ Features.insert (Features.end (), AdditionalFeatures,
272+ AdditionalFeatures + NumAdditionalFeatures);
273+ }
274+
275+ return pD3D12EnableExperimentalFeatures ((UINT)Features.size (),
276+ Features.data (), nullptr , nullptr );
263277}
264278
265- static HRESULT EnableExperimentalShaderModels () {
266- HMODULE Runtime = LoadLibraryW (L" d3d12.dll" );
267- if (Runtime == NULL )
279+ static HRESULT
280+ EnableExperimentalShaderModels (UUID AdditionalFeatures[] = nullptr ,
281+ size_t NumAdditionalFeatures = 0 ) {
282+ HMODULE hRuntime = LoadLibraryW (L" d3d12.dll" );
283+ if (hRuntime == NULL )
268284 return E_FAIL;
269- return EnableExperimentalShaderModels (Runtime);
285+ return EnableExperimentalShaderModels (hRuntime, AdditionalFeatures,
286+ NumAdditionalFeatures);
287+ }
288+
289+ static HRESULT DisableExperimentalShaderModels () {
290+ HMODULE hRuntime = LoadLibraryW (L" d3d12.dll" );
291+ if (hRuntime == NULL )
292+ return E_FAIL;
293+
294+ D3D12EnableExperimentalFeaturesFn pD3D12EnableExperimentalFeatures =
295+ (D3D12EnableExperimentalFeaturesFn)GetProcAddress (
296+ hRuntime, " D3D12EnableExperimentalFeatures" );
297+ if (pD3D12EnableExperimentalFeatures == nullptr ) {
298+ return HRESULT_FROM_WIN32 (GetLastError ());
299+ }
300+ return pD3D12EnableExperimentalFeatures (0 , nullptr , nullptr , nullptr );
270301}
271302
272303static HRESULT EnableAgilitySDK (HMODULE Runtime) {
0 commit comments