如果我使用带有偏移量的 16 位索引,ID3D11DeviceContext::DrawIndexed() 是否具有 UB?
ID3D11DeviceContext::DrawIndexed()
有一个参数StartIndexLocation
,该参数在绘制时为每个Index 添加一个值。
如果我使用 16 位索引会发生什么?
16 位可以表示的最高值是 65535。如果我的绘制调用有 10000 个顶点并且我使用 65000 的 StartIndexLocation
会怎样?它会调用 UB 吗?
ID3D11DeviceContext::DrawIndexed()
has a parameter StartIndexLocation
, which adds a value to each Index when drawing.
What happens if I use 16 bit Indices ?
The highest value 16 bit can represent is 65535. What If my Draw Call has 10000 vertices and I use a StartIndexLocation
of 65000 ? Will it invoke UB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
StartIndexLocation 不是字节位置,而是索引位置。交叉引用 DirectX 索引缓冲区 -> Start of Index Buffer
所以StartIndexLocation的最大值与Index Buffer的stride无关。
StartIndexLocation is not a byte-position, but an Index position. Cross reference DirectX Index Buffer -> Start of Index Buffer
So the maximum StartIndexLocation is not related to the stride of the Index Buffer.