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
9e2498f2
Commit
9e2498f2
authored
Feb 16, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send sampler GL initialisation through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
325d415e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
49 additions
and
31 deletions
+49
-31
buffer.c
dlls/wined3d/buffer.c
+1
-1
cs.c
dlls/wined3d/cs.c
+18
-8
palette.c
dlls/wined3d/palette.c
+1
-1
query.c
dlls/wined3d/query.c
+1
-1
resource.c
dlls/wined3d/resource.c
+1
-1
sampler.c
dlls/wined3d/sampler.c
+16
-9
shader.c
dlls/wined3d/shader.c
+1
-1
state.c
dlls/wined3d/state.c
+1
-1
texture.c
dlls/wined3d/texture.c
+1
-1
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+1
-1
view.c
dlls/wined3d/view.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
No files found.
dlls/wined3d/buffer.c
View file @
9e2498f2
...
...
@@ -797,7 +797,7 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
{
buffer
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
buffer
->
resource
.
parent
);
resource_cleanup
(
&
buffer
->
resource
);
wined3d_cs_
emit_
destroy_object
(
buffer
->
resource
.
device
->
cs
,
wined3d_buffer_destroy_object
,
buffer
);
wined3d_cs_destroy_object
(
buffer
->
resource
.
device
->
cs
,
wined3d_buffer_destroy_object
,
buffer
);
}
return
refcount
;
...
...
dlls/wined3d/cs.c
View file @
9e2498f2
...
...
@@ -55,7 +55,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
,
WINED3D_CS_OP_
CALLBACK
,
WINED3D_CS_OP_QUERY_ISSUE
,
WINED3D_CS_OP_PRELOAD_RESOURCE
,
WINED3D_CS_OP_UNLOAD_RESOURCE
,
...
...
@@ -283,7 +283,7 @@ struct wined3d_cs_reset_state
enum
wined3d_cs_op
opcode
;
};
struct
wined3d_cs_
destroy_object
struct
wined3d_cs_
callback
{
enum
wined3d_cs_op
opcode
;
void
(
*
callback
)(
void
*
object
);
...
...
@@ -1389,25 +1389,35 @@ 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
)
static
void
wined3d_cs_exec_
callback
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_
destroy_object
*
op
=
data
;
const
struct
wined3d_cs_
callback
*
op
=
data
;
op
->
callback
(
op
->
object
);
}
void
wined3d_cs_emit_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
static
void
wined3d_cs_emit_callback
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
{
struct
wined3d_cs_
destroy_object
*
op
;
struct
wined3d_cs_
callback
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_
DESTROY_OBJECT
;
op
->
opcode
=
WINED3D_CS_OP_
CALLBACK
;
op
->
callback
=
callback
;
op
->
object
=
object
;
cs
->
ops
->
submit
(
cs
);
}
void
wined3d_cs_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
{
wined3d_cs_emit_callback
(
cs
,
callback
,
object
);
}
void
wined3d_cs_init_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
{
wined3d_cs_emit_callback
(
cs
,
callback
,
object
);
}
static
void
wined3d_cs_exec_query_issue
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_query_issue
*
op
=
data
;
...
...
@@ -1556,7 +1566,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
,
/* WINED3D_CS_OP_
CALLBACK */
wined3d_cs_exec_callback
,
/* WINED3D_CS_OP_QUERY_ISSUE */
wined3d_cs_exec_query_issue
,
/* WINED3D_CS_OP_PRELOAD_RESOURCE */
wined3d_cs_exec_preload_resource
,
/* WINED3D_CS_OP_UNLOAD_RESOURCE */
wined3d_cs_exec_unload_resource
,
...
...
dlls/wined3d/palette.c
View file @
9e2498f2
...
...
@@ -45,7 +45,7 @@ ULONG CDECL wined3d_palette_decref(struct wined3d_palette *palette)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
palette
,
refcount
);
if
(
!
refcount
)
wined3d_cs_
emit_
destroy_object
(
palette
->
device
->
cs
,
wined3d_palette_destroy_object
,
palette
);
wined3d_cs_destroy_object
(
palette
->
device
->
cs
,
wined3d_palette_destroy_object
,
palette
);
return
refcount
;
}
...
...
dlls/wined3d/query.c
View file @
9e2498f2
...
...
@@ -312,7 +312,7 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
query
,
refcount
);
if
(
!
refcount
)
wined3d_cs_
emit_
destroy_object
(
query
->
device
->
cs
,
wined3d_query_destroy_object
,
query
);
wined3d_cs_destroy_object
(
query
->
device
->
cs
,
wined3d_query_destroy_object
,
query
);
return
refcount
;
}
...
...
dlls/wined3d/resource.c
View file @
9e2498f2
...
...
@@ -256,7 +256,7 @@ void resource_cleanup(struct wined3d_resource *resource)
device_resource_released
(
resource
->
device
,
resource
);
wined3d_resource_acquire
(
resource
);
wined3d_cs_
emit_
destroy_object
(
resource
->
device
->
cs
,
wined3d_resource_destroy_object
,
resource
);
wined3d_cs_destroy_object
(
resource
->
device
->
cs
,
wined3d_resource_destroy_object
,
resource
);
}
void
resource_unload
(
struct
wined3d_resource
*
resource
)
...
...
dlls/wined3d/sampler.c
View file @
9e2498f2
...
...
@@ -54,7 +54,7 @@ ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
sampler
,
refcount
);
if
(
!
refcount
)
wined3d_cs_
emit_
destroy_object
(
sampler
->
device
->
cs
,
wined3d_sampler_destroy_object
,
sampler
);
wined3d_cs_destroy_object
(
sampler
->
device
->
cs
,
wined3d_sampler_destroy_object
,
sampler
);
return
refcount
;
}
...
...
@@ -66,20 +66,17 @@ void * CDECL wined3d_sampler_get_parent(const struct wined3d_sampler *sampler)
return
sampler
->
parent
;
}
static
void
wined3d_sampler_init
(
struct
wined3d_sampler
*
sampler
,
struct
wined3d_device
*
device
,
const
struct
wined3d_sampler_desc
*
desc
,
void
*
parent
)
static
void
wined3d_sampler_cs_init
(
void
*
object
)
{
struct
wined3d_sampler
*
sampler
=
object
;
const
struct
wined3d_sampler_desc
*
desc
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
sampler
->
refcount
=
1
;
sampler
->
device
=
device
;
sampler
->
parent
=
parent
;
sampler
->
desc
=
*
desc
;
context
=
context_acquire
(
device
,
NULL
,
0
);
context
=
context_acquire
(
sampler
->
device
,
NULL
,
0
);
gl_info
=
context
->
gl_info
;
desc
=
&
sampler
->
desc
;
GL_EXTCALL
(
glGenSamplers
(
1
,
&
sampler
->
name
));
GL_EXTCALL
(
glSamplerParameteri
(
sampler
->
name
,
GL_TEXTURE_WRAP_S
,
gl_info
->
wrap_lookup
[
desc
->
address_u
-
WINED3D_TADDRESS_WRAP
]));
...
...
@@ -111,6 +108,16 @@ static void wined3d_sampler_init(struct wined3d_sampler *sampler, struct wined3d
context_release
(
context
);
}
static
void
wined3d_sampler_init
(
struct
wined3d_sampler
*
sampler
,
struct
wined3d_device
*
device
,
const
struct
wined3d_sampler_desc
*
desc
,
void
*
parent
)
{
sampler
->
refcount
=
1
;
sampler
->
device
=
device
;
sampler
->
parent
=
parent
;
sampler
->
desc
=
*
desc
;
wined3d_cs_init_object
(
device
->
cs
,
wined3d_sampler_cs_init
,
sampler
);
}
HRESULT
CDECL
wined3d_sampler_create
(
struct
wined3d_device
*
device
,
const
struct
wined3d_sampler_desc
*
desc
,
void
*
parent
,
struct
wined3d_sampler
**
sampler
)
{
...
...
dlls/wined3d/shader.c
View file @
9e2498f2
...
...
@@ -2964,7 +2964,7 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
if
(
!
refcount
)
{
shader
->
parent_ops
->
wined3d_object_destroyed
(
shader
->
parent
);
wined3d_cs_
emit_
destroy_object
(
shader
->
device
->
cs
,
wined3d_shader_destroy_object
,
shader
);
wined3d_cs_destroy_object
(
shader
->
device
->
cs
,
wined3d_shader_destroy_object
,
shader
);
}
return
refcount
;
...
...
dlls/wined3d/state.c
View file @
9e2498f2
...
...
@@ -60,7 +60,7 @@ ULONG CDECL wined3d_rasterizer_state_decref(struct wined3d_rasterizer_state *sta
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
state
,
refcount
);
if
(
!
refcount
)
wined3d_cs_
emit_
destroy_object
(
device
->
cs
,
wined3d_rasterizer_state_destroy_object
,
state
);
wined3d_cs_destroy_object
(
device
->
cs
,
wined3d_rasterizer_state_destroy_object
,
state
);
return
refcount
;
}
...
...
dlls/wined3d/texture.c
View file @
9e2498f2
...
...
@@ -929,7 +929,7 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
wined3d_texture_sub_resources_destroyed
(
texture
);
texture
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
texture
->
resource
.
parent
);
resource_cleanup
(
&
texture
->
resource
);
wined3d_cs_
emit_
destroy_object
(
texture
->
resource
.
device
->
cs
,
wined3d_texture_destroy_object
,
texture
);
wined3d_cs_destroy_object
(
texture
->
resource
.
device
->
cs
,
wined3d_texture_destroy_object
,
texture
);
}
return
refcount
;
...
...
dlls/wined3d/vertexdeclaration.c
View file @
9e2498f2
...
...
@@ -67,7 +67,7 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration
if
(
!
refcount
)
{
declaration
->
parent_ops
->
wined3d_object_destroyed
(
declaration
->
parent
);
wined3d_cs_
emit_
destroy_object
(
declaration
->
device
->
cs
,
wined3d_cs_destroy_object
(
declaration
->
device
->
cs
,
wined3d_vertex_declaration_destroy_object
,
declaration
);
}
...
...
dlls/wined3d/view.c
View file @
9e2498f2
...
...
@@ -232,7 +232,7 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v
/* 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_cs_
emit_
destroy_object
(
device
->
cs
,
wined3d_rendertarget_view_destroy_object
,
view
);
wined3d_cs_destroy_object
(
device
->
cs
,
wined3d_rendertarget_view_destroy_object
,
view
);
wined3d_resource_decref
(
resource
);
}
...
...
@@ -462,7 +462,7 @@ ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_v
/* 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_cs_
emit_
destroy_object
(
device
->
cs
,
wined3d_shader_resource_view_destroy_object
,
view
);
wined3d_cs_destroy_object
(
device
->
cs
,
wined3d_shader_resource_view_destroy_object
,
view
);
wined3d_resource_decref
(
resource
);
}
...
...
@@ -630,7 +630,7 @@ ULONG CDECL wined3d_unordered_access_view_decref(struct wined3d_unordered_access
/* 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_cs_
emit_
destroy_object
(
device
->
cs
,
wined3d_unordered_access_view_destroy_object
,
view
);
wined3d_cs_destroy_object
(
device
->
cs
,
wined3d_unordered_access_view_destroy_object
,
view
);
wined3d_resource_decref
(
resource
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
9e2498f2
...
...
@@ -3174,11 +3174,10 @@ struct wined3d_cs
struct
wined3d_cs
*
wined3d_cs_create
(
struct
wined3d_device
*
device
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_destroy
(
struct
wined3d_cs
*
cs
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
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_dispatch
(
struct
wined3d_cs
*
cs
,
unsigned
int
group_count_x
,
unsigned
int
group_count_y
,
unsigned
int
group_count_z
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_draw
(
struct
wined3d_cs
*
cs
,
int
base_vertex_idx
,
unsigned
int
start_idx
,
unsigned
int
index_count
,
...
...
@@ -3233,6 +3232,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct
wined3d_vertex_declaration
*
declaration
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_viewport
(
struct
wined3d_cs
*
cs
,
const
struct
wined3d_viewport
*
viewport
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_unload_resource
(
struct
wined3d_cs
*
cs
,
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_init_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_cs_map
(
struct
wined3d_cs
*
cs
,
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
unsigned
int
flags
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_cs_unmap
(
struct
wined3d_cs
*
cs
,
struct
wined3d_resource
*
resource
,
...
...
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