microsoft / DirectXTK

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++

Home Page:https://walbourn.github.io/directxtk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop WICTextureLoader from calling SetPrivateData()

trojanfoe opened this issue · comments

Is there any chance you can stop the WICTextureLoader from setting the debug name of the texture/view via SetPrivateData()? I am setting the filename as the debug name and receiving this warning despite it being suppressed via your DeviceResources VS template code:

D3D11 WARNING: ID3D11ShaderResourceView1::SetPrivateData: Existing private data of same name with different size found! [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS]

Your DeviceResources code:

#ifdef _DEBUG
	ComPtr<ID3D11Debug> deviceDebug;
	if (SUCCEEDED(device.As(&deviceDebug))) {
		ComPtr<ID3D11InfoQueue> deviceInfoQueue;
		if (SUCCEEDED(deviceDebug.As(&deviceInfoQueue))) {
			deviceInfoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true);
			deviceInfoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_CORRUPTION, true);

			D3D11_MESSAGE_ID hide[] {
				D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS,
			};
			D3D11_INFO_QUEUE_FILTER filter = {};
			filter.DenyList.NumIDs = _countof(hide);
			filter.DenyList.pIDList = hide;
			deviceInfoQueue->AddStorageFilterEntries(&filter);
		}
	}
#endif

Actually never mind, as it's only happening in one place I can set nullptr first before setting the filename. It's strange that the suppressing of the warning is no longer working (not sure what has changed my end).