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:
baldurk committed 2019-11-13 10:05:30 +00:00
1 parent c497446524
commit 3fbb9ee7ad
5 files changed
+11 -8

No files matched your search

+3
View File
@@ -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);