diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index 49dd7ac1a..3f52bc3e9 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -894,6 +894,14 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV if(builtin == ShaderBuiltin::VertexIndex) { valueID = vertexIndexID; + // although for indexed draws we accounted for vertexOffset when looking up fixed + // function vertex inputs, we still need to apply it to the VertexIndex builtin here. + if(draw->flags & DrawFlags::Indexed) + { + valueID = + ops.add(rdcspv::OpIAdd(uint32ID, editor.MakeId(), valueID, + editor.AddConstantImmediate(draw->vertexOffset))); + } } else if(builtin == ShaderBuiltin::InstanceIndex) {