-
Notifications
You must be signed in to change notification settings - Fork 126
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
VDR: Fix vertex offset in indirect draw calls #1984
base: dev
Are you sure you want to change the base?
VDR: Fix vertex offset in indirect draw calls #1984
Conversation
CI gfxreconstruct build queued with queue ID 354749. |
CI gfxreconstruct build # 5917 running. |
CI gfxreconstruct build # 5917 passed. |
@@ -1553,9 +1558,14 @@ VkResult DrawCallsDumpingContext::DumpVertexIndexBuffers(uint64_t qs_index, uint | |||
abs_index_count = indirect_index_count + indirect_first_index; | |||
} | |||
|
|||
if (greatest_vertex_offset < i_params.draw_indexed_params[d].vertexOffset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the vertex offset not be stored along in index_count_first_index_pairs (well, not as pair, but as struct or tuple)?
Would be much shorter and not need this min/max computation and be more precise.
So if I understood what the code is doing correctly, in FindMinMaxVertexIndices function, you are processing the index buffer to find the minimum and maximum indices used in the range of the index data. Then, you are adding the vertex offset to the min and max values for the index range. When you add different offsets to the min and max, you essentially expand the range incorrectly, as you are applying two different offsets. You should be applying a single vertex offset to both the min and max values. The offsets you add should be uniform for both min and max, based on the range of indices you are processing. I think it should calculate the min and max indices first then apply the vertex offset for that specific draw call to the indices. Then track the overall min and max indices across all draw calls comparing the adjusted values. |
Correct.
I think I understand what you mean and I think you are right. I updated the patch accordingly |
00c42d9
to
bcc5726
Compare
CI gfxreconstruct build queued with queue ID 359227. |
CI gfxreconstruct build # 5961 running. |
CI gfxreconstruct build # 5961 passed. |
Could you also pass the original binary file offset? (bufferOffset) The vertexOffset is relative to the buffer segment for that draw, but the actual data in binary file may be in different location. |
What do you mean with |
No, I'm looking for the absolute offset within the original binary file where the vertex buffer data starts. (I just referred as "bufferOffset") Maybe within the "parameters" or inside "vertexBuffers in api json? (fileOffset is what I meant. We need to have for both index buffer and vertex buffer file offset to handle indirect draw calls since it contains multiple draws I need to parse.)
Here are the steps of my parsing, (FYI) |
No description provided.