Skip to content

Commit 15b475b

Browse files
Remove PIX misinformation from VRS sample + fix bug highlighted by Visual Studio (#889)
Misc functionality in the VRS sample was disabled when PIX was active, but there's no reason for that anymore. The PR also fixes a std::vector::empty() call that was meant to be a std::vector::clear() call.
1 parent c01c488 commit 15b475b

File tree

5 files changed

+3
-24
lines changed

5 files changed

+3
-24
lines changed

Samples/Desktop/D3D12VariableRateShading/src/D3D12VariableRateShading.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ D3D12VariableRateShading::D3D12VariableRateShading(UINT width, UINT height, wstr
6767
m_windowVisible(true),
6868
m_windowedMode(true)
6969
{
70-
#ifdef PIXSUPPORT
71-
m_enableUI = false;
72-
#endif
73-
#ifndef PIXSUPPORT
7470
ThrowIfFailed(DXGIDeclareAdapterRemovalSupport());
75-
#endif
71+
7672
if (!m_tearingSupport)
7773
{
7874
// Sample shows handling of use cases with tearing support, which is OS dependent and has been supported since Threshold II.

Samples/Desktop/D3D12VariableRateShading/src/DXSample.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ void DXSample::ParseCommandLineArgs(WCHAR* argv[], int argc)
147147
// Determines whether tearing support is available for fullscreen borderless windows.
148148
void DXSample::CheckTearingSupport()
149149
{
150-
#ifndef PIXSUPPORT
151150
ComPtr<IDXGIFactory6> factory;
152151
HRESULT hr = CreateDXGIFactory1(IID_PPV_ARGS(&factory));
153152
BOOL allowTearing = FALSE;
@@ -157,9 +156,6 @@ void DXSample::CheckTearingSupport()
157156
}
158157

159158
m_tearingSupport = SUCCEEDED(hr) && allowTearing;
160-
#else
161-
m_tearingSupport = TRUE;
162-
#endif
163159
}
164160

165161
void DXSample::SetWindowBounds(int left, int top, int right, int bottom)

Samples/Desktop/D3D12VariableRateShading/src/DXSample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class DXSample
7171
// Adapter info.
7272
bool m_useWarpDevice;
7373

74-
// Override to be able to start without Dx11on12 UI for PIX. PIX doesn't support 11 on 12.
74+
// Override to be able to start without Dx11on12 UI
7575
bool m_enableUI;
7676

7777
private:

Samples/Desktop/D3D12VariableRateShading/src/VariableRateShadingScene.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,6 @@ void VariableRateShadingScene::Initialize(ID3D12Device* pDevice, ID3D12CommandQu
4545
m_shadingRateTier = options.VariableShadingRateTier;
4646
}
4747

48-
// For now, disable variable rate shading when running under PIX.
49-
// This is only needed until PIX supports VRS.
50-
IID graphicsAnalysisID;
51-
if (SUCCEEDED(IIDFromString(L"{9F251514-9D4D-4902-9D60-18988AB7D4B5}", &graphicsAnalysisID)))
52-
{
53-
ComPtr<IUnknown> graphicsAnalysis;
54-
if (SUCCEEDED(DXGIGetDebugInterface1(0, graphicsAnalysisID, &graphicsAnalysis)))
55-
{
56-
// Running under PIX.
57-
m_shadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED;
58-
}
59-
}
60-
6148
// Initialize the base scene.
6249
ShadowsFogScatteringSquidScene::Initialize(pDevice, pDirectCommandQueue, pCommandList, frameIndex);
6350
}

Samples/Desktop/D3D12VariableRateShading/src/VariableRateShadingScene.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace SampleAssets
6262
const float width = 266.66f * scale;
6363
const float height = 150.0f * scale;
6464

65-
vertexData.empty();
65+
vertexData.clear();
6666
vertexData.resize(4);
6767

6868
vertexData[0].position = { x, y, z };

0 commit comments

Comments
 (0)