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

triangles.maxVertex seems to get a wrong value #11

Closed
shiuang opened this issue Jul 14, 2021 · 3 comments
Closed

triangles.maxVertex seems to get a wrong value #11

shiuang opened this issue Jul 14, 2021 · 3 comments

Comments

@shiuang
Copy link

shiuang commented Jul 14, 2021

In

triangles.maxVertex = static_cast<uint32_t>(objVertices.size() - 1);

objVertices.size() - 1 is assigned to triangles.maxVertex. Since objVertices is a vector of floats instead of a vector of vertices, the size of objVertices indicates total number of floats (3x number of vertices).

In Vulkan specs

maxVertex is the highest index of a vertex that will be addressed by a build command using this structure.

So objVertices.size() / 3 - 1 should be the correct value if I got it right.

BTW, it is also confusing that Vulkan uses highest index of a vertex instead of number of vertices, while the DirectX API uses VertexCount in D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC struct. Does anyone know why?

@NBickford-NV
Copy link
Contributor

Hi shiuang! I think you're correct - I've fixed this upstream, and this should be included in the next nvpro-samples bulk update (I'll close the issue then). I don't know about the VertexCount difference, unfortunately!

@shiuang
Copy link
Author

shiuang commented Aug 6, 2021

Thank you for your reply, NeilBickford-NV.

@NBickford-NV
Copy link
Contributor

Alright, this has been fixed in commit 5cf2ea9 - thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants