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
8a8b57ce
Commit
8a8b57ce
authored
Jun 21, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send shader resource view destruction through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4afc7470
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
12 deletions
+52
-12
cs.c
dlls/wined3d/cs.c
+28
-0
view.c
dlls/wined3d/view.c
+22
-12
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/cs.c
View file @
8a8b57ce
...
...
@@ -52,6 +52,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_COLOR_KEY
,
WINED3D_CS_OP_SET_MATERIAL
,
WINED3D_CS_OP_RESET_STATE
,
WINED3D_CS_OP_DESTROY_OBJECT
,
};
struct
wined3d_cs_present
...
...
@@ -252,6 +253,13 @@ struct wined3d_cs_reset_state
enum
wined3d_cs_op
opcode
;
};
struct
wined3d_cs_destroy_object
{
enum
wined3d_cs_op
opcode
;
void
(
*
callback
)(
void
*
object
);
void
*
object
;
};
static
void
wined3d_cs_exec_present
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_present
*
op
=
data
;
...
...
@@ -1029,6 +1037,25 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_destroy_object
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_destroy_object
*
op
=
data
;
op
->
callback
(
op
->
object
);
}
void
wined3d_cs_emit_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
{
struct
wined3d_cs_destroy_object
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_DESTROY_OBJECT
;
op
->
callback
=
callback
;
op
->
object
=
object
;
cs
->
ops
->
submit
(
cs
);
}
static
void
(
*
const
wined3d_cs_op_handlers
[])(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
=
{
/* WINED3D_CS_OP_PRESENT */
wined3d_cs_exec_present
,
...
...
@@ -1057,6 +1084,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */
wined3d_cs_exec_set_color_key
,
/* WINED3D_CS_OP_SET_MATERIAL */
wined3d_cs_exec_set_material
,
/* WINED3D_CS_OP_RESET_STATE */
wined3d_cs_exec_reset_state
,
/* WINED3D_CS_OP_DESTROY_OBJECT */
wined3d_cs_exec_destroy_object
,
};
static
void
*
wined3d_cs_st_require_space
(
struct
wined3d_cs
*
cs
,
size_t
size
)
...
...
dlls/wined3d/view.c
View file @
8a8b57ce
...
...
@@ -194,6 +194,25 @@ ULONG CDECL wined3d_shader_resource_view_incref(struct wined3d_shader_resource_v
return
refcount
;
}
static
void
wined3d_shader_resource_view_destroy_object
(
void
*
object
)
{
struct
wined3d_shader_resource_view
*
view
=
object
;
if
(
view
->
object
)
{
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
context
=
context_acquire
(
view
->
resource
->
device
,
NULL
);
gl_info
=
context
->
gl_info
;
gl_info
->
gl_ops
.
gl
.
p_glDeleteTextures
(
1
,
&
view
->
object
);
checkGLcall
(
"glDeleteTextures"
);
context_release
(
context
);
}
HeapFree
(
GetProcessHeap
(),
0
,
view
);
}
ULONG
CDECL
wined3d_shader_resource_view_decref
(
struct
wined3d_shader_resource_view
*
view
)
{
ULONG
refcount
=
InterlockedDecrement
(
&
view
->
refcount
);
...
...
@@ -202,22 +221,13 @@ ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_v
if
(
!
refcount
)
{
if
(
view
->
object
)
{
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
context
=
context_acquire
(
view
->
resource
->
device
,
NULL
);
gl_info
=
context
->
gl_info
;
gl_info
->
gl_ops
.
gl
.
p_glDeleteTextures
(
1
,
&
view
->
object
);
checkGLcall
(
"glDeleteTextures"
);
context_release
(
context
);
}
struct
wined3d_device
*
device
=
view
->
resource
->
device
;
/* Call wined3d_object_destroyed() before releasing the resource,
* since releasing the resource may end up destroying the parent. */
view
->
parent_ops
->
wined3d_object_destroyed
(
view
->
parent
);
wined3d_resource_decref
(
view
->
resource
);
HeapFree
(
GetProcessHeap
(),
0
,
view
);
wined3d_cs_emit_destroy_object
(
device
->
cs
,
wined3d_shader_resource_view_destroy_object
,
view
);
}
return
refcount
;
...
...
dlls/wined3d/wined3d_private.h
View file @
8a8b57ce
...
...
@@ -2916,6 +2916,8 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void
wined3d_cs_emit_clear
(
struct
wined3d_cs
*
cs
,
DWORD
rect_count
,
const
RECT
*
rects
,
DWORD
flags
,
const
struct
wined3d_color
*
color
,
float
depth
,
DWORD
stencil
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_draw
(
struct
wined3d_cs
*
cs
,
int
base_vertex_idx
,
unsigned
int
start_idx
,
unsigned
int
index_count
,
unsigned
int
start_instance
,
unsigned
int
instance_count
,
BOOL
indexed
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_present
(
struct
wined3d_cs
*
cs
,
struct
wined3d_swapchain
*
swapchain
,
...
...
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