@@ -32,19 +32,24 @@ void QueryPool::reset(uint32_t index, uint32_t count)
3232 SLANG_RHI_CALL (m_rhi_query_pool->reset (index, count), m_device);
3333}
3434
35- void QueryPool::get_results (uint32_t index, uint32_t count, std::span< uint64_t > result )
35+ QueryResultState QueryPool::get_result_state (uint32_t index, uint32_t count)
3636{
3737 SGL_CHECK (uint64_t (index) + count <= m_desc.count , " 'index' / 'count' out of range" );
38- SGL_CHECK (result.size () >= count, " 'result' buffer too small" );
39- SLANG_RHI_CALL (m_rhi_query_pool->getResult (index, count, result.data ()), m_device);
38+ rhi::QueryResultState rhi_state;
39+ SLANG_RHI_CALL (m_rhi_query_pool->getResultState (index, count, &rhi_state), m_device);
40+ return static_cast <QueryResultState>(rhi_state);
4041}
4142
42- bool QueryPool::is_result_ready (uint32_t index, uint32_t count)
43+ QueryResultState QueryPool::get_result_state (uint32_t index)
44+ {
45+ return get_result_state (index, 1 );
46+ }
47+
48+ void QueryPool::get_results (uint32_t index, uint32_t count, std::span<uint64_t > result)
4349{
4450 SGL_CHECK (uint64_t (index) + count <= m_desc.count , " 'index' / 'count' out of range" );
45- bool ready;
46- SLANG_RHI_CALL (m_rhi_query_pool->isResultReady (index, count, &ready), m_device);
47- return ready;
51+ SGL_CHECK (result.size () >= count, " 'result' buffer too small" );
52+ SLANG_RHI_CALL (m_rhi_query_pool->getResult (index, count, result.data ()), m_device);
4853}
4954
5055std::vector<uint64_t > QueryPool::get_results (uint32_t index, uint32_t count)
0 commit comments