mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-22 07:54:15 +01:00
[dxvk] Rename DxvkGpu{Event,Query} to Dxvk{Event,Query}
The old name only ever existed because DXVK had two separate implementations of these prior to version 1.1. Let's name them back so that more sensible names are available for internal use.
This commit is contained in:
parent
5890eae32f
commit
d00669cb52
@ -103,8 +103,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
D3D11_VK_QUERY_STATE m_state;
|
D3D11_VK_QUERY_STATE m_state;
|
||||||
|
|
||||||
std::array<Rc<DxvkGpuQuery>, MaxGpuQueries> m_query;
|
std::array<Rc<DxvkQuery>, MaxGpuQueries> m_query;
|
||||||
std::array<Rc<DxvkGpuEvent>, MaxGpuEvents> m_event;
|
std::array<Rc<DxvkEvent>, MaxGpuEvents> m_event;
|
||||||
|
|
||||||
D3D10Query m_d3d10;
|
D3D10Query m_d3d10;
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
D3D9_VK_QUERY_STATE m_state;
|
D3D9_VK_QUERY_STATE m_state;
|
||||||
|
|
||||||
std::array<Rc<DxvkGpuQuery>, MaxGpuQueries> m_query;
|
std::array<Rc<DxvkQuery>, MaxGpuQueries> m_query;
|
||||||
std::array<Rc<DxvkGpuEvent>, MaxGpuEvents> m_event;
|
std::array<Rc<DxvkEvent>, MaxGpuEvents> m_event;
|
||||||
|
|
||||||
uint32_t m_stallMask = 0;
|
uint32_t m_stallMask = 0;
|
||||||
bool m_stallFlag = false;
|
bool m_stallFlag = false;
|
||||||
|
@ -126,12 +126,12 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::beginQuery(const Rc<DxvkGpuQuery>& query) {
|
void DxvkContext::beginQuery(const Rc<DxvkQuery>& query) {
|
||||||
m_queryManager.enableQuery(m_cmd, query);
|
m_queryManager.enableQuery(m_cmd, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::endQuery(const Rc<DxvkGpuQuery>& query) {
|
void DxvkContext::endQuery(const Rc<DxvkQuery>& query) {
|
||||||
m_queryManager.disableQuery(m_cmd, query);
|
m_queryManager.disableQuery(m_cmd, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2467,7 +2467,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::signalGpuEvent(const Rc<DxvkGpuEvent>& event) {
|
void DxvkContext::signalGpuEvent(const Rc<DxvkEvent>& event) {
|
||||||
this->spillRenderPass(true);
|
this->spillRenderPass(true);
|
||||||
|
|
||||||
DxvkGpuEventHandle handle = m_common->eventPool().allocEvent();
|
DxvkGpuEventHandle handle = m_common->eventPool().allocEvent();
|
||||||
@ -2556,7 +2556,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::writeTimestamp(const Rc<DxvkGpuQuery>& query) {
|
void DxvkContext::writeTimestamp(const Rc<DxvkQuery>& query) {
|
||||||
m_queryManager.writeTimestamp(m_cmd, query);
|
m_queryManager.writeTimestamp(m_cmd, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,14 +101,14 @@ namespace dxvk {
|
|||||||
* \param [in] query The query to end
|
* \param [in] query The query to end
|
||||||
*/
|
*/
|
||||||
void beginQuery(
|
void beginQuery(
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Ends generating query data
|
* \brief Ends generating query data
|
||||||
* \param [in] query The query to end
|
* \param [in] query The query to end
|
||||||
*/
|
*/
|
||||||
void endQuery(
|
void endQuery(
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets render targets
|
* \brief Sets render targets
|
||||||
@ -1299,14 +1299,14 @@ namespace dxvk {
|
|||||||
* \param [in] event The event
|
* \param [in] event The event
|
||||||
*/
|
*/
|
||||||
void signalGpuEvent(
|
void signalGpuEvent(
|
||||||
const Rc<DxvkGpuEvent>& event);
|
const Rc<DxvkEvent>& event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Writes to a timestamp query
|
* \brief Writes to a timestamp query
|
||||||
* \param [in] query The timestamp query
|
* \param [in] query The timestamp query
|
||||||
*/
|
*/
|
||||||
void writeTimestamp(
|
void writeTimestamp(
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Queues a signal
|
* \brief Queues a signal
|
||||||
|
@ -138,16 +138,16 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rc<DxvkGpuEvent> DxvkDevice::createGpuEvent() {
|
Rc<DxvkEvent> DxvkDevice::createGpuEvent() {
|
||||||
return new DxvkGpuEvent(m_vkd);
|
return new DxvkEvent(m_vkd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rc<DxvkGpuQuery> DxvkDevice::createGpuQuery(
|
Rc<DxvkQuery> DxvkDevice::createGpuQuery(
|
||||||
VkQueryType type,
|
VkQueryType type,
|
||||||
VkQueryControlFlags flags,
|
VkQueryControlFlags flags,
|
||||||
uint32_t index) {
|
uint32_t index) {
|
||||||
return new DxvkGpuQuery(m_vkd, type, flags, index);
|
return new DxvkQuery(m_vkd, type, flags, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ namespace dxvk {
|
|||||||
* \brief Creates a GPU event
|
* \brief Creates a GPU event
|
||||||
* \returns New GPU event
|
* \returns New GPU event
|
||||||
*/
|
*/
|
||||||
Rc<DxvkGpuEvent> createGpuEvent();
|
Rc<DxvkEvent> createGpuEvent();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Creates a query
|
* \brief Creates a query
|
||||||
@ -298,7 +298,7 @@ namespace dxvk {
|
|||||||
* \param [in] index Query index
|
* \param [in] index Query index
|
||||||
* \returns New query
|
* \returns New query
|
||||||
*/
|
*/
|
||||||
Rc<DxvkGpuQuery> createGpuQuery(
|
Rc<DxvkQuery> createGpuQuery(
|
||||||
VkQueryType type,
|
VkQueryType type,
|
||||||
VkQueryControlFlags flags,
|
VkQueryControlFlags flags,
|
||||||
uint32_t index);
|
uint32_t index);
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkGpuEvent::DxvkGpuEvent(const Rc<vk::DeviceFn>& vkd)
|
DxvkEvent::DxvkEvent(const Rc<vk::DeviceFn>& vkd)
|
||||||
: m_vkd(vkd) { }
|
: m_vkd(vkd) { }
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuEvent::~DxvkGpuEvent() {
|
DxvkEvent::~DxvkEvent() {
|
||||||
if (m_handle.pool && m_handle.event)
|
if (m_handle.pool && m_handle.event)
|
||||||
m_handle.pool->freeEvent(m_handle.event);
|
m_handle.pool->freeEvent(m_handle.event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuEventStatus DxvkGpuEvent::test() const {
|
DxvkGpuEventStatus DxvkEvent::test() const {
|
||||||
if (!m_handle.event)
|
if (!m_handle.event)
|
||||||
return DxvkGpuEventStatus::Invalid;
|
return DxvkGpuEventStatus::Invalid;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuEventHandle DxvkGpuEvent::reset(DxvkGpuEventHandle handle) {
|
DxvkGpuEventHandle DxvkEvent::reset(DxvkGpuEventHandle handle) {
|
||||||
m_vkd->vkResetEvent(m_vkd->device(), handle.event);
|
m_vkd->vkResetEvent(m_vkd->device(), handle.event);
|
||||||
return std::exchange(m_handle, handle);
|
return std::exchange(m_handle, handle);
|
||||||
}
|
}
|
||||||
|
@ -42,12 +42,12 @@ namespace dxvk {
|
|||||||
* the application to check whether a specific
|
* the application to check whether a specific
|
||||||
* command has completed execution.
|
* command has completed execution.
|
||||||
*/
|
*/
|
||||||
class DxvkGpuEvent : public DxvkResource {
|
class DxvkEvent : public DxvkResource {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DxvkGpuEvent(const Rc<vk::DeviceFn>& vkd);
|
DxvkEvent(const Rc<vk::DeviceFn>& vkd);
|
||||||
~DxvkGpuEvent();
|
~DxvkEvent();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retrieves event status
|
* \brief Retrieves event status
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkGpuQuery::DxvkGpuQuery(
|
DxvkQuery::DxvkQuery(
|
||||||
const Rc<vk::DeviceFn>& vkd,
|
const Rc<vk::DeviceFn>& vkd,
|
||||||
VkQueryType type,
|
VkQueryType type,
|
||||||
VkQueryControlFlags flags,
|
VkQueryControlFlags flags,
|
||||||
@ -17,18 +17,18 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuQuery::~DxvkGpuQuery() {
|
DxvkQuery::~DxvkQuery() {
|
||||||
for (size_t i = 0; i < m_handles.size(); i++)
|
for (size_t i = 0; i < m_handles.size(); i++)
|
||||||
m_handles[i].allocator->freeQuery(m_handles[i]);
|
m_handles[i].allocator->freeQuery(m_handles[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DxvkGpuQuery::isIndexed() const {
|
bool DxvkQuery::isIndexed() const {
|
||||||
return m_type == VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT;
|
return m_type == VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuQueryStatus DxvkGpuQuery::getData(DxvkQueryData& queryData) {
|
DxvkGpuQueryStatus DxvkQuery::getData(DxvkQueryData& queryData) {
|
||||||
queryData = DxvkQueryData();
|
queryData = DxvkQueryData();
|
||||||
|
|
||||||
// Callers must ensure that no begin call is pending when
|
// Callers must ensure that no begin call is pending when
|
||||||
@ -56,7 +56,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkGpuQuery::begin(const Rc<DxvkCommandList>& cmd) {
|
void DxvkQuery::begin(const Rc<DxvkCommandList>& cmd) {
|
||||||
// Not useful to enforce a memory order here since
|
// Not useful to enforce a memory order here since
|
||||||
// only the false->true transition is defined.
|
// only the false->true transition is defined.
|
||||||
m_ended.store(false, std::memory_order_relaxed);
|
m_ended.store(false, std::memory_order_relaxed);
|
||||||
@ -73,13 +73,13 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkGpuQuery::end() {
|
void DxvkQuery::end() {
|
||||||
// Ensure that all prior writes are made available
|
// Ensure that all prior writes are made available
|
||||||
m_ended.store(true, std::memory_order_release);
|
m_ended.store(true, std::memory_order_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkGpuQuery::addQueryHandle(const DxvkGpuQueryHandle& handle) {
|
void DxvkQuery::addQueryHandle(const DxvkGpuQueryHandle& handle) {
|
||||||
// Already accumulate available queries here in case
|
// Already accumulate available queries here in case
|
||||||
// we already allocated a large number of queries
|
// we already allocated a large number of queries
|
||||||
if (m_handles.size() >= m_handles.MinCapacity)
|
if (m_handles.size() >= m_handles.MinCapacity)
|
||||||
@ -89,7 +89,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuQueryStatus DxvkGpuQuery::accumulateQueryDataForHandle(
|
DxvkGpuQueryStatus DxvkQuery::accumulateQueryDataForHandle(
|
||||||
const DxvkGpuQueryHandle& handle) {
|
const DxvkGpuQueryHandle& handle) {
|
||||||
DxvkQueryData tmpData = { };
|
DxvkQueryData tmpData = { };
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkGpuQueryStatus DxvkGpuQuery::accumulateQueryData() {
|
DxvkGpuQueryStatus DxvkQuery::accumulateQueryData() {
|
||||||
DxvkGpuQueryStatus status = DxvkGpuQueryStatus::Available;
|
DxvkGpuQueryStatus status = DxvkGpuQueryStatus::Available;
|
||||||
|
|
||||||
// Process available queries and return them to the
|
// Process available queries and return them to the
|
||||||
@ -298,7 +298,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkGpuQueryManager::enableQuery(
|
void DxvkGpuQueryManager::enableQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query) {
|
const Rc<DxvkQuery>& query) {
|
||||||
query->begin(cmd);
|
query->begin(cmd);
|
||||||
|
|
||||||
m_activeQueries.push_back(query);
|
m_activeQueries.push_back(query);
|
||||||
@ -310,7 +310,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkGpuQueryManager::disableQuery(
|
void DxvkGpuQueryManager::disableQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query) {
|
const Rc<DxvkQuery>& query) {
|
||||||
auto iter = std::find(
|
auto iter = std::find(
|
||||||
m_activeQueries.begin(),
|
m_activeQueries.begin(),
|
||||||
m_activeQueries.end(),
|
m_activeQueries.end(),
|
||||||
@ -328,7 +328,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkGpuQueryManager::writeTimestamp(
|
void DxvkGpuQueryManager::writeTimestamp(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query) {
|
const Rc<DxvkQuery>& query) {
|
||||||
DxvkGpuQueryHandle handle = m_pool->allocQuery(query->type());
|
DxvkGpuQueryHandle handle = m_pool->allocQuery(query->type());
|
||||||
|
|
||||||
query->begin(cmd);
|
query->begin(cmd);
|
||||||
@ -373,7 +373,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkGpuQueryManager::beginSingleQuery(
|
void DxvkGpuQueryManager::beginSingleQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query) {
|
const Rc<DxvkQuery>& query) {
|
||||||
DxvkGpuQueryHandle handle = m_pool->allocQuery(query->type());
|
DxvkGpuQueryHandle handle = m_pool->allocQuery(query->type());
|
||||||
|
|
||||||
cmd->resetQuery(
|
cmd->resetQuery(
|
||||||
@ -399,7 +399,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkGpuQueryManager::endSingleQuery(
|
void DxvkGpuQueryManager::endSingleQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query) {
|
const Rc<DxvkQuery>& query) {
|
||||||
DxvkGpuQueryHandle handle = query->handle();
|
DxvkGpuQueryHandle handle = query->handle();
|
||||||
|
|
||||||
if (query->isIndexed()) {
|
if (query->isIndexed()) {
|
||||||
|
@ -116,17 +116,17 @@ namespace dxvk {
|
|||||||
* Manages Vulkan queries that are sub-allocated
|
* Manages Vulkan queries that are sub-allocated
|
||||||
* from larger query pools
|
* from larger query pools
|
||||||
*/
|
*/
|
||||||
class DxvkGpuQuery : public DxvkResource {
|
class DxvkQuery : public DxvkResource {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DxvkGpuQuery(
|
DxvkQuery(
|
||||||
const Rc<vk::DeviceFn>& vkd,
|
const Rc<vk::DeviceFn>& vkd,
|
||||||
VkQueryType type,
|
VkQueryType type,
|
||||||
VkQueryControlFlags flags,
|
VkQueryControlFlags flags,
|
||||||
uint32_t index);
|
uint32_t index);
|
||||||
|
|
||||||
~DxvkGpuQuery();
|
~DxvkQuery();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Query type
|
* \brief Query type
|
||||||
@ -351,7 +351,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void enableQuery(
|
void enableQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Disables a query
|
* \brief Disables a query
|
||||||
@ -363,7 +363,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void disableQuery(
|
void disableQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Signals a time stamp query
|
* \brief Signals a time stamp query
|
||||||
@ -374,7 +374,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void writeTimestamp(
|
void writeTimestamp(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Begins queries of a given type
|
* \brief Begins queries of a given type
|
||||||
@ -404,15 +404,15 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkGpuQueryPool* m_pool;
|
DxvkGpuQueryPool* m_pool;
|
||||||
uint32_t m_activeTypes;
|
uint32_t m_activeTypes;
|
||||||
std::vector<Rc<DxvkGpuQuery>> m_activeQueries;
|
std::vector<Rc<DxvkQuery>> m_activeQueries;
|
||||||
|
|
||||||
void beginSingleQuery(
|
void beginSingleQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
void endSingleQuery(
|
void endSingleQuery(
|
||||||
const Rc<DxvkCommandList>& cmd,
|
const Rc<DxvkCommandList>& cmd,
|
||||||
const Rc<DxvkGpuQuery>& query);
|
const Rc<DxvkQuery>& query);
|
||||||
|
|
||||||
static uint32_t getQueryTypeBit(
|
static uint32_t getQueryTypeBit(
|
||||||
VkQueryType type);
|
VkQueryType type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user