2024-08-28 17:54:14 +02:00
|
|
|
#include "Query.h"
|
|
|
|
|
#include "Buffer.h"
|
|
|
|
|
#include "Command.h"
|
|
|
|
|
#include "Containers/Array.h"
|
|
|
|
|
#include "Enums.h"
|
|
|
|
|
#include "Graphics.h"
|
2024-09-16 13:00:53 +02:00
|
|
|
#include "Graphics/Query.h"
|
2024-08-28 17:54:14 +02:00
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
|
|
|
|
|
|
using namespace Seele;
|
|
|
|
|
using namespace Seele::Metal;
|
|
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
QueryPool::QueryPool(PGraphics graphics, const std::string&) : graphics(graphics) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
QueryPool::~QueryPool() {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
void QueryPool::begin() {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
void QueryPool::end() {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
void QueryPool::getQueryResults(Array<uint64>&) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
OcclusionQuery::OcclusionQuery(PGraphics graphics, const std::string& name) : QueryPool(graphics, name) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
|
|
|
|
OcclusionQuery::~OcclusionQuery() {}
|
|
|
|
|
|
|
|
|
|
void OcclusionQuery::beginQuery() { begin(); }
|
|
|
|
|
|
|
|
|
|
void OcclusionQuery::endQuery() { end(); }
|
|
|
|
|
|
|
|
|
|
Gfx::OcclusionResult OcclusionQuery::getResults() {
|
|
|
|
|
Array<uint64> result(1);
|
|
|
|
|
getQueryResults(result);
|
|
|
|
|
return Gfx::OcclusionResult{
|
|
|
|
|
.numFragments = result[0],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
PipelineStatisticsQuery::PipelineStatisticsQuery(PGraphics graphics, const std::string& name) : QueryPool(graphics, name) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
|
|
|
|
PipelineStatisticsQuery::~PipelineStatisticsQuery() {}
|
|
|
|
|
|
|
|
|
|
void PipelineStatisticsQuery::beginQuery() { begin(); }
|
|
|
|
|
|
|
|
|
|
void PipelineStatisticsQuery::endQuery() { end(); }
|
|
|
|
|
|
|
|
|
|
Gfx::PipelineStatisticsResult PipelineStatisticsQuery::getResults() {
|
|
|
|
|
Array<uint64> result(9);
|
|
|
|
|
getQueryResults(result);
|
|
|
|
|
return Gfx::PipelineStatisticsResult{
|
|
|
|
|
.inputAssemblyVertices = result[0],
|
|
|
|
|
.inputAssemblyPrimitives = result[1],
|
|
|
|
|
.vertexShaderInvocations = result[2],
|
|
|
|
|
.clippingInvocations = result[3],
|
|
|
|
|
.clippingPrimitives = result[4],
|
|
|
|
|
.fragmentShaderInvocations = result[5],
|
|
|
|
|
.computeShaderInvocations = result[6],
|
|
|
|
|
.taskShaderInvocations = result[7],
|
|
|
|
|
.meshShaderInvocations = result[8],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
TimestampQuery::TimestampQuery(PGraphics graphics, const std::string& name, uint32) : QueryPool(graphics, name) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
|
|
|
|
TimestampQuery::~TimestampQuery() {}
|
|
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
void TimestampQuery::write(Gfx::SePipelineStageFlagBits, const std::string&) {}
|
2024-08-28 17:54:14 +02:00
|
|
|
|
2024-09-16 13:00:53 +02:00
|
|
|
Gfx::Timestamp TimestampQuery::getResult() {
|
|
|
|
|
return Gfx::Timestamp{
|
|
|
|
|
.name = "Test",
|
|
|
|
|
.time = 0,
|
|
|
|
|
};
|
2024-08-28 17:54:14 +02:00
|
|
|
}
|