Debugging meshlets
This commit is contained in:
@@ -29,10 +29,10 @@ void taskMain(
|
||||
localToView = mul(pViewParams.viewMatrix, instance.transformMatrix);
|
||||
float3 origin = float3(0, 0, 0);
|
||||
float3 corners[4] = {
|
||||
screenToView(float4(100.0f, 100.0f, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(pViewParams.screenDimensions.x - 100.0f, 100.0f, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(100.0f, pViewParams.screenDimensions.y - 100.0f, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(pViewParams.screenDimensions - float2(100.0f, 100.0f), -1.0f, 1.0f)).xyz
|
||||
screenToView(float4(0.0f, 0.0f, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(pViewParams.screenDimensions.x, 0.0f, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(0.0f, pViewParams.screenDimensions.y, -1.0f, 1.0f)).xyz,
|
||||
screenToView(float4(pViewParams.screenDimensions, -1.0f, 1.0f)).xyz
|
||||
};
|
||||
viewFrustum.sides[0] = computePlane(origin, corners[2], corners[0]);
|
||||
viewFrustum.sides[1] = computePlane(origin, corners[1], corners[3]);
|
||||
@@ -90,8 +90,6 @@ void meshMain(
|
||||
indices[p] = uint3(local_idx0, local_idx1, local_idx2);
|
||||
}
|
||||
}
|
||||
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
for(uint i = threadID; i < MAX_VERTICES; i+=MESH_GROUP_SIZE)
|
||||
{
|
||||
uint v = min(i, m.vertexCount - 1);
|
||||
|
||||
@@ -2,7 +2,7 @@ import Bounding;
|
||||
|
||||
struct MeshletDescription
|
||||
{
|
||||
AABB bounding;
|
||||
BoundingSphere bounding;
|
||||
uint32_t vertexCount;
|
||||
uint32_t primitiveCount;
|
||||
uint32_t vertexOffset;
|
||||
@@ -13,7 +13,7 @@ struct MeshletDescription
|
||||
|
||||
struct MeshData
|
||||
{
|
||||
AABB bounding;
|
||||
BoundingSphere bounding;
|
||||
uint32_t numMeshlets;
|
||||
uint32_t meshletOffset;
|
||||
uint32_t firstIndex;
|
||||
|
||||
@@ -164,7 +164,7 @@ void VertexData::loadMesh(MeshId id, Array<uint32> loadedIndices, Array<Meshlet>
|
||||
primitiveIndices.resize(primitiveOffset + (m.numPrimitives * 3));
|
||||
std::memcpy(primitiveIndices.data() + primitiveOffset, m.primitiveLayout, m.numPrimitives * 3 * sizeof(uint8));
|
||||
meshlets.add(MeshletDescription{
|
||||
.bounding = m.boundingBox,//.toSphere(),
|
||||
.bounding = m.boundingBox.toSphere(),
|
||||
.vertexCount = m.numVertices,
|
||||
.primitiveCount = m.numPrimitives,
|
||||
.vertexOffset = vertexOffset,
|
||||
@@ -173,7 +173,7 @@ void VertexData::loadMesh(MeshId id, Array<uint32> loadedIndices, Array<Meshlet>
|
||||
});
|
||||
}
|
||||
meshData[id].add(MeshData{
|
||||
.bounding = meshAABB,//.toSphere(),
|
||||
.bounding = meshAABB.toSphere(),
|
||||
.numMeshlets = numMeshlets,
|
||||
.meshletOffset = meshletOffset,
|
||||
.indicesOffset = (uint32)meshOffsets[id],
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
};
|
||||
struct MeshData
|
||||
{
|
||||
AABB bounding;
|
||||
BoundingSphere bounding;
|
||||
uint32 numMeshlets = 0;
|
||||
uint32 meshletOffset = 0;
|
||||
uint32 firstIndex = 0;
|
||||
@@ -85,7 +85,7 @@ protected:
|
||||
VertexData();
|
||||
struct MeshletDescription
|
||||
{
|
||||
AABB bounding;
|
||||
BoundingSphere bounding;
|
||||
uint32_t vertexCount;
|
||||
uint32_t primitiveCount;
|
||||
uint32_t vertexOffset;
|
||||
|
||||
Reference in New Issue
Block a user