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
1419d738
Commit
1419d738
authored
Oct 10, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send stream output binding updates through the command stream.
parent
f699b6da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
25 deletions
+54
-25
cs.c
dlls/wined3d/cs.c
+41
-0
device.c
dlls/wined3d/device.c
+11
-25
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/cs.c
View file @
1419d738
...
...
@@ -36,6 +36,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_VERTEX_DECLARATION
,
WINED3D_CS_OP_SET_STREAM_SOURCE
,
WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ
,
WINED3D_CS_OP_SET_STREAM_OUTPUT
,
WINED3D_CS_OP_SET_INDEX_BUFFER
,
WINED3D_CS_OP_SET_CONSTANT_BUFFER
,
WINED3D_CS_OP_SET_TEXTURE
,
...
...
@@ -129,6 +130,14 @@ struct wined3d_cs_set_stream_source_freq
UINT
flags
;
};
struct
wined3d_cs_set_stream_output
{
enum
wined3d_cs_op
opcode
;
UINT
stream_idx
;
struct
wined3d_buffer
*
buffer
;
UINT
offset
;
};
struct
wined3d_cs_set_index_buffer
{
enum
wined3d_cs_op
opcode
;
...
...
@@ -481,6 +490,37 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_set_stream_output
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_set_stream_output
*
op
=
data
;
struct
wined3d_stream_output
*
stream
;
struct
wined3d_buffer
*
prev
;
stream
=
&
cs
->
state
.
stream_output
[
op
->
stream_idx
];
prev
=
stream
->
buffer
;
stream
->
buffer
=
op
->
buffer
;
stream
->
offset
=
op
->
offset
;
if
(
op
->
buffer
)
InterlockedIncrement
(
&
op
->
buffer
->
resource
.
bind_count
);
if
(
prev
)
InterlockedDecrement
(
&
prev
->
resource
.
bind_count
);
}
void
wined3d_cs_emit_set_stream_output
(
struct
wined3d_cs
*
cs
,
UINT
stream_idx
,
struct
wined3d_buffer
*
buffer
,
UINT
offset
)
{
struct
wined3d_cs_set_stream_output
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_SET_STREAM_OUTPUT
;
op
->
stream_idx
=
stream_idx
;
op
->
buffer
=
buffer
;
op
->
offset
=
offset
;
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_set_index_buffer
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_set_index_buffer
*
op
=
data
;
...
...
@@ -786,6 +826,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_VERTEX_DECLARATION */
wined3d_cs_exec_set_vertex_declaration
,
/* WINED3D_CS_OP_SET_STREAM_SOURCE */
wined3d_cs_exec_set_stream_source
,
/* WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ */
wined3d_cs_exec_set_stream_source_freq
,
/* WINED3D_CS_OP_SET_STREAM_OUTPUT */
wined3d_cs_exec_set_stream_output
,
/* WINED3D_CS_OP_SET_INDEX_BUFFER */
wined3d_cs_exec_set_index_buffer
,
/* WINED3D_CS_OP_SET_CONSTANT_BUFFER */
wined3d_cs_exec_set_constant_buffer
,
/* WINED3D_CS_OP_SET_TEXTURE */
wined3d_cs_exec_set_texture
,
...
...
dlls/wined3d/device.c
View file @
1419d738
...
...
@@ -1145,6 +1145,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
void
CDECL
wined3d_device_set_stream_output
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
,
UINT
offset
)
{
struct
wined3d_stream_output
*
stream
;
struct
wined3d_buffer
*
prev_buffer
;
TRACE
(
"device %p, idx %u, buffer %p, offset %u.
\n
"
,
device
,
idx
,
buffer
,
offset
);
...
...
@@ -1155,32 +1156,17 @@ void CDECL wined3d_device_set_stream_output(struct wined3d_device *device, UINT
return
;
}
prev_buffer
=
device
->
update_state
->
stream_output
[
idx
].
buffer
;
device
->
update_state
->
stream_output
[
idx
].
buffer
=
buffer
;
device
->
update_state
->
stream_output
[
idx
].
offset
=
offset
;
if
(
device
->
recording
)
{
if
(
buffer
)
wined3d_buffer_incref
(
buffer
);
if
(
prev_buffer
)
wined3d_buffer_decref
(
prev_buffer
);
return
;
}
stream
=
&
device
->
update_state
->
stream_output
[
idx
];
prev_buffer
=
stream
->
buffer
;
if
(
prev_buffer
!=
buffer
)
{
if
(
buffer
)
{
InterlockedIncrement
(
&
buffer
->
resource
.
bind_count
);
wined3d_buffer_incref
(
buffer
);
}
if
(
prev_buffer
)
{
InterlockedDecrement
(
&
prev_buffer
->
resource
.
bind_count
);
wined3d_buffer_decref
(
prev_buffer
);
}
}
if
(
buffer
)
wined3d_buffer_incref
(
buffer
);
stream
->
buffer
=
buffer
;
stream
->
offset
=
offset
;
if
(
!
device
->
recording
)
wined3d_cs_emit_set_stream_output
(
device
->
cs
,
idx
,
buffer
,
offset
);
if
(
prev_buffer
)
wined3d_buffer_decref
(
prev_buffer
);
}
struct
wined3d_buffer
*
CDECL
wined3d_device_get_stream_output
(
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/wined3d_private.h
View file @
1419d738
...
...
@@ -2492,6 +2492,8 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
void
wined3d_cs_emit_set_scissor_rect
(
struct
wined3d_cs
*
cs
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_shader
(
struct
wined3d_cs
*
cs
,
enum
wined3d_shader_type
type
,
struct
wined3d_shader
*
shader
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_stream_output
(
struct
wined3d_cs
*
cs
,
UINT
stream_idx
,
struct
wined3d_buffer
*
buffer
,
UINT
offset
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_stream_source
(
struct
wined3d_cs
*
cs
,
UINT
stream_idx
,
struct
wined3d_buffer
*
buffer
,
UINT
offset
,
UINT
stride
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_stream_source_freq
(
struct
wined3d_cs
*
cs
,
UINT
stream_idx
,
...
...
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