mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-14 01:35:36 +00:00
Fix GL & Vulkan selected slice clamping. Closes #1366
This commit is contained in:
@@ -368,11 +368,15 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags)
|
||||
ubo->MipLevel = (int)cfg.mip;
|
||||
if(texDetails.curType != eGL_TEXTURE_3D)
|
||||
{
|
||||
ubo->Slice = (float)cfg.sliceFace + 0.001f;
|
||||
uint32_t numSlices =
|
||||
RDCMAX((uint32_t)texDetails.depth, 1U) * RDCMAX((uint32_t)texDetails.samples, 1U);
|
||||
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, numSlices - 1);
|
||||
ubo->Slice = (float)sliceFace + 0.001f;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, uint32_t(texDetails.samples - 1));
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, RDCMAX((uint32_t)texDetails.depth, 1U) - 1);
|
||||
ubo->Slice = (float)(sliceFace >> cfg.mip);
|
||||
}
|
||||
|
||||
|
||||
@@ -275,11 +275,15 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
|
||||
data->Slice = 0;
|
||||
if(iminfo.type != VK_IMAGE_TYPE_3D)
|
||||
{
|
||||
data->Slice = (float)cfg.sliceFace + 0.001f;
|
||||
uint32_t numSlices =
|
||||
RDCMAX((uint32_t)iminfo.arrayLayers, 1U) * RDCMAX((uint32_t)iminfo.samples, 1U);
|
||||
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, numSlices - 1);
|
||||
data->Slice = (float)sliceFace + 0.001f;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, uint32_t(iminfo.samples - 1));
|
||||
uint32_t sliceFace = RDCCLAMP(cfg.sliceFace, 0U, iminfo.extent.depth - 1);
|
||||
data->Slice = (float)(sliceFace >> cfg.mip);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user