libobs: Add GPU timestamp query support

This change only wraps the functionality. I have rough code to exercise
the the query functionality, but that part is not really clean enough to
submit.
This commit is contained in:
jpark37
2019-07-27 13:31:07 -07:00
parent baddca2536
commit 0e12d8189c
10 changed files with 401 additions and 0 deletions

View File

@@ -292,6 +292,8 @@ enum class gs_type {
gs_pixel_shader,
gs_duplicator,
gs_swap_chain,
gs_timer,
gs_timer_range,
};
struct gs_obj {
@@ -373,6 +375,31 @@ struct gs_index_buffer : gs_obj {
void *indices, size_t num, uint32_t flags);
};
struct gs_timer : gs_obj {
ComPtr<ID3D11Query> query_begin;
ComPtr<ID3D11Query> query_end;
void Rebuild(ID3D11Device *dev);
inline void Release()
{
query_begin.Release();
query_end.Release();
}
gs_timer(gs_device_t *device);
};
struct gs_timer_range : gs_obj {
ComPtr<ID3D11Query> query_disjoint;
void Rebuild(ID3D11Device *dev);
inline void Release() { query_disjoint.Release(); }
gs_timer_range(gs_device_t *device);
};
struct gs_texture : gs_obj {
gs_texture_type type;
uint32_t levels;