RenderDoc 中有显示缓冲区内容为浮点数的方法吗?

huangapple go评论48阅读模式
英文:

Is there any way to display buffer contents in float by renderdoc?

问题

I am learning vulkan and I passed a ubo to shader.
When I look over the buffer contents of that ubo by renderdoc, I get the contents in hexadecimal.
hexadecimal image.
This is the ubo.

layout(binding=0) uniform Ubo
{
	vec4 color;
	mat4 scale;
} ubo;

Is there any way to display buffer contents in float?

I have checked almost every option of renderdoc and searched the answer by google and AI but no solution.
I wonder if there is an option I ignored or any other way to solve this problem.

Sorry for poor English.

英文:

I am learning vulkan and I passed a ubo to shader.
When I look over the buffer contents of that ubo by renderdoc, I get the contents in hexadecimal.
hexadecimal image.
This is the ubo.

layout(binding=0) uniform Ubo
{
	vec4 color;
	mat4 scale;
} ubo;

Is there any way to display buffer contents in float?

I have checked almost every option of renderdoc and searched the answer by google and AI but no solution.
I wonder if there is an option I ignored or any other way to solve this problem.

Sorry for poor english.

答案1

得分: 0

你可以指定常量缓冲区的自定义格式。它的图标是两个花括号(像这样:{})。

RenderDoc 中有显示缓冲区内容为浮点数的方法吗?

您将获得一个窗口,可以在其中编写您的自定义格式。在您的情况下,您可以编写无限制的浮点数组,如下所示:

struct Ubo
{
    float arr[];
};

请注意,您可以对其他类型的缓冲区使用相同的自定义格式说明符。

英文:

You can specify the custom format for a constant buffer. Its icon is two curly brackets (like this: {}).

RenderDoc 中有显示缓冲区内容为浮点数的方法吗?

You will get a window where you can write your custom format. In your case you would write unbounded float array like this:

struct Ubo
{
    float arr[];
};

Note you have the same custom format specifier for other types of buffers, not just constant ones.

huangapple
  • 本文由 发表于 2023年3月8日 16:08:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75670615.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定