summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cpu/cpu-query.cpp
blob: 9ed416c4244df5d9a5ef94bd4e281f8c0c54ab5b (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