Refactor heatmap for quad overdraw/triangle size to be applied late

* Instead of baking these into the overlay texture and trying to decode them
  afterwards, we instead write a grayscale 16F value into the overlay texture,
  and add a special decode display mode that will use the heatmap and bucketing
  provided.
* This means that saving these overlay textures now saves grayscale. When saving
  to an 8-bit format, we remap to 0-255 so that greater than 1.0 values are
  mapped lower.
This commit is contained in:
baldurk
2018-10-31 15:08:49 +00:00
parent 4e48bd09c9
commit 57caf01394
25 changed files with 297 additions and 227 deletions
+13 -2
View File
@@ -818,11 +818,13 @@ void TextureViewer::UI_UpdateStatusText()
bool sintTex = (tex.format.compType == CompType::SInt);
if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass ||
m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw)
m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw ||
m_TexDisplay.overlay == DebugOverlay::TriangleSizeDraw ||
m_TexDisplay.overlay == DebugOverlay::TriangleSizeDraw)
{
dsv = false;
uintTex = false;
sintTex = true;
sintTex = false;
}
QColor swatchColor;
@@ -3451,6 +3453,15 @@ void TextureViewer::on_saveTex_clicked()
if(saveDialog.saveOverlayInstead())
{
m_SaveConfig.resourceId = overlayTexID;
if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw ||
m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass ||
m_TexDisplay.overlay == DebugOverlay::TriangleSizeDraw ||
m_TexDisplay.overlay == DebugOverlay::TriangleSizePass)
{
m_SaveConfig.comp.blackPoint = 0.0f;
m_SaveConfig.comp.whitePoint = 255.0f;
}
}
if(res)