50 query->parent_ops = parent_ops;
55 query->data_size = data_size;
56 query->query_ops = query_ops;
103 TRACE(
"Fence not issued.\n");
111 WARN(
"Fence tested from wrong thread.\n");
137 ERR(
"glClientWaitSync returned %#x.\n", gl_ret);
161 ERR(
"Fence created despite lack of GL support.\n");
180 TRACE(
"Fence not issued.\n");
192 WARN(
"Fence finished from wrong thread.\n");
218 ERR(
"glClientWaitSync returned %#x.\n", gl_ret);
236 ERR(
"Fence created without GL support.\n");
296 WARN(
"Fences not supported.\n");
311 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
320 TRACE(
"Created fence %p.\n",
object);
330 TRACE(
"%p increasing refcount to %u.\n",
query, refcount);
353 TRACE(
"%p decreasing refcount to %u.\n",
query, refcount);
357 query->parent_ops->wined3d_object_destroyed(
query->parent);
367 TRACE(
"query %p, data %p, data_size %u, flags %#x.\n",
375 WARN(
"Query is building, returning S_FALSE.\n");
381 WARN(
"Query wasn't started yet.\n");
390 else if (
query->counter_main !=
query->counter_retrieved)
407 return query->data_size;
415 ++
query->counter_main;
439 FIXME(
"%p Wrong thread, returning 1.\n",
query);
478 FIXME(
"(%p) Wrong thread, reporting GPU idle.\n",
query);
482 ERR(
"The GL event query failed.\n");
486 ERR(
"Unexpected wined3d_event_query_test result %#x.\n",
ret);
495 return query->parent;
519 ERR(
"Event query issued with START flag - what to do?\n");
548 FIXME(
"Wrong thread, can't restart query.\n");
585 FIXME(
"Wrong thread, can't end query.\n");
607 FIXME(
"%p Wrong thread, returning 1.\n",
query);
614 checkGLcall(
"glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)");
620 checkGLcall(
"glGetQueryObjectui64v(GL_QUERY_RESULT)");
640 WARN(
"Ignoring WINED3DISSUE_BEGIN with a TIMESTAMP query.\n");
677 GLuint written_available, generated_available;
685 FIXME(
"%p Wrong thread, returning 0 primitives.\n",
query);
695 TRACE(
"Available %#x, %#x.\n", written_available, generated_available);
697 if (written_available && generated_available)
701 TRACE(
"Returning %s, %s primitives.\n",
709 return written_available && generated_available;
733 FIXME(
"Wrong thread, can't restart query.\n");
771 FIXME(
"Wrong thread, can't end query.\n");
865 FIXME(
"Wrong thread, can't restart query.\n");
907 FIXME(
"Wrong thread, can't end query.\n");
967 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
970 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
975 WARN(
"Event queries not supported.\n");
983 TRACE(
"Created query %p.\n",
object);
984 *
query = &
object->query;
1012 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1017 WARN(
"Unsupported in local OpenGL implementation: ARB_OCCLUSION_QUERY.\n");
1021 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1027 TRACE(
"Created query %p.\n",
object);
1028 *
query = &
object->query;
1056 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1061 WARN(
"Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n");
1065 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1071 TRACE(
"Created query %p.\n",
object);
1072 *
query = &
object->query;
1096 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1101 WARN(
"Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n");
1105 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1117 static const UINT64 freq = 1000 * 1000 * 1000;
1123 TRACE(
"Created query %p.\n",
object);
1158 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1163 WARN(
"OpenGL implementation does not support primitive queries.\n");
1168 WARN(
"OpenGL implementation does not support indexed queries.\n");
1172 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1179 TRACE(
"Created query %p.\n",
object);
1180 *
query = &
object->query;
1207 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1212 WARN(
"OpenGL implementation does not support pipeline statistics queries.\n");
1216 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1222 TRACE(
"Created query %p.\n",
object);
1223 *
query = &
object->query;
1255 TRACE(
"Created query %p.\n",
object);
1288 TRACE(
"Created query %p.\n",
object);
1297 TRACE(
"device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
1331 FIXME(
"Unhandled query type %#x.\n",
type);
unsigned long long UINT64
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_init(struct list_entry *head)
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
void wined3d_cs_emit_flush(struct wined3d_cs *cs)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void context_alloc_so_statistics_query(struct wined3d_context *context, struct wined3d_so_statistics_query *query)
void context_free_occlusion_query(struct wined3d_occlusion_query *query)
void context_alloc_pipeline_statistics_query(struct wined3d_context *context, struct wined3d_pipeline_statistics_query *query)
void context_free_so_statistics_query(struct wined3d_so_statistics_query *query)
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query)
void context_free_fence(struct wined3d_fence *fence)
void context_alloc_fence(struct wined3d_context *context, struct wined3d_fence *fence)
void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query)
void context_release(struct wined3d_context *context)
void context_free_timestamp_query(struct wined3d_timestamp_query *query)
struct wined3d_context * context_reacquire(const struct wined3d_device *device, struct wined3d_context *context)
void context_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query)
static void wined3d_so_statistics_query_ops_destroy(struct wined3d_query *query)
static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_event_query_ops_poll(struct wined3d_query *query, DWORD flags)
static struct wined3d_so_statistics_query * wined3d_so_statistics_query_from_query(struct wined3d_query *query)
static void wined3d_pipeline_query_ops_destroy(struct wined3d_query *query)
static HRESULT wined3d_statistics_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static UINT64 get_query_result64(GLuint id, const struct wined3d_gl_info *gl_info)
HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, void *data, UINT data_size, DWORD flags)
static void wined3d_pipeline_statistics_query_end(struct wined3d_pipeline_statistics_query *query, struct wined3d_context *context)
enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query *query)
static void wined3d_timestamp_query_ops_destroy(struct wined3d_query *query)
void wined3d_fence_issue(struct wined3d_fence *fence, const struct wined3d_device *device)
static void wined3d_statistics_query_ops_destroy(struct wined3d_query *query)
static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query, DWORD flags)
HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags)
static struct wined3d_event_query * wined3d_event_query_from_query(struct wined3d_query *query)
static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static const struct wined3d_query_ops overflow_query_ops
static const struct wined3d_query_ops pipeline_query_ops
static HRESULT wined3d_overflow_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
void wined3d_fence_destroy(struct wined3d_fence *fence)
static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags)
static struct wined3d_timestamp_query * wined3d_timestamp_query_from_query(struct wined3d_query *query)
void *CDECL wined3d_query_get_parent(const struct wined3d_query *query)
enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence, const struct wined3d_device *device)
static const struct wined3d_query_ops timestamp_disjoint_query_ops
static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags)
static void wined3d_occlusion_query_ops_destroy(struct wined3d_query *query)
ULONG CDECL wined3d_query_incref(struct wined3d_query *query)
HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static BOOL wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags)
static struct wined3d_pipeline_statistics_query * wined3d_pipeline_statistics_query_from_query(struct wined3d_query *query)
HRESULT wined3d_fence_create(struct wined3d_device *device, struct wined3d_fence **fence)
static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query, DWORD flags)
static void wined3d_query_destroy_object(void *object)
UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query)
static void wined3d_overflow_query_ops_destroy(struct wined3d_query *query)
ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
static BOOL wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_fence_supported(const struct wined3d_gl_info *gl_info)
static const struct wined3d_query_ops statistics_query_ops
static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD flags)
static void wined3d_timestamp_disjoint_query_ops_destroy(struct wined3d_query *query)
static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags)
static BOOL wined3d_so_statistics_query_ops_poll(struct wined3d_query *query, DWORD flags)
static void wined3d_fence_free(struct wined3d_fence *fence)
static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query, DWORD flags)
static const struct wined3d_query_ops occlusion_query_ops
static struct wined3d_occlusion_query * wined3d_occlusion_query_from_query(struct wined3d_query *query)
static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags)
static HRESULT wined3d_event_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static enum wined3d_fence_result wined3d_fence_test(const struct wined3d_fence *fence, const struct wined3d_device *device, DWORD flags)
static HRESULT wined3d_fence_init(struct wined3d_fence *fence, const struct wined3d_gl_info *gl_info)
static const struct wined3d_query_ops event_query_ops
static void wined3d_query_init(struct wined3d_query *query, struct wined3d_device *device, enum wined3d_query_type type, const void *data, DWORD data_size, const struct wined3d_query_ops *query_ops, void *parent, const struct wined3d_parent_ops *parent_ops)
static const struct wined3d_query_ops so_statistics_query_ops
static const struct wined3d_query_ops timestamp_query_ops
static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
static WCHAR available[MAX_STRING_RESOURCE_LEN]
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define HeapFree(x, y, z)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define GL_PRIMITIVES_GENERATED
#define GL_ALREADY_SIGNALED
#define GL_QUERY_RESULT_AVAILABLE
#define GL_SAMPLES_PASSED
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
#define GL_GEOMETRY_SHADER_INVOCATIONS
#define GL_CONDITION_SATISFIED
#define GL_TIMEOUT_EXPIRED
#define GL_SYNC_FLUSH_COMMANDS_BIT
#define GL_SYNC_GPU_COMMANDS_COMPLETE
#define GL_ALL_COMPLETED_NV
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
const struct wined3d_gl_info * gl_info
struct wined3d_fence fence
union wined3d_gl_fence_object object
struct wined3d_context * context
BOOL supported[WINED3D_GL_EXT_COUNT]
struct wined3d_context * context
struct wined3d_query_data_pipeline_statistics statistics
union wined3d_gl_pipeline_statistics_query u
struct wined3d_context * context
const struct wined3d_parent_ops * parent_ops
struct wined3d_query_data_so_statistics statistics
struct wined3d_context * context
union wined3d_gl_so_statistics_query u
struct wined3d_context * context
#define CONTAINING_RECORD(address, type, field)
struct wined3d_gl_pipeline_statistics_query::@297 query
struct wined3d_gl_so_statistics_query::@296 query
#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB
#define GL_PRIMITIVES_SUBMITTED_ARB
#define GL_CLIPPING_INPUT_PRIMITIVES_ARB
#define GL_VERTEX_SHADER_INVOCATIONS_ARB
#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB
#define GL_COMPUTE_SHADER_INVOCATIONS_ARB
#define GL_VERTICES_SUBMITTED_ARB
#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB
#define GL_TESS_CONTROL_SHADER_PATCHES_ARB
#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB
#define WINED3DISSUE_BEGIN
#define WINED3DGETDATA_FLUSH
#define WINED3DERR_NOTAVAILABLE
@ WINED3D_QUERY_TYPE_TIMESTAMP_FREQ
@ WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM2
@ WINED3D_QUERY_TYPE_SO_STATISTICS
@ WINED3D_QUERY_TYPE_PIPELINE_STATISTICS
@ WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0
@ WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM1
@ WINED3D_QUERY_TYPE_TIMESTAMP
@ WINED3D_QUERY_TYPE_SO_OVERFLOW
@ WINED3D_QUERY_TYPE_EVENT
@ WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT
@ WINED3D_QUERY_TYPE_OCCLUSION
@ WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3
#define WINED3DERR_INVALIDCALL
@ ARB_PIPELINE_STATISTICS_QUERY
@ WINED3D_GL_PRIMITIVE_QUERY
@ ARB_TRANSFORM_FEEDBACK3
@ WINED3D_FENCE_WRONG_THREAD
@ WINED3D_FENCE_NOT_STARTED