2017-12-29 22:20:31 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-02-18 22:34:23 +01:00
|
|
|
#include "../dxvk/dxvk_event.h"
|
|
|
|
#include "../dxvk/dxvk_query.h"
|
|
|
|
|
2018-08-12 00:20:17 +02:00
|
|
|
#include "../d3d10/d3d10_query.h"
|
|
|
|
|
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
|
2017-12-29 22:20:31 +01:00
|
|
|
namespace dxvk {
|
|
|
|
|
2018-02-18 22:34:23 +01:00
|
|
|
class D3D11Query : public D3D11DeviceChild<ID3D11Predicate> {
|
2017-12-29 22:20:31 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
D3D11Query(
|
|
|
|
D3D11Device* device,
|
|
|
|
const D3D11_QUERY_DESC& desc);
|
|
|
|
|
|
|
|
~D3D11Query();
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetDevice(
|
|
|
|
ID3D11Device **ppDevice) final;
|
|
|
|
|
|
|
|
UINT STDMETHODCALLTYPE GetDataSize();
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetDesc(
|
|
|
|
D3D11_QUERY_DESC *pDesc) final;
|
|
|
|
|
2018-02-18 22:34:23 +01:00
|
|
|
uint32_t Reset();
|
|
|
|
|
|
|
|
bool HasBeginEnabled() const;
|
|
|
|
|
|
|
|
void Begin(DxvkContext* ctx, uint32_t revision);
|
|
|
|
|
|
|
|
void End(DxvkContext* ctx);
|
|
|
|
|
|
|
|
void Signal(DxvkContext* ctx, uint32_t revision);
|
|
|
|
|
2018-01-01 20:59:54 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetData(
|
|
|
|
void* pData,
|
|
|
|
UINT GetDataFlags);
|
|
|
|
|
2018-08-12 00:20:17 +02:00
|
|
|
D3D10Query* GetD3D10Iface() {
|
|
|
|
return &m_d3d10;
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:20:31 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
D3D11Device* const m_device;
|
|
|
|
D3D11_QUERY_DESC m_desc;
|
|
|
|
|
2018-02-18 22:34:23 +01:00
|
|
|
Rc<DxvkQuery> m_query = nullptr;
|
|
|
|
Rc<DxvkEvent> m_event = nullptr;
|
|
|
|
|
|
|
|
uint32_t m_revision = 0;
|
2018-06-13 14:29:58 +02:00
|
|
|
|
2018-08-12 00:20:17 +02:00
|
|
|
D3D10Query m_d3d10;
|
|
|
|
|
2018-06-13 14:29:58 +02:00
|
|
|
UINT64 GetTimestampQueryFrequency() const;
|
2018-02-18 22:34:23 +01:00
|
|
|
|
2017-12-29 22:20:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|