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
738de80d
Commit
738de80d
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 constant buffer binding updates through the command stream.
parent
bd961941
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
22 deletions
+48
-22
cs.c
dlls/wined3d/cs.c
+38
-0
device.c
dlls/wined3d/device.c
+8
-22
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/cs.c
View file @
738de80d
...
@@ -37,6 +37,7 @@ enum wined3d_cs_op
...
@@ -37,6 +37,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_STREAM_SOURCE
,
WINED3D_CS_OP_SET_STREAM_SOURCE
,
WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ
,
WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ
,
WINED3D_CS_OP_SET_INDEX_BUFFER
,
WINED3D_CS_OP_SET_INDEX_BUFFER
,
WINED3D_CS_OP_SET_CONSTANT_BUFFER
,
WINED3D_CS_OP_SET_TEXTURE
,
WINED3D_CS_OP_SET_TEXTURE
,
WINED3D_CS_OP_SET_SHADER
,
WINED3D_CS_OP_SET_SHADER
,
WINED3D_CS_OP_SET_RENDER_STATE
,
WINED3D_CS_OP_SET_RENDER_STATE
,
...
@@ -134,6 +135,14 @@ struct wined3d_cs_set_index_buffer
...
@@ -134,6 +135,14 @@ struct wined3d_cs_set_index_buffer
enum
wined3d_format_id
format_id
;
enum
wined3d_format_id
format_id
;
};
};
struct
wined3d_cs_set_constant_buffer
{
enum
wined3d_cs_op
opcode
;
enum
wined3d_shader_type
type
;
UINT
cb_idx
;
struct
wined3d_buffer
*
buffer
;
};
struct
wined3d_cs_set_texture
struct
wined3d_cs_set_texture
{
{
enum
wined3d_cs_op
opcode
;
enum
wined3d_cs_op
opcode
;
...
@@ -493,6 +502,34 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
...
@@ -493,6 +502,34 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs
->
ops
->
submit
(
cs
);
cs
->
ops
->
submit
(
cs
);
}
}
static
void
wined3d_cs_exec_set_constant_buffer
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_set_constant_buffer
*
op
=
data
;
struct
wined3d_buffer
*
prev
;
prev
=
cs
->
state
.
cb
[
op
->
type
][
op
->
cb_idx
];
cs
->
state
.
cb
[
op
->
type
][
op
->
cb_idx
]
=
op
->
buffer
;
if
(
op
->
buffer
)
InterlockedIncrement
(
&
op
->
buffer
->
resource
.
bind_count
);
if
(
prev
)
InterlockedDecrement
(
&
prev
->
resource
.
bind_count
);
}
void
wined3d_cs_emit_set_constant_buffer
(
struct
wined3d_cs
*
cs
,
enum
wined3d_shader_type
type
,
UINT
cb_idx
,
struct
wined3d_buffer
*
buffer
)
{
struct
wined3d_cs_set_constant_buffer
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_SET_CONSTANT_BUFFER
;
op
->
type
=
type
;
op
->
cb_idx
=
cb_idx
;
op
->
buffer
=
buffer
;
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_set_texture
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
static
void
wined3d_cs_exec_set_texture
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
{
const
struct
wined3d_d3d_info
*
d3d_info
=
&
cs
->
device
->
adapter
->
d3d_info
;
const
struct
wined3d_d3d_info
*
d3d_info
=
&
cs
->
device
->
adapter
->
d3d_info
;
...
@@ -720,6 +757,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
...
@@ -720,6 +757,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_STREAM_SOURCE */
wined3d_cs_exec_set_stream_source
,
/* 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_SOURCE_FREQ */
wined3d_cs_exec_set_stream_source_freq
,
/* WINED3D_CS_OP_SET_INDEX_BUFFER */
wined3d_cs_exec_set_index_buffer
,
/* 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
,
/* WINED3D_CS_OP_SET_TEXTURE */
wined3d_cs_exec_set_texture
,
/* WINED3D_CS_OP_SET_SHADER */
wined3d_cs_exec_set_shader
,
/* WINED3D_CS_OP_SET_SHADER */
wined3d_cs_exec_set_shader
,
/* WINED3D_CS_OP_SET_RENDER_STATE */
wined3d_cs_exec_set_render_state
,
/* WINED3D_CS_OP_SET_RENDER_STATE */
wined3d_cs_exec_set_render_state
,
...
...
dlls/wined3d/device.c
View file @
738de80d
...
@@ -2098,30 +2098,16 @@ static void wined3d_device_set_constant_buffer(struct wined3d_device *device,
...
@@ -2098,30 +2098,16 @@ static void wined3d_device_set_constant_buffer(struct wined3d_device *device,
}
}
prev
=
device
->
update_state
->
cb
[
type
][
idx
];
prev
=
device
->
update_state
->
cb
[
type
][
idx
];
device
->
update_state
->
cb
[
type
][
idx
]
=
buffer
;
if
(
buffer
==
prev
)
if
(
device
->
recording
)
{
if
(
buffer
)
wined3d_buffer_incref
(
buffer
);
if
(
prev
)
wined3d_buffer_decref
(
prev
);
return
;
return
;
}
if
(
prev
!=
buffer
)
if
(
buffer
)
{
wined3d_buffer_incref
(
buffer
);
if
(
buffer
)
device
->
update_state
->
cb
[
type
][
idx
]
=
buffer
;
{
if
(
!
device
->
recording
)
InterlockedIncrement
(
&
buffer
->
resource
.
bind_count
);
wined3d_cs_emit_set_constant_buffer
(
device
->
cs
,
type
,
idx
,
buffer
);
wined3d_buffer_incref
(
buffer
);
if
(
prev
)
}
wined3d_buffer_decref
(
prev
);
if
(
prev
)
{
InterlockedDecrement
(
&
prev
->
resource
.
bind_count
);
wined3d_buffer_decref
(
prev
);
}
}
}
}
void
CDECL
wined3d_device_set_vs_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
void
CDECL
wined3d_device_set_vs_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
...
...
dlls/wined3d/wined3d_private.h
View file @
738de80d
...
@@ -2475,6 +2475,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
...
@@ -2475,6 +2475,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
const
RGNDATA
*
dirty_region
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
const
RGNDATA
*
dirty_region
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_clip_plane
(
struct
wined3d_cs
*
cs
,
UINT
plane_idx
,
void
wined3d_cs_emit_set_clip_plane
(
struct
wined3d_cs
*
cs
,
UINT
plane_idx
,
const
struct
wined3d_vec4
*
plane
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_vec4
*
plane
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_constant_buffer
(
struct
wined3d_cs
*
cs
,
enum
wined3d_shader_type
type
,
UINT
cb_idx
,
struct
wined3d_buffer
*
buffer
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_depth_stencil
(
struct
wined3d_cs
*
cs
,
struct
wined3d_surface
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_depth_stencil
(
struct
wined3d_cs
*
cs
,
struct
wined3d_surface
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_index_buffer
(
struct
wined3d_cs
*
cs
,
struct
wined3d_buffer
*
buffer
,
void
wined3d_cs_emit_set_index_buffer
(
struct
wined3d_cs
*
cs
,
struct
wined3d_buffer
*
buffer
,
enum
wined3d_format_id
format_id
)
DECLSPEC_HIDDEN
;
enum
wined3d_format_id
format_id
)
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