Skip to content

Commit a581a05

Browse files
committed
Removed begin/endQueryIndexed because it only is needed if we have TRANSFORM_FEEDBACK
1 parent 10b313e commit a581a05

File tree

6 files changed

+2
-143
lines changed

6 files changed

+2
-143
lines changed

include/nbl/asset/ICommandBuffer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,7 @@ class ICommandBuffer
313313
virtual bool endQuery(video::IQueryPool* queryPool, uint32_t query) {return false;}
314314
virtual bool copyQueryPoolResults(video::IQueryPool* queryPool, uint32_t firstQuery, uint32_t queryCount, buffer_t* dstBuffer, size_t dstOffset, size_t stride, video::IQueryPool::E_QUERY_RESULTS_FLAGS flags) {return false;}
315315
virtual bool writeTimestamp(asset::E_PIPELINE_STAGE_FLAGS pipelineStage, video::IQueryPool* queryPool, uint32_t query) {return false;}
316-
// TRANSFORM_FEEDBACK_STREAM
317-
virtual bool beginQueryIndexed(video::IQueryPool* queryPool, uint32_t query, uint32_t index, video::IQueryPool::E_QUERY_CONTROL_FLAGS flags = static_cast<video::IQueryPool::E_QUERY_CONTROL_FLAGS>(0)) {return false;}
318-
virtual bool endQueryIndexed(video::IQueryPool* queryPool, uint32_t query, uint32_t index) {return false;}
316+
319317
// Acceleration Structure Properties (Only available on Vulkan)
320318
virtual bool writeAccelerationStructureProperties(const core::SRange<video::IGPUAccelerationStructure>& pAccelerationStructures, video::IQueryPool::E_QUERY_TYPE queryType, video::IQueryPool* queryPool, uint32_t firstQuery) {return false;}
321319

src/nbl/video/COpenGLCommandBuffer.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,20 +1017,6 @@ COpenGLCommandBuffer::~COpenGLCommandBuffer()
10171017
gl->glQuery.pglQueryCounter(query, GL_TIMESTAMP);
10181018
}
10191019
break;
1020-
case impl::ECT_BEGIN_QUERY_INDEXED:
1021-
{
1022-
auto& c = cmd.get<impl::ECT_BEGIN_QUERY_INDEXED>();
1023-
const COpenGLQueryPool* qp = static_cast<const COpenGLQueryPool*>(c.queryPool.get());
1024-
qp->beginQueryIndexed(gl, c.query, c.index, c.flags);
1025-
}
1026-
break;
1027-
case impl::ECT_END_QUERY_INDEXED:
1028-
{
1029-
auto& c = cmd.get<impl::ECT_END_QUERY_INDEXED>();
1030-
const COpenGLQueryPool* qp = static_cast<const COpenGLQueryPool*>(c.queryPool.get());
1031-
qp->endQueryIndexed(gl, c.query, c.index);
1032-
}
1033-
break;
10341020
case impl::ECT_BIND_DESCRIPTOR_SETS:
10351021
{
10361022
auto& c = cmd.get<impl::ECT_BIND_DESCRIPTOR_SETS>();

src/nbl/video/COpenGLCommandBuffer.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ namespace impl
7171
ECT_END_QUERY,\
7272
ECT_COPY_QUERY_POOL_RESULTS,\
7373
ECT_WRITE_TIMESTAMP,\
74-
ECT_BEGIN_QUERY_INDEXED,\
75-
ECT_END_QUERY_INDEXED,\
7674
\
7775
ECT_BIND_DESCRIPTOR_SETS,\
7876
\
@@ -335,19 +333,6 @@ namespace impl
335333
asset::E_PIPELINE_STAGE_FLAGS pipelineStage;
336334
uint32_t query;
337335
};
338-
_NBL_DEFINE_SCMD_SPEC(ECT_BEGIN_QUERY_INDEXED)
339-
{
340-
core::smart_refctd_ptr<const IQueryPool> queryPool;
341-
uint32_t query;
342-
uint32_t index;
343-
IQueryPool::E_QUERY_CONTROL_FLAGS flags;
344-
};
345-
_NBL_DEFINE_SCMD_SPEC(ECT_END_QUERY_INDEXED)
346-
{
347-
core::smart_refctd_ptr<const IQueryPool> queryPool;
348-
uint32_t query;
349-
uint32_t index;
350-
};
351336
_NBL_DEFINE_SCMD_SPEC(ECT_BIND_DESCRIPTOR_SETS)
352337
{
353338
asset::E_PIPELINE_BIND_POINT pipelineBindPoint;
@@ -1130,30 +1115,6 @@ class COpenGLCommandBuffer final : public IGPUCommandBuffer
11301115
pushCommand(std::move(cmd));
11311116
return true;
11321117
}
1133-
// TRANSFORM_FEEDBACK_STREAM
1134-
bool beginQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index, IQueryPool::E_QUERY_CONTROL_FLAGS flags = static_cast<IQueryPool::E_QUERY_CONTROL_FLAGS>(0))
1135-
{
1136-
if (!this->isCompatibleDevicewise(queryPool))
1137-
return false;
1138-
SCmd<impl::ECT_BEGIN_QUERY_INDEXED> cmd;
1139-
cmd.queryPool = core::smart_refctd_ptr<const IQueryPool>(queryPool);
1140-
cmd.query = query;
1141-
cmd.flags = flags;
1142-
cmd.index = index;
1143-
pushCommand(std::move(cmd));
1144-
return true;
1145-
}
1146-
bool endQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index) override
1147-
{
1148-
if (!this->isCompatibleDevicewise(queryPool))
1149-
return false;
1150-
SCmd<impl::ECT_END_QUERY_INDEXED> cmd;
1151-
cmd.queryPool = core::smart_refctd_ptr<const IQueryPool>(queryPool);
1152-
cmd.query = query;
1153-
cmd.index = index;
1154-
pushCommand(std::move(cmd));
1155-
return true;
1156-
}
11571118

11581119
bool writeAccelerationStructureProperties(const core::SRange<IGPUAccelerationStructure>& pAccelerationStructures, IQueryPool::E_QUERY_TYPE queryType, IQueryPool* queryPool, uint32_t firstQuery)
11591120
{

src/nbl/video/COpenGLQueryPool.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -100,48 +100,6 @@ class COpenGLQueryPool final : public IQueryPool
100100
}
101101
}
102102
}
103-
104-
inline void beginQueryIndexed(IOpenGL_FunctionTable* gl, uint32_t queryIndex, uint32_t index, E_QUERY_CONTROL_FLAGS flags) const
105-
{
106-
if(gl != nullptr)
107-
{
108-
if(params.queryType == EQT_OCCLUSION)
109-
{
110-
// if(index != 0)
111-
// assert(false && "OCCLUSION Query doesn't work with begin/end Indexed functions.");
112-
GLuint query = getQueryAt(queryIndex);
113-
gl->glQuery.pglBeginQueryIndexed(GL_SAMPLES_PASSED, index, query);
114-
}
115-
else if(params.queryType == EQT_TIMESTAMP)
116-
{
117-
assert(false && "TIMESTAMP Query doesn't work with begin/end functions.");
118-
}
119-
else
120-
{
121-
assert(false && "QueryType is not supported.");
122-
}
123-
}
124-
}
125-
126-
inline void endQueryIndexed(IOpenGL_FunctionTable* gl, uint32_t queryIndex, uint32_t index) const
127-
{
128-
// End Function doesn't use queryIndex
129-
if(gl != nullptr)
130-
{
131-
if(params.queryType == EQT_OCCLUSION)
132-
{
133-
gl->glQuery.pglEndQueryIndexed(GL_SAMPLES_PASSED, index);
134-
}
135-
else if(params.queryType == EQT_TIMESTAMP)
136-
{
137-
assert(false && "TIMESTAMP Query doesn't work with begin/end functions.");
138-
}
139-
else
140-
{
141-
assert(false && "QueryType is not supported.");
142-
}
143-
}
144-
}
145103

146104
inline bool resetQueries(IOpenGL_FunctionTable* gl, uint32_t query, uint32_t queryCount)
147105
{

src/nbl/video/CVulkanCommandBuffer.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -361,48 +361,6 @@ namespace nbl::video
361361
return ret;
362362
}
363363

364-
// TRANSFORM_FEEDBACK_STREAM
365-
bool CVulkanCommandBuffer::beginQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index, IQueryPool::E_QUERY_CONTROL_FLAGS flags)
366-
{
367-
bool ret = false;
368-
// TODO: Check for PhysicalDevice Availability and Extension
369-
if(queryPool != nullptr)
370-
{
371-
const auto* vk = static_cast<const CVulkanLogicalDevice*>(getOriginDevice())->getFunctionTable();
372-
373-
// Add Ref to CmdPool
374-
core::smart_refctd_ptr<const core::IReferenceCounted> tmpRefCntd[1] = { core::smart_refctd_ptr<const IQueryPool>(queryPool) };
375-
CVulkanCommandPool* vulkanCommandPool = IBackendObject::compatibility_cast<CVulkanCommandPool*>(m_cmdpool.get(), this);
376-
vulkanCommandPool->emplace_n(m_argListTail, tmpRefCntd, tmpRefCntd + 1);
377-
378-
auto vk_queryPool = IBackendObject::compatibility_cast<CVulkanQueryPool*>(queryPool, this)->getInternalObject();
379-
auto vk_flags = CVulkanQueryPool::getVkQueryControlFlagsFromQueryControlFlags(flags);
380-
vk->vk.vkCmdBeginQueryIndexedEXT(m_cmdbuf, vk_queryPool, query, vk_flags, index);
381-
ret = true;
382-
}
383-
return ret;
384-
}
385-
386-
bool CVulkanCommandBuffer::endQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index)
387-
{
388-
bool ret = false;
389-
// TODO: Check for PhysicalDevice Availability and Extension
390-
if(queryPool != nullptr)
391-
{
392-
const auto* vk = static_cast<const CVulkanLogicalDevice*>(getOriginDevice())->getFunctionTable();
393-
394-
// Add Ref to CmdPool
395-
core::smart_refctd_ptr<const core::IReferenceCounted> tmpRefCntd[1] = { core::smart_refctd_ptr<const IQueryPool>(queryPool) };
396-
CVulkanCommandPool* vulkanCommandPool = IBackendObject::compatibility_cast<CVulkanCommandPool*>(m_cmdpool.get(), this);
397-
vulkanCommandPool->emplace_n(m_argListTail, tmpRefCntd, tmpRefCntd + 1);
398-
399-
auto vk_queryPool = IBackendObject::compatibility_cast<CVulkanQueryPool*>(queryPool, this)->getInternalObject();
400-
vk->vk.vkCmdEndQueryIndexedEXT(m_cmdbuf, vk_queryPool, query, index);
401-
ret = true;
402-
}
403-
return ret;
404-
}
405-
406364
// Acceleration Structure Properties (Only available on Vulkan)
407365
bool CVulkanCommandBuffer::writeAccelerationStructureProperties(const core::SRange<IGPUAccelerationStructure>& pAccelerationStructures, IQueryPool::E_QUERY_TYPE queryType, IQueryPool* queryPool, uint32_t firstQuery)
408366
{

src/nbl/video/CVulkanCommandBuffer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,9 +1055,7 @@ class CVulkanCommandBuffer : public IGPUCommandBuffer
10551055
bool endQuery(IQueryPool* queryPool, uint32_t query) override;
10561056
bool copyQueryPoolResults(IQueryPool* queryPool, uint32_t firstQuery, uint32_t queryCount, buffer_t* dstBuffer, size_t dstOffset, size_t stride, IQueryPool::E_QUERY_RESULTS_FLAGS flags) override;
10571057
bool writeTimestamp(asset::E_PIPELINE_STAGE_FLAGS pipelineStage, IQueryPool* queryPool, uint32_t query) override;
1058-
// TRANSFORM_FEEDBACK_STREAM
1059-
bool beginQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index, IQueryPool::E_QUERY_CONTROL_FLAGS flags = static_cast<IQueryPool::E_QUERY_CONTROL_FLAGS>(0)) override;
1060-
bool endQueryIndexed(IQueryPool* queryPool, uint32_t query, uint32_t index) override;
1058+
10611059
// Acceleration Structure Properties (Only available on Vulkan)
10621060
bool writeAccelerationStructureProperties(const core::SRange<IGPUAccelerationStructure>& pAccelerationStructures, IQueryPool::E_QUERY_TYPE queryType, IQueryPool* queryPool, uint32_t firstQuery) override;
10631061

0 commit comments

Comments
 (0)