mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 07:26:34 +00:00
Ignore bound index buffer for non-indexed draws, apply vertexOffset
This commit is contained in:
@@ -74,7 +74,7 @@ def fetch_indices(controller: rd.ReplayController, mesh: rd.MeshFormat, index_of
|
||||
mesh.indexByteStride*num_indices)
|
||||
|
||||
# Unpack all the indices
|
||||
indices = struct.unpack(index_fmt, ibdata)
|
||||
indices = struct.unpack_from(index_fmt, ibdata)
|
||||
|
||||
# Apply the baseVertex offset
|
||||
return [i + mesh.baseVertex for i in indices]
|
||||
@@ -88,7 +88,7 @@ class MeshAttribute:
|
||||
name: str
|
||||
|
||||
|
||||
def get_vsin_attrs(controller: rd.ReplayController, index_mesh: rd.MeshFormat):
|
||||
def get_vsin_attrs(controller: rd.ReplayController, vertexOffset: int, index_mesh: rd.MeshFormat):
|
||||
pipe: rd.PipeState = controller.GetPipelineState()
|
||||
inputs: List[rd.VertexInputAttribute] = pipe.GetVertexInputs()
|
||||
|
||||
@@ -107,7 +107,7 @@ def get_vsin_attrs(controller: rd.ReplayController, index_mesh: rd.MeshFormat):
|
||||
attr.mesh.instStepRate = a.instanceRate
|
||||
attr.mesh.instanced = a.perInstance
|
||||
attr.mesh.vertexResourceId = vbs[a.vertexBuffer].resourceId
|
||||
attr.mesh.vertexByteOffset = vbs[a.vertexBuffer].byteOffset + a.byteOffset
|
||||
attr.mesh.vertexByteOffset = vbs[a.vertexBuffer].byteOffset + a.byteOffset + vertexOffset * attr.mesh.vertexByteStride
|
||||
|
||||
attr.mesh.format = a.format
|
||||
|
||||
|
||||
@@ -266,7 +266,12 @@ class TestCase:
|
||||
mesh.indexResourceId = ib.resourceId
|
||||
mesh.baseVertex = draw.baseVertex
|
||||
|
||||
attrs = analyse.get_vsin_attrs(self.controller, mesh)
|
||||
if not (draw.flags & rd.DrawFlags.Indexed):
|
||||
mesh.indexByteOffset = 0
|
||||
mesh.indexByteStride = 0
|
||||
mesh.indexResourceId = rd.ResourceId.Null()
|
||||
|
||||
attrs = analyse.get_vsin_attrs(self.controller, draw.vertexOffset, mesh)
|
||||
|
||||
first_index = min(first_index, draw.numIndices-1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user