Skip to content

Commit

Permalink
Remove unused submitID tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed Dec 13, 2024
1 parent 128f50c commit abb7ed0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 69 deletions.
39 changes: 9 additions & 30 deletions source_common/trackers/layer_command_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ LCSRenderPass::LCSRenderPass(

/* See header for details. */
std::string LCSRenderPass::getBeginMetadata(
const std::string* debugLabel,
uint64_t submitID) const
const std::string* debugLabel) const
{
// Draw count for a multi-submit command buffer cannot be reliably
// associated with a single tagID if restartable across command buffer
Expand All @@ -96,11 +95,6 @@ std::string LCSRenderPass::getBeginMetadata(
{ "drawCallCount", drawCount }
};

if (submitID != 0)
{
metadata["sid"] = submitID;
}

if (debugLabel && debugLabel->size())
{
metadata["label"] = *debugLabel;
Expand Down Expand Up @@ -147,8 +141,7 @@ std::string LCSRenderPass::getBeginMetadata(
/* See header for details. */
std::string LCSRenderPass::getContinuationMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID) const
uint64_t tagIDContinuation) const
{
json metadata = {
{ "type", "renderpass" },
Expand All @@ -161,28 +154,22 @@ std::string LCSRenderPass::getContinuationMetadata(
metadata["label"] = *debugLabel;
}

if (submitID != 0)
{
metadata["sid"] = submitID;
}

return metadata.dump();
}

/* See header for details. */
std::string LCSRenderPass::getMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID) const
uint64_t tagIDContinuation) const
{
if (tagID)
{
assert(tagIDContinuation == 0);
return getBeginMetadata(debugLabel, submitID);
return getBeginMetadata(debugLabel);
}

assert(tagIDContinuation != 0);
return getContinuationMetadata(debugLabel, tagIDContinuation, submitID);
return getContinuationMetadata(debugLabel, tagIDContinuation);
}

/* See header for details. */
Expand All @@ -203,11 +190,9 @@ LCSDispatch::LCSDispatch(
/* See header for details. */
std::string LCSDispatch::getMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID
uint64_t tagIDContinuation
) const {
UNUSED(tagIDContinuation);
UNUSED(submitID);

json metadata = {
{ "type", "dispatch" },
Expand Down Expand Up @@ -243,11 +228,9 @@ LCSTraceRays::LCSTraceRays(
/* See header for details. */
std::string LCSTraceRays::getMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID
uint64_t tagIDContinuation
) const {
UNUSED(tagIDContinuation);
UNUSED(submitID);

json metadata = {
{ "type", "tracerays" },
Expand Down Expand Up @@ -281,11 +264,9 @@ LCSImageTransfer::LCSImageTransfer(
/* See header for details. */
std::string LCSImageTransfer::getMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID
uint64_t tagIDContinuation
) const {
UNUSED(tagIDContinuation);
UNUSED(submitID);

json metadata = {
{ "type", "imagetransfer" },
Expand Down Expand Up @@ -318,11 +299,9 @@ LCSBufferTransfer::LCSBufferTransfer(
/* See header for details. */
std::string LCSBufferTransfer::getMetadata(
const std::string* debugLabel,
uint64_t tagIDContinuation,
uint64_t submitID
uint64_t tagIDContinuation
) const {
UNUSED(tagIDContinuation);
UNUSED(submitID);

json metadata = {
{ "type", "buffertransfer" },
Expand Down
28 changes: 9 additions & 19 deletions source_common/trackers/layer_command_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const = 0;
uint64_t tagIDContinuation=0) const = 0;

/**
* @brief Get this workloads tagID.
Expand Down Expand Up @@ -151,18 +150,15 @@ class LCSRenderPass : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

private:
std::string getBeginMetadata(
const std::string* debugLabel=nullptr,
uint64_t submitID=0) const;
const std::string* debugLabel=nullptr) const;

std::string getContinuationMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

uint32_t width;

Expand Down Expand Up @@ -195,8 +191,7 @@ class LCSDispatch : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

private:
int64_t xGroups;
Expand All @@ -220,8 +215,7 @@ class LCSTraceRays : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

private:
int64_t xItems;
Expand All @@ -244,8 +238,7 @@ class LCSImageTransfer : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

private:
std::string transferType;
Expand All @@ -267,8 +260,7 @@ class LCSBufferTransfer : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const;
uint64_t tagIDContinuation=0) const;

private:
std::string transferType;
Expand All @@ -288,12 +280,10 @@ class LCSMarker : public LCSWorkload

virtual std::string getMetadata(
const std::string* debugLabel=nullptr,
uint64_t tagIDContinuation=0,
uint64_t submitID=0) const
uint64_t tagIDContinuation=0) const
{
UNUSED(debugLabel);
UNUSED(tagIDContinuation);
UNUSED(submitID);
return label;
};

Expand Down
11 changes: 6 additions & 5 deletions source_common/trackers/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@

namespace Tracker
{
/* See header for details. */
std::atomic<uint64_t> Queue::nextSubmitID { 1 };

/* See header for details. */
Queue::Queue(
VkQueue _handle):
handle(_handle) { };
VkQueue _handle
):
handle(_handle)
{

};

/* See header for details. */
void Queue::runSubmitCommandStream(
Expand Down
15 changes: 0 additions & 15 deletions source_common/trackers/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ class Queue
const std::vector<LCSInstruction>& stream,
std::function<void(const std::string&)> callback);

/**
* @brief Get a unique submitID to label a command buffer submit.
*
* @return The assigned ID.
*/
static uint64_t assignSubmitID()
{
return nextSubmitID.fetch_add(1, std::memory_order_relaxed);
}

private:
/**
* The handle of the native queue we are wrapping.
Expand All @@ -97,11 +87,6 @@ class Queue
* @brief The last non-zero render pass tagID submitted.
*/
uint64_t lastRenderPassTagID { 0 };

/**
* @brief The command buffer submitID allocator.
*/
static std::atomic<uint64_t> nextSubmitID;
};

}

0 comments on commit abb7ed0

Please sign in to comment.