Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1174c894
Commit
1174c894
authored
Aug 15, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make the adapter responsible for query creation and destruction.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5356292e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
19 deletions
+94
-19
adapter_gl.c
dlls/wined3d/adapter_gl.c
+38
-0
adapter_vk.c
dlls/wined3d/adapter_vk.c
+16
-0
directx.c
dlls/wined3d/directx.c
+16
-0
query.c
dlls/wined3d/query.c
+16
-19
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-0
No files found.
dlls/wined3d/adapter_gl.c
View file @
1174c894
...
...
@@ -5069,6 +5069,42 @@ static void adapter_gl_destroy_sampler(struct wined3d_sampler *sampler)
wined3d_cs_destroy_object
(
sampler
->
device
->
cs
,
wined3d_sampler_gl_destroy_object
,
sampler_gl
);
}
static
HRESULT
adapter_gl_create_query
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
)
{
TRACE
(
"device %p, type %#x, parent %p, parent_ops %p, query %p.
\n
"
,
device
,
type
,
parent
,
parent_ops
,
query
);
return
wined3d_query_gl_create
(
device
,
type
,
parent
,
parent_ops
,
query
);
}
static
void
wined3d_query_gl_destroy_object
(
void
*
object
)
{
struct
wined3d_query
*
query
=
object
;
if
(
query
->
buffer_object
)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
query
->
device
,
NULL
,
0
);
wined3d_query_gl_destroy_buffer_object
(
wined3d_context_gl
(
context
),
query
);
context_release
(
context
);
}
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
* context, and (still) leaking the actual query. */
query
->
query_ops
->
query_destroy
(
query
);
}
static
void
adapter_gl_destroy_query
(
struct
wined3d_query
*
query
)
{
TRACE
(
"query %p.
\n
"
,
query
);
wined3d_cs_destroy_object
(
query
->
device
->
cs
,
wined3d_query_gl_destroy_object
,
query
);
}
static
const
struct
wined3d_adapter_ops
wined3d_adapter_gl_ops
=
{
adapter_gl_destroy
,
...
...
@@ -5094,6 +5130,8 @@ static const struct wined3d_adapter_ops wined3d_adapter_gl_ops =
adapter_gl_destroy_unordered_access_view
,
adapter_gl_create_sampler
,
adapter_gl_destroy_sampler
,
adapter_gl_create_query
,
adapter_gl_destroy_query
,
};
static
BOOL
wined3d_adapter_gl_init
(
struct
wined3d_adapter_gl
*
adapter_gl
,
...
...
dlls/wined3d/adapter_vk.c
View file @
1174c894
...
...
@@ -759,6 +759,20 @@ static void adapter_vk_destroy_sampler(struct wined3d_sampler *sampler)
wined3d_cs_destroy_object
(
sampler
->
device
->
cs
,
heap_free
,
sampler
);
}
static
HRESULT
adapter_vk_create_query
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
)
{
TRACE
(
"device %p, type %#x, parent %p, parent_ops %p, query %p.
\n
"
,
device
,
type
,
parent
,
parent_ops
,
query
);
return
WINED3DERR_NOTAVAILABLE
;
}
static
void
adapter_vk_destroy_query
(
struct
wined3d_query
*
query
)
{
TRACE
(
"query %p.
\n
"
,
query
);
}
static
const
struct
wined3d_adapter_ops
wined3d_adapter_vk_ops
=
{
adapter_vk_destroy
,
...
...
@@ -784,6 +798,8 @@ static const struct wined3d_adapter_ops wined3d_adapter_vk_ops =
adapter_vk_destroy_unordered_access_view
,
adapter_vk_create_sampler
,
adapter_vk_destroy_sampler
,
adapter_vk_create_query
,
adapter_vk_destroy_query
,
};
static
unsigned
int
wined3d_get_wine_vk_version
(
void
)
...
...
dlls/wined3d/directx.c
View file @
1174c894
...
...
@@ -2568,6 +2568,20 @@ static void adapter_no3d_destroy_sampler(struct wined3d_sampler *sampler)
TRACE
(
"sampler %p.
\n
"
,
sampler
);
}
static
HRESULT
adapter_no3d_create_query
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
)
{
TRACE
(
"device %p, type %#x, parent %p, parent_ops %p, query %p.
\n
"
,
device
,
type
,
parent
,
parent_ops
,
query
);
return
WINED3DERR_NOTAVAILABLE
;
}
static
void
adapter_no3d_destroy_query
(
struct
wined3d_query
*
query
)
{
TRACE
(
"query %p.
\n
"
,
query
);
}
static
const
struct
wined3d_adapter_ops
wined3d_adapter_no3d_ops
=
{
adapter_no3d_destroy
,
...
...
@@ -2593,6 +2607,8 @@ static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
adapter_no3d_destroy_unordered_access_view
,
adapter_no3d_create_sampler
,
adapter_no3d_destroy_sampler
,
adapter_no3d_create_query
,
adapter_no3d_destroy_query
,
};
static
void
wined3d_adapter_no3d_init_d3d_info
(
struct
wined3d_adapter
*
adapter
,
unsigned
int
wined3d_creation_flags
)
...
...
dlls/wined3d/query.c
View file @
1174c894
...
...
@@ -54,7 +54,7 @@ static void wined3d_query_create_buffer_object(struct wined3d_context_gl *contex
query
->
buffer_object
=
buffer_object
;
}
static
void
wined3d_query
_destroy_buffer_object
(
struct
wined3d_context_gl
*
context_gl
,
struct
wined3d_query
*
query
)
void
wined3d_query_gl
_destroy_buffer_object
(
struct
wined3d_context_gl
*
context_gl
,
struct
wined3d_query
*
query
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context_gl
->
gl_info
;
...
...
@@ -93,7 +93,7 @@ static BOOL wined3d_query_buffer_queue_result(struct wined3d_context_gl *context
if
(
wined3d_query_buffer_is_valid
(
query
))
wined3d_query_buffer_invalidate
(
query
);
else
wined3d_query_destroy_buffer_object
(
context_gl
,
query
);
wined3d_query_
gl_
destroy_buffer_object
(
context_gl
,
query
);
}
if
(
!
query
->
buffer_object
)
...
...
@@ -430,21 +430,6 @@ static void wined3d_query_destroy_object(void *object)
if
(
!
list_empty
(
&
query
->
poll_list_entry
))
list_remove
(
&
query
->
poll_list_entry
);
if
(
query
->
buffer_object
)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
query
->
device
,
NULL
,
0
);
wined3d_query_destroy_buffer_object
(
wined3d_context_gl
(
context
),
query
);
context_release
(
context
);
}
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
* context, and (still) leaking the actual query. */
query
->
query_ops
->
query_destroy
(
query
);
}
ULONG
CDECL
wined3d_query_decref
(
struct
wined3d_query
*
query
)
...
...
@@ -455,8 +440,11 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
if
(
!
refcount
)
{
struct
wined3d_device
*
device
=
query
->
device
;
query
->
parent_ops
->
wined3d_object_destroyed
(
query
->
parent
);
wined3d_cs_destroy_object
(
query
->
device
->
cs
,
wined3d_query_destroy_object
,
query
);
wined3d_cs_destroy_object
(
device
->
cs
,
wined3d_query_destroy_object
,
query
);
device
->
adapter
->
adapter_ops
->
adapter_destroy_query
(
query
);
}
return
refcount
;
...
...
@@ -1332,7 +1320,7 @@ static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_query
_create
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
HRESULT
wined3d_query_gl
_create
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
)
{
TRACE
(
"device %p, type %#x, parent %p, parent_ops %p, query %p.
\n
"
,
...
...
@@ -1368,3 +1356,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
return
WINED3DERR_NOTAVAILABLE
;
}
}
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
)
{
TRACE
(
"device %p, type %#x, parent %p, parent_ops %p, query %p.
\n
"
,
device
,
type
,
parent
,
parent_ops
,
query
);
return
device
->
adapter
->
adapter_ops
->
adapter_create_query
(
device
,
type
,
parent
,
parent_ops
,
query
);
}
dlls/wined3d/wined3d_private.h
View file @
1174c894
...
...
@@ -1785,6 +1785,11 @@ struct wined3d_query
UINT64
*
map_ptr
;
};
HRESULT
wined3d_query_gl_create
(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
)
DECLSPEC_HIDDEN
;
void
wined3d_query_gl_destroy_buffer_object
(
struct
wined3d_context_gl
*
context_gl
,
struct
wined3d_query
*
query
)
DECLSPEC_HIDDEN
;
struct
wined3d_event_query
{
struct
wined3d_query
query
;
...
...
@@ -2808,6 +2813,9 @@ struct wined3d_adapter_ops
HRESULT
(
*
adapter_create_sampler
)(
struct
wined3d_device
*
device
,
const
struct
wined3d_sampler_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_sampler
**
sampler
);
void
(
*
adapter_destroy_sampler
)(
struct
wined3d_sampler
*
sampler
);
HRESULT
(
*
adapter_create_query
)(
struct
wined3d_device
*
device
,
enum
wined3d_query_type
type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_query
**
query
);
void
(
*
adapter_destroy_query
)(
struct
wined3d_query
*
query
);
};
/* The adapter structure */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment