mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
PickPixel's x and y parameters should be mip-relative
* Previously x and y always ranged from 0,0 to width-1,height-1. Even for lower mips, the value was just effectively shifted. * This is quite unclear at the API level so instead x and y are now relative to the selected mip's dimensions.
This commit is contained in:
@@ -736,6 +736,9 @@ void TextureViewer::RT_FetchCurrentPixel(uint32_t x, uint32_t y, PixelValue &pic
|
||||
if(m_TexDisplay.flipY)
|
||||
y = (texptr->height - 1) - y;
|
||||
|
||||
x = qMax(0U, x >> m_TexDisplay.mip);
|
||||
y = qMax(0U, y >> m_TexDisplay.mip);
|
||||
|
||||
pickValue = m_Output->PickPixel(m_TexDisplay.resourceId, true, x, y, m_TexDisplay.sliceFace,
|
||||
m_TexDisplay.mip, m_TexDisplay.sampleIdx);
|
||||
|
||||
|
||||
@@ -3160,8 +3160,8 @@ void D3D11Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t
|
||||
texDisplay.resourceId = texture;
|
||||
texDisplay.typeHint = typeHint;
|
||||
texDisplay.rawOutput = true;
|
||||
texDisplay.xOffset = -float(x);
|
||||
texDisplay.yOffset = -float(y);
|
||||
texDisplay.xOffset = -float(x << mip);
|
||||
texDisplay.yOffset = -float(y << mip);
|
||||
|
||||
RenderTextureInternal(texDisplay, false);
|
||||
}
|
||||
|
||||
@@ -1720,8 +1720,8 @@ void D3D12Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t
|
||||
texDisplay.resourceId = texture;
|
||||
texDisplay.typeHint = typeHint;
|
||||
texDisplay.rawOutput = true;
|
||||
texDisplay.xOffset = -float(x);
|
||||
texDisplay.yOffset = -float(y);
|
||||
texDisplay.xOffset = -float(x << mip);
|
||||
texDisplay.yOffset = -float(y << mip);
|
||||
|
||||
RenderTextureInternal(GetDebugManager()->GetCPUHandle(PICK_PIXEL_RTV), texDisplay,
|
||||
eTexDisplay_F32Render);
|
||||
|
||||
@@ -2361,8 +2361,8 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl
|
||||
texDisplay.resourceId = texture;
|
||||
texDisplay.typeHint = typeHint;
|
||||
texDisplay.rawOutput = true;
|
||||
texDisplay.xOffset = -float(x);
|
||||
texDisplay.yOffset = -float(y);
|
||||
texDisplay.xOffset = -float(x << mip);
|
||||
texDisplay.yOffset = -float(y << mip);
|
||||
|
||||
RenderTextureInternal(texDisplay, eTexDisplay_MipShift);
|
||||
|
||||
|
||||
@@ -752,8 +752,8 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_
|
||||
texDisplay.resourceId = texture;
|
||||
texDisplay.typeHint = typeHint;
|
||||
texDisplay.rawOutput = true;
|
||||
texDisplay.xOffset = -float(x);
|
||||
texDisplay.yOffset = -float(y);
|
||||
texDisplay.xOffset = -float(x << mip);
|
||||
texDisplay.yOffset = -float(y << mip);
|
||||
|
||||
// only render green (stencil) in second pass
|
||||
if(pass == 1)
|
||||
|
||||
Reference in New Issue
Block a user