Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some vertex attributes and buffers are not displayed in pipeline state window #3379

Closed
shmadchenko opened this issue Jul 8, 2024 · 7 comments
Assignees
Labels
Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation

Comments

@shmadchenko
Copy link

Description

Some vertex attributes and buffers are not displayed in the pipeline state window.
The problem occurs when attribute location value is larger than number of stage inputs.

Steps to reproduce

Open attached capture file capture.zip.
Select vkCmdDrawIndexed command in event browser (EID 12)
Open pipeline state window
Open vertex input stage in pipeline window

Expected

The attributes section displays two entries

in.var.POSITION (location: 0, binding: 0)
in.var.COLOR (location: 2, binding: 1)

The buffers section displays three entries

index buffer
vertex buffers (slot: 0)
vertex buffers (slot: 1)

Actual

The attributes section displays one entry

in.var.POSITION (location: 0, binding: 0)

The buffers section displays two entries

index buffer
vertex buffers (slot: 0)

Environment

RenderDoc version: 1.33
OS: Windows 10
Graphics API: Vulkan (1.3.250.1 VK_API_VERSION_1_3)

@Zorro666 Zorro666 added Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation Need More Info More information is needed from a user to work on this issue and removed Unresolved Waiting for a fix or implementation labels Jul 8, 2024
@Zorro666
Copy link
Collaborator

Zorro666 commented Jul 8, 2024

Please can you double check your application. From what I can see in the capture file : nothing is bound to vertex buffer location 2 which is why it isn't showing. The capture only appears to bind to vertex buffer 0, 1 (unused) and the index buffer.

image

@shmadchenko
Copy link
Author

I apologize in advance, my English is not very good.

EID 5: Bind vertex buffer (Buffer 164) to binding #1
This is the stub vertex buffer with data that is not in the mesh vertex buffer.
In this particular case, the color value is taken from it.
The stub buffer intended to be reused with different draws, so it is bound in advance.

EID 9: Bind pipeline
Note that pipeline was created with vertex input state that contains

2 vertex binidig descriptions
    [0] (binding 0) : mesh vertex buffer
    [1] (binding 1) : stub vertex beffer
2 attribute descriptions
    [0] (location 0 binding 0) : position
    [1] (location 2 binding 1) : color

EID 10: Bind vertex buffer (Buffer 167) to binding #0
This is the mesh vertex buffer.
In this particular case, the position value is taken from it.
There is no color value in it.

Both buffers are bound and used.
You can see red color that come from the stub buffer.
But I don't see either the the buffer or the color attribute whose value comes from this buffer.

When I change the location value for the color attribute from 2 to 1, the problem goes away.

I tried to track the problem in the debugger.
Not sure if this will be useful, but you can see that the attribute is ignored in
VulkanPipelineStateViewer.cpp:1843

if(attrib < state.vertexShader.reflection->inputSignature.size())
{
name = state.vertexShader.reflection->inputSignature[attrib].varName;
usedSlot = true;
}

For your convenience, I have modified code and take an additional capture.
In this case, both buffers are bound at the same time (EID 9).
But the problem is still there.
capture_2.zip

Also I tried looking in Nvidia Nsight.
There is no such problem there.
Both buffer and attribute are displayed
image

@shmadchenko
Copy link
Author

You can see that both attributes are present, but according to the condition, the second attribute is not displayed

image

@shmadchenko
Copy link
Author

I just realized that the buffer and the attribute are displayed if you enable 'Show Unused Items' option 😐
But even in this case it looks like a bug.
Because the buffer and attribute are used in fact.
The color value is passed from the stub buffer to the color attribute (red color)

@shmadchenko
Copy link
Author

I re-read your message again.
Perhaps I didn't fully understand.

nothing is bound to vertex buffer location 2
The capture only appears to bind to vertex buffer 0, 1

Buffers are bound to binding.
Location is used to refer to attributes.
There are no relation between them.
But in the process of creating a pipeline, we specify this relationship with VkPipelineVertexInputStateCreateInfo structure.
In this case
buffer at binding 0 used for attribute at location 0
buffer at binding 1 used for attribute at location 2

@Zorro666 Zorro666 added Unresolved Waiting for a fix or implementation and removed Need More Info More information is needed from a user to work on this issue labels Jul 9, 2024
Zorro666 added a commit to Zorro666/renderdoc that referenced this issue Jul 9, 2024
@Zorro666
Copy link
Collaborator

Zorro666 commented Jul 9, 2024

Sorry I was mistaken. You were right that code segment was wrong using the location as the attribute index is not correct.

@Zorro666 Zorro666 self-assigned this Jul 9, 2024
@Zorro666
Copy link
Collaborator

Thank you for chasing it down. The commit is pushed and will be available in the next nightly build.

wzpsgit pushed a commit to wzpsgit/renderdoc that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation
Projects
None yet
Development

No branches or pull requests

2 participants