d3d12: Move query structs to header

Also adds `fence_value` to `d3d12_query` to track which batch of work
this query exists in and must be waited on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20217>
This commit is contained in:
Giancarlo Devich 2022-12-16 13:50:19 -08:00 committed by Marge Bot
parent c90e5ddc71
commit 8886f5e343
2 changed files with 30 additions and 25 deletions

View file

@ -34,31 +34,6 @@
#include <dxguids/dxguids.h>
constexpr unsigned MAX_SUBQUERIES = 3;
struct d3d12_query_impl {
ID3D12QueryHeap *query_heap;
unsigned curr_query, num_queries;
size_t query_size;
D3D12_QUERY_TYPE d3d12qtype;
pipe_resource *buffer;
unsigned buffer_offset;
bool active;
};
struct d3d12_query {
struct threaded_query base;
enum pipe_query_type type;
struct d3d12_query_impl subqueries[MAX_SUBQUERIES];
struct list_head active_list;
struct d3d12_resource *predicate;
};
static unsigned
num_sub_queries(unsigned query_type)
{

View file

@ -24,6 +24,9 @@
#ifndef D3D12_QUERY_H
#define D3D12_QUERY_H
#include "d3d12_common.h"
#include "d3d12_resource.h"
struct d3d12_context;
void
@ -38,4 +41,31 @@ d3d12_validate_queries(struct d3d12_context *ctx);
void
d3d12_enable_predication(struct d3d12_context *ctx);
constexpr unsigned MAX_SUBQUERIES = 3;
struct d3d12_query_impl {
ID3D12QueryHeap* query_heap;
unsigned curr_query, num_queries;
size_t query_size;
D3D12_QUERY_TYPE d3d12qtype;
pipe_resource* buffer;
unsigned buffer_offset;
bool active;
};
struct d3d12_query {
struct threaded_query base;
enum pipe_query_type type;
struct d3d12_query_impl subqueries[MAX_SUBQUERIES];
struct list_head active_list;
struct d3d12_resource* predicate;
uint64_t fence_value;
};
#endif