From e060c1b41092eb0813f7c514b41895738f53031c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 1 Mar 2018 13:15:31 +0000 Subject: [PATCH] Format stencil references as 8-bit integers, not 32-bit --- .../D3D11PipelineStateViewer.cpp | 6 ++-- .../D3D12PipelineStateViewer.cpp | 6 ++-- .../PipelineState/GLPipelineStateViewer.cpp | 32 +++++++++---------- .../VulkanPipelineStateViewer.cpp | 32 +++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index 609ccd892..e0ee0eeeb 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -1690,11 +1690,11 @@ void D3D11PipelineStateViewer::setState() ui->stencilEnabled->setPixmap(state.outputMerger.depthStencilState.stencilEnable ? tick : cross); ui->stencilReadMask->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.compareMask, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.compareMask, true)); ui->stencilWriteMask->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.writeMask, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.writeMask, true)); ui->stencilRef->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.reference, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.reference, true)); ui->stencils->beginUpdate(); ui->stencils->clear(); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 415535ed7..218989377 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -1609,11 +1609,11 @@ void D3D12PipelineStateViewer::setState() ui->stencilEnabled->setPixmap(state.outputMerger.depthStencilState.stencilEnable ? tick : cross); ui->stencilReadMask->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.compareMask, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.compareMask, true)); ui->stencilWriteMask->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.writeMask, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.writeMask, true)); ui->stencilRef->setText( - Formatter::Format(state.outputMerger.depthStencilState.frontFace.reference, true)); + Formatter::Format((uint8_t)state.outputMerger.depthStencilState.frontFace.reference, true)); ui->stencils->beginUpdate(); ui->stencils->clear(); diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 6553b8964..5383fd3a2 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -1852,23 +1852,23 @@ void GLPipelineStateViewer::setState() ui->stencils->clear(); if(state.stencilState.stencilEnable) { - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Front"), ToQStr(state.stencilState.frontFace.function), - ToQStr(state.stencilState.frontFace.failOperation), - ToQStr(state.stencilState.frontFace.depthFailOperation), - ToQStr(state.stencilState.frontFace.passOperation), - Formatter::Format(state.stencilState.frontFace.writeMask, true), - Formatter::Format(state.stencilState.frontFace.compareMask, true), - Formatter::Format(state.stencilState.frontFace.reference, true)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Front"), ToQStr(state.stencilState.frontFace.function), + ToQStr(state.stencilState.frontFace.failOperation), + ToQStr(state.stencilState.frontFace.depthFailOperation), + ToQStr(state.stencilState.frontFace.passOperation), + Formatter::Format((uint8_t)state.stencilState.frontFace.writeMask, true), + Formatter::Format((uint8_t)state.stencilState.frontFace.compareMask, true), + Formatter::Format((uint8_t)state.stencilState.frontFace.reference, true)})); - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Back"), ToQStr(state.stencilState.backFace.function), - ToQStr(state.stencilState.backFace.failOperation), - ToQStr(state.stencilState.backFace.depthFailOperation), - ToQStr(state.stencilState.backFace.passOperation), - Formatter::Format(state.stencilState.backFace.writeMask, true), - Formatter::Format(state.stencilState.backFace.compareMask, true), - Formatter::Format(state.stencilState.backFace.reference, true)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Back"), ToQStr(state.stencilState.backFace.function), + ToQStr(state.stencilState.backFace.failOperation), + ToQStr(state.stencilState.backFace.depthFailOperation), + ToQStr(state.stencilState.backFace.passOperation), + Formatter::Format((uint8_t)state.stencilState.backFace.writeMask, true), + Formatter::Format((uint8_t)state.stencilState.backFace.compareMask, true), + Formatter::Format((uint8_t)state.stencilState.backFace.reference, true)})); } else { diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index 2a01e10b7..0d2ba85d5 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -1965,22 +1965,22 @@ void VulkanPipelineStateViewer::setState() ui->stencils->clear(); if(state.depthStencil.stencilTestEnable) { - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Front"), ToQStr(state.depthStencil.frontFace.function), - ToQStr(state.depthStencil.frontFace.failOperation), - ToQStr(state.depthStencil.frontFace.depthFailOperation), - ToQStr(state.depthStencil.frontFace.passOperation), - Formatter::Format(state.depthStencil.frontFace.writeMask, true), - Formatter::Format(state.depthStencil.frontFace.compareMask, true), - Formatter::Format(state.depthStencil.frontFace.reference, true)})); - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Back"), ToQStr(state.depthStencil.backFace.function), - ToQStr(state.depthStencil.backFace.failOperation), - ToQStr(state.depthStencil.backFace.depthFailOperation), - ToQStr(state.depthStencil.backFace.passOperation), - Formatter::Format(state.depthStencil.backFace.writeMask, true), - Formatter::Format(state.depthStencil.backFace.compareMask, true), - Formatter::Format(state.depthStencil.backFace.reference, true)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Front"), ToQStr(state.depthStencil.frontFace.function), + ToQStr(state.depthStencil.frontFace.failOperation), + ToQStr(state.depthStencil.frontFace.depthFailOperation), + ToQStr(state.depthStencil.frontFace.passOperation), + Formatter::Format((uint8_t)state.depthStencil.frontFace.writeMask, true), + Formatter::Format((uint8_t)state.depthStencil.frontFace.compareMask, true), + Formatter::Format((uint8_t)state.depthStencil.frontFace.reference, true)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Back"), ToQStr(state.depthStencil.backFace.function), + ToQStr(state.depthStencil.backFace.failOperation), + ToQStr(state.depthStencil.backFace.depthFailOperation), + ToQStr(state.depthStencil.backFace.passOperation), + Formatter::Format((uint8_t)state.depthStencil.backFace.writeMask, true), + Formatter::Format((uint8_t)state.depthStencil.backFace.compareMask, true), + Formatter::Format((uint8_t)state.depthStencil.backFace.reference, true)})); } else {