The histogram visualization seems to re-use the values from the previous custom shader once after modifying the custom shader when changing mipmap levels.
Note that the histogram itself does update when changing levels, just to the value for the previous custom shader. Furthermore, the incorrect set of values is only used once, becoming correct after switching away from the new mipmap level and back again. This only seems to happen if both the texture viewer and shader editor are visible at the same time. Also, the selected mipmap level is immediately updated; it's only the other mipmap levels that exhibit this behavior.
Steps to reproduce
Load a capture that contains a texture with multiple mipmap levels.
Select a texture with multiple mipmap levels.
Set channels to "custom".
Enter a name for the custom shader, and then click the "+". I used a GLSL shader.
Drag the "editing fragment shader" tab and dock it on the side of the screen so that both it and the texture viewer are visible at the same time (this is required; the issue does not happen if you need to switch tabs to see the texture viewer).
Click "refresh". The texture viewer and histogram should immediately update.
Scroll through all of the mipmaps. Observe that the histogram is that of the original shader (a changing line and a line at 0), not that of the new shader (4 distinct lines).
Scroll through all of the mipmaps again. Observe that the histogram is now correct.
Environment
RenderDoc version: v1.24
Operating System: Windows 10.0.19044.2486
Graphics API: Vulkan (I have not tested other APIs, but it probably affects them, although the shader may need changes)
Thanks for the report. This was an order-of-operations problem, it wasn't refreshing the rendered custom shader for a new mip level before fetching the histogram data. That commit should fix the issue.
Description
The histogram visualization seems to re-use the values from the previous custom shader once after modifying the custom shader when changing mipmap levels.
Note that the histogram itself does update when changing levels, just to the value for the previous custom shader. Furthermore, the incorrect set of values is only used once, becoming correct after switching away from the new mipmap level and back again. This only seems to happen if both the texture viewer and shader editor are visible at the same time. Also, the selected mipmap level is immediately updated; it's only the other mipmap levels that exhibit this behavior.
Steps to reproduce
Enter the following as the shader:
Change the shader to this:
Environment