Fixed maxVertex value

Following specification: maxVertex is the highest index of a vertex that will be addressed by a build command using this structure.
This commit is contained in:
mlefrancois 2023-08-30 10:39:32 +02:00
parent 12e17c280e
commit ef1c1e25d6
20 changed files with 21 additions and 21 deletions

View file

@ -604,7 +604,7 @@ triangles.indexType = VK_INDEX_TYPE_UINT32;
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = uint32_t(vertices.size()); triangles.maxVertex = uint32_t(vertices.size()) - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -301,7 +301,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -75,7 +75,7 @@ auto Raytracer::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexType = VK_INDEX_TYPE_UINT32; triangles.indexType = VK_INDEX_TYPE_UINT32;
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
triangles.transformData = {}; triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Setting up the build info of the acceleration // Setting up the build info of the acceleration
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -615,7 +615,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -622,7 +622,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -624,7 +624,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -617,7 +617,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -659,7 +659,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -618,7 +618,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -229,7 +229,7 @@ auto HelloVulkan::primitiveToGeometry(const nvh::GltfPrimMesh& prim)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = prim.vertexCount; triangles.maxVertex = prim.vertexCount - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -606,7 +606,7 @@ auto HelloVulkan::primitiveToVkGeometry(const nvh::GltfPrimMesh& prim)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = prim.vertexCount; triangles.maxVertex = prim.vertexCount - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -631,7 +631,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};
@ -767,7 +767,7 @@ void HelloVulkan::createLanternModel()
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = uint32_t(vertices.size()); triangles.maxVertex = uint32_t(vertices.size()) - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -619,7 +619,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -630,7 +630,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -617,7 +617,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -624,7 +624,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -616,7 +616,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -618,7 +618,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -615,7 +615,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};

View file

@ -618,7 +618,7 @@ auto HelloVulkan::objectToVkGeometryKHR(const ObjModel& model)
triangles.indexData.deviceAddress = indexAddress; triangles.indexData.deviceAddress = indexAddress;
// Indicate identity transform by setting transformData to null device pointer. // Indicate identity transform by setting transformData to null device pointer.
//triangles.transformData = {}; //triangles.transformData = {};
triangles.maxVertex = model.nbVertices; triangles.maxVertex = model.nbVertices - 1;
// Identify the above data as containing opaque triangles. // Identify the above data as containing opaque triangles.
VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}; VkAccelerationStructureGeometryKHR asGeom{VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR};