mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-02-21 18:54:18 +01:00
added asserts for a couple of hw bugs
This commit is contained in:
parent
093e35a961
commit
044b3be14c
@ -60,6 +60,7 @@ void clInsertNewCLMarker(ControlList* cl,
|
|||||||
marker.shaderRecBufOffset = 0;
|
marker.shaderRecBufOffset = 0;
|
||||||
marker.uniformsBufOffset = 0;
|
marker.uniformsBufOffset = 0;
|
||||||
marker.nextMarkerOffset = -1;
|
marker.nextMarkerOffset = -1;
|
||||||
|
marker.numDrawCallsSubmitted = 0;
|
||||||
|
|
||||||
//close current marker
|
//close current marker
|
||||||
if(cl->currMarkerOffset != -1 && !((CLMarker*)getCPAptrFromOffset(cl->CPA, cl->currMarkerOffset))->size)
|
if(cl->currMarkerOffset != -1 && !((CLMarker*)getCPAptrFromOffset(cl->CPA, cl->currMarkerOffset))->size)
|
||||||
|
@ -42,6 +42,8 @@ typedef struct CLMarker
|
|||||||
uint32_t width, height; //render w/h
|
uint32_t width, height; //render w/h
|
||||||
uint32_t mipLevel;
|
uint32_t mipLevel;
|
||||||
|
|
||||||
|
uint32_t numDrawCallsSubmitted;
|
||||||
|
|
||||||
//pointers that point to where all the other CL data is
|
//pointers that point to where all the other CL data is
|
||||||
//plus sizes
|
//plus sizes
|
||||||
//uint8_t* handlesBuf; //
|
//uint8_t* handlesBuf; //
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
static uint64_t lastFinishedSeqno = 0;
|
static uint64_t lastFinishedSeqno = 0;
|
||||||
static atomic_int lastSeqnoGuard = 0;
|
static atomic_int lastSeqnoGuard = 0;
|
||||||
|
|
||||||
|
#define VC4_HW_2116_COUNT 0x1ef0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#commandbuffers-pools
|
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#commandbuffers-pools
|
||||||
* Command pools are opaque objects that command buffer memory is allocated from, and which allow the implementation to amortize the
|
* Command pools are opaque objects that command buffer memory is allocated from, and which allow the implementation to amortize the
|
||||||
@ -132,7 +134,6 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateCommandBuffers)(
|
|||||||
|
|
||||||
pCommandBuffers[c]->graphicsPipeline = 0;
|
pCommandBuffers[c]->graphicsPipeline = 0;
|
||||||
pCommandBuffers[c]->computePipeline = 0;
|
pCommandBuffers[c]->computePipeline = 0;
|
||||||
pCommandBuffers[c]->numDrawCallsSubmitted = 0;
|
|
||||||
pCommandBuffers[c]->indexBuffer = 0;
|
pCommandBuffers[c]->indexBuffer = 0;
|
||||||
pCommandBuffers[c]->indexBufferOffset = 0;
|
pCommandBuffers[c]->indexBufferOffset = 0;
|
||||||
pCommandBuffers[c]->vertexBufferDirty = 1;
|
pCommandBuffers[c]->vertexBufferDirty = 1;
|
||||||
@ -662,6 +663,8 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueSubmit)(
|
|||||||
printf("perfmonID %u\n", submitCl.perfmonid);
|
printf("perfmonID %u\n", submitCl.perfmonid);
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
|
assert(marker->numDrawCallsSubmitted <= VC4_HW_2116_COUNT);
|
||||||
|
|
||||||
assert(submitCl.bo_handle_count > 0);
|
assert(submitCl.bo_handle_count > 0);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@ -673,6 +676,10 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueSubmit)(
|
|||||||
lastSeqnoGuard = 0;
|
lastSeqnoGuard = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//see if it's a sync bug
|
||||||
|
//uint64_t timeout = WAIT_TIMEOUT_INFINITE;
|
||||||
|
//vc4_seqno_wait(controlFd, &lastFinishedSeqno, queue->lastEmitSeqno, &timeout);
|
||||||
|
|
||||||
//advance in linked list
|
//advance in linked list
|
||||||
marker = marker->nextMarkerOffset == -1 ? 0 : getCPAptrFromOffset(cmdbuf->binCl.CPA, marker->nextMarkerOffset + cmdbuf->binCl.offset);
|
marker = marker->nextMarkerOffset == -1 ? 0 : getCPAptrFromOffset(cmdbuf->binCl.CPA, marker->nextMarkerOffset + cmdbuf->binCl.offset);
|
||||||
}
|
}
|
||||||
@ -889,7 +896,6 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandBuffer)(
|
|||||||
|
|
||||||
commandBuffer->graphicsPipeline = 0;
|
commandBuffer->graphicsPipeline = 0;
|
||||||
commandBuffer->computePipeline = 0;
|
commandBuffer->computePipeline = 0;
|
||||||
commandBuffer->numDrawCallsSubmitted = 0;
|
|
||||||
commandBuffer->indexBuffer = 0;
|
commandBuffer->indexBuffer = 0;
|
||||||
commandBuffer->indexBufferOffset = 0;
|
commandBuffer->indexBufferOffset = 0;
|
||||||
commandBuffer->vertexBufferDirty = 1;
|
commandBuffer->vertexBufferDirty = 1;
|
||||||
|
@ -382,8 +382,6 @@ typedef struct VkCommandBuffer_T
|
|||||||
|
|
||||||
_renderpass* currRenderPass;
|
_renderpass* currRenderPass;
|
||||||
|
|
||||||
uint32_t numDrawCallsSubmitted;
|
|
||||||
|
|
||||||
VkViewport viewport;
|
VkViewport viewport;
|
||||||
VkRect2D scissor;
|
VkRect2D scissor;
|
||||||
float lineWidth;
|
float lineWidth;
|
||||||
|
@ -584,6 +584,8 @@ void RPIFUNC(vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uin
|
|||||||
UNSUPPORTED(instancing);
|
UNSUPPORTED(instancing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert((firstVertex + vertexCount) <= ((1<<16) - 1));
|
||||||
|
|
||||||
drawCommon(commandBuffer, 0);
|
drawCommon(commandBuffer, 0);
|
||||||
|
|
||||||
_commandBuffer* cb = commandBuffer;
|
_commandBuffer* cb = commandBuffer;
|
||||||
@ -592,7 +594,7 @@ void RPIFUNC(vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uin
|
|||||||
clFit(commandBuffer, &commandBuffer->binCl, V3D21_VERTEX_ARRAY_PRIMITIVES_length);
|
clFit(commandBuffer, &commandBuffer->binCl, V3D21_VERTEX_ARRAY_PRIMITIVES_length);
|
||||||
clInsertVertexArrayPrimitives(&commandBuffer->binCl, firstVertex, vertexCount, getPrimitiveMode(cb->graphicsPipeline->topology));
|
clInsertVertexArrayPrimitives(&commandBuffer->binCl, firstVertex, vertexCount, getPrimitiveMode(cb->graphicsPipeline->topology));
|
||||||
|
|
||||||
cb->numDrawCallsSubmitted++;
|
((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->numDrawCallsSubmitted++;
|
||||||
|
|
||||||
PROFILEEND(RPIFUNC(vkCmdDraw));
|
PROFILEEND(RPIFUNC(vkCmdDraw));
|
||||||
}
|
}
|
||||||
@ -615,6 +617,8 @@ VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexed)(
|
|||||||
UNSUPPORTED(instancing);
|
UNSUPPORTED(instancing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert((firstIndex + indexCount) <= ((1<<16) - 1));
|
||||||
|
|
||||||
uint32_t maxIndex = drawCommon(commandBuffer, vertexOffset);
|
uint32_t maxIndex = drawCommon(commandBuffer, vertexOffset);
|
||||||
|
|
||||||
_commandBuffer* cb = commandBuffer;
|
_commandBuffer* cb = commandBuffer;
|
||||||
@ -634,7 +638,7 @@ VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexed)(
|
|||||||
1, //we only support 16 bit indices
|
1, //we only support 16 bit indices
|
||||||
getPrimitiveMode(cb->graphicsPipeline->topology));
|
getPrimitiveMode(cb->graphicsPipeline->topology));
|
||||||
|
|
||||||
cb->numDrawCallsSubmitted++;
|
((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->numDrawCallsSubmitted++;
|
||||||
|
|
||||||
PROFILEEND(RPIFUNC(vkCmdDrawIndexed));
|
PROFILEEND(RPIFUNC(vkCmdDrawIndexed));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user