Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
baf285d4
Commit
baf285d4
authored
Sep 27, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send draw operation through the command stream.
parent
708b938f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
5 deletions
+42
-5
cs.c
dlls/wined3d/cs.c
+36
-0
device.c
dlls/wined3d/device.c
+4
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/cs.c
View file @
baf285d4
...
...
@@ -27,6 +27,7 @@ enum wined3d_cs_op
{
WINED3D_CS_OP_PRESENT
,
WINED3D_CS_OP_CLEAR
,
WINED3D_CS_OP_DRAW
,
};
struct
wined3d_cs_present
...
...
@@ -51,6 +52,16 @@ struct wined3d_cs_clear
DWORD
stencil
;
};
struct
wined3d_cs_draw
{
enum
wined3d_cs_op
opcode
;
UINT
start_idx
;
UINT
index_count
;
UINT
start_instance
;
UINT
instance_count
;
BOOL
indexed
;
};
static
void
wined3d_cs_exec_present
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_present
*
op
=
data
;
...
...
@@ -111,10 +122,35 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_draw
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_draw
*
op
=
data
;
draw_primitive
(
cs
->
device
,
op
->
start_idx
,
op
->
index_count
,
op
->
start_instance
,
op
->
instance_count
,
op
->
indexed
);
}
void
wined3d_cs_emit_draw
(
struct
wined3d_cs
*
cs
,
UINT
start_idx
,
UINT
index_count
,
UINT
start_instance
,
UINT
instance_count
,
BOOL
indexed
)
{
struct
wined3d_cs_draw
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_DRAW
;
op
->
start_idx
=
start_idx
;
op
->
index_count
=
index_count
;
op
->
start_instance
=
start_instance
;
op
->
instance_count
=
instance_count
;
op
->
indexed
=
indexed
;
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
,
/* WINED3D_CS_OP_CLEAR */
wined3d_cs_exec_clear
,
/* WINED3D_CS_OP_DRAW */
wined3d_cs_exec_draw
,
};
static
void
*
wined3d_cs_st_require_space
(
struct
wined3d_cs
*
cs
,
size_t
size
)
...
...
dlls/wined3d/device.c
View file @
baf285d4
...
...
@@ -3542,9 +3542,8 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
device_invalidate_state
(
device
,
STATE_BASEVERTEXINDEX
);
}
/* Account for the loading offset due to index buffers. Instead of
* reloading all sources correct it with the startvertex parameter. */
draw_primitive
(
device
,
start_vertex
,
vertex_count
,
0
,
0
,
FALSE
);
wined3d_cs_emit_draw
(
device
->
cs
,
start_vertex
,
vertex_count
,
0
,
0
,
FALSE
);
return
WINED3D_OK
;
}
...
...
@@ -3577,7 +3576,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
device_invalidate_state
(
device
,
STATE_BASEVERTEXINDEX
);
}
draw_primitive
(
device
,
start_idx
,
index_count
,
0
,
0
,
TRUE
);
wined3d_cs_emit_draw
(
device
->
cs
,
start_idx
,
index_count
,
0
,
0
,
TRUE
);
return
WINED3D_OK
;
}
...
...
@@ -3587,7 +3586,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
{
TRACE
(
"device %p, start_idx %u, index_count %u.
\n
"
,
device
,
start_idx
,
index_count
);
draw_primitive
(
device
,
start_idx
,
index_count
,
start_instance
,
instance_count
,
TRUE
);
wined3d_cs_emit_draw
(
device
->
cs
,
start_idx
,
index_count
,
start_instance
,
instance_count
,
TRUE
);
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
...
...
dlls/wined3d/wined3d_private.h
View file @
baf285d4
...
...
@@ -2475,6 +2475,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_draw
(
struct
wined3d_cs
*
cs
,
UINT
start_idx
,
UINT
index_count
,
UINT
start_instance
,
UINT
instance_count
,
BOOL
indexed
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_present
(
struct
wined3d_cs
*
cs
,
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
HWND
dst_window_override
,
const
RGNDATA
*
dirty_region
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
...
...
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