summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cpu/cpu-query.cpp
blob: 3f87d7a65b4c0c455f51adcbb34a88db89add446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// cpu-query.cpp
#include "cpu-query.h"

namespace gfx
{
using namespace Slang;

namespace cpu
{

Result QueryPoolImpl::init(const IQueryPool::Desc& desc)
{
    m_queries.setCount(desc.count);
    return SLANG_OK;
}

SLANG_NO_THROW Result SLANG_MCALL QueryPoolImpl::getResult(
    GfxIndex queryIndex, GfxCount count, uint64_t* data)
{
    for (GfxCount i = 0; i < count; i++)
    {
        data[i] = m_queries[queryIndex + i];
    }
    return SLANG_OK;
}

} // namespace cpu
} // namespace gfx