From 0f28b66a70365579b71cf95fb4560364179b7439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 20 Dec 2018 11:14:50 +0100 Subject: [PATCH] Don't leak the new pipelines --- UI/GPUDriverTestScreen.cpp | 14 ++++++++++---- UI/GPUDriverTestScreen.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/UI/GPUDriverTestScreen.cpp b/UI/GPUDriverTestScreen.cpp index 393cbe9db8..1a737b0325 100644 --- a/UI/GPUDriverTestScreen.cpp +++ b/UI/GPUDriverTestScreen.cpp @@ -51,6 +51,7 @@ GPUDriverTestScreen::~GPUDriverTestScreen() { discardWriteDepth_->Release(); if (discardWriteStencil_) discardWriteStencil_->Release(); + if (drawTestStencilEqualDepthAlways_) drawTestStencilEqualDepthAlways_->Release(); if (drawTestStencilNotEqualDepthAlways_) @@ -63,8 +64,13 @@ GPUDriverTestScreen::~GPUDriverTestScreen() { drawTestStencilAlwaysDepthLessEqual_->Release(); if (drawTestStencilAlwaysDepthGreater_) drawTestStencilAlwaysDepthGreater_->Release(); - if (discard_) - discard_->Release(); + if (drawTestDepthLessEqual_) + drawTestDepthLessEqual_->Release(); + if (drawTestDepthGreater_) + drawTestDepthGreater_->Release(); + + if (discardFragShader_) + discardFragShader_->Release(); if (samplerNearest_) samplerNearest_->Release(); } @@ -95,7 +101,7 @@ void GPUDriverTestScreen::DiscardTest() { // Create the special shader module. - discard_ = CreateShader(draw, Draw::ShaderStage::FRAGMENT, fsDiscard); + discardFragShader_ = CreateShader(draw, Draw::ShaderStage::FRAGMENT, fsDiscard); InputLayout *inputLayout = ui_draw2d.CreateInputLayout(draw); BlendState *blendOff = draw->CreateBlendState({ false, 0xF }); @@ -169,7 +175,7 @@ void GPUDriverTestScreen::DiscardTest() { PipelineDesc discardDesc{ Primitive::TRIANGLE_LIST, - { draw->GetVshaderPreset(VS_TEXTURE_COLOR_2D), discard_ }, + { draw->GetVshaderPreset(VS_TEXTURE_COLOR_2D), discardFragShader_ }, inputLayout, depthStencilWrite, blendOff, rasterNoCull, &vsColBufDesc, }; discardWriteDepthStencil_ = draw->CreateGraphicsPipeline(discardDesc); diff --git a/UI/GPUDriverTestScreen.h b/UI/GPUDriverTestScreen.h index d76cacc56e..bf5c56a02c 100644 --- a/UI/GPUDriverTestScreen.h +++ b/UI/GPUDriverTestScreen.h @@ -23,7 +23,7 @@ public: private: void DiscardTest(); - Draw::ShaderModule *discard_ = nullptr; + Draw::ShaderModule *discardFragShader_ = nullptr; Draw::Pipeline *discardWriteDepthStencil_ = nullptr; Draw::Pipeline *discardWriteDepth_ = nullptr; Draw::Pipeline *discardWriteStencil_ = nullptr;