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
3caefc83
Commit
3caefc83
authored
Oct 09, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Unify constant buffer binding points.
parent
c228ffba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
102 deletions
+24
-102
device.c
dlls/wined3d/device.c
+16
-74
stateblock.c
dlls/wined3d/stateblock.c
+7
-25
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-3
No files found.
dlls/wined3d/device.c
View file @
3caefc83
...
...
@@ -2086,20 +2086,19 @@ struct wined3d_shader * CDECL wined3d_device_get_vertex_shader(const struct wine
return
device
->
state
.
shader
[
WINED3D_SHADER_TYPE_VERTEX
];
}
void
CDECL
wined3d_device_set_vs_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
static
void
wined3d_device_set_constant_buffer
(
struct
wined3d_device
*
device
,
enum
wined3d_shader_type
type
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
{
struct
wined3d_buffer
*
prev
;
TRACE
(
"device %p, idx %u, buffer %p.
\n
"
,
device
,
idx
,
buffer
);
if
(
idx
>=
MAX_CONSTANT_BUFFERS
)
{
WARN
(
"Invalid constant buffer index %u.
\n
"
,
idx
);
return
;
}
prev
=
device
->
update_state
->
vs_cb
[
idx
];
device
->
update_state
->
vs_cb
[
idx
]
=
buffer
;
prev
=
device
->
update_state
->
cb
[
type
]
[
idx
];
device
->
update_state
->
cb
[
type
]
[
idx
]
=
buffer
;
if
(
device
->
recording
)
{
...
...
@@ -2125,6 +2124,13 @@ void CDECL wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, str
}
}
void
CDECL
wined3d_device_set_vs_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
{
TRACE
(
"device %p, idx %u, buffer %p.
\n
"
,
device
,
idx
,
buffer
);
wined3d_device_set_constant_buffer
(
device
,
WINED3D_SHADER_TYPE_VERTEX
,
idx
,
buffer
);
}
struct
wined3d_buffer
*
CDECL
wined3d_device_get_vs_cb
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
{
TRACE
(
"device %p, idx %u.
\n
"
,
device
,
idx
);
...
...
@@ -2135,7 +2141,7 @@ struct wined3d_buffer * CDECL wined3d_device_get_vs_cb(const struct wined3d_devi
return
NULL
;
}
return
device
->
state
.
vs_cb
[
idx
];
return
device
->
state
.
cb
[
WINED3D_SHADER_TYPE_VERTEX
]
[
idx
];
}
void
CDECL
wined3d_device_set_vs_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
...
...
@@ -2356,41 +2362,9 @@ struct wined3d_shader * CDECL wined3d_device_get_pixel_shader(const struct wined
void
CDECL
wined3d_device_set_ps_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
{
struct
wined3d_buffer
*
prev
;
TRACE
(
"device %p, idx %u, buffer %p.
\n
"
,
device
,
idx
,
buffer
);
if
(
idx
>=
MAX_CONSTANT_BUFFERS
)
{
WARN
(
"Invalid constant buffer index %u.
\n
"
,
idx
);
return
;
}
prev
=
device
->
update_state
->
ps_cb
[
idx
];
device
->
update_state
->
ps_cb
[
idx
]
=
buffer
;
if
(
device
->
recording
)
{
if
(
buffer
)
wined3d_buffer_incref
(
buffer
);
if
(
prev
)
wined3d_buffer_decref
(
prev
);
return
;
}
if
(
prev
!=
buffer
)
{
if
(
buffer
)
{
InterlockedIncrement
(
&
buffer
->
resource
.
bind_count
);
wined3d_buffer_incref
(
buffer
);
}
if
(
prev
)
{
InterlockedDecrement
(
&
prev
->
resource
.
bind_count
);
wined3d_buffer_decref
(
prev
);
}
}
wined3d_device_set_constant_buffer
(
device
,
WINED3D_SHADER_TYPE_PIXEL
,
idx
,
buffer
);
}
struct
wined3d_buffer
*
CDECL
wined3d_device_get_ps_cb
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
...
...
@@ -2403,7 +2377,7 @@ struct wined3d_buffer * CDECL wined3d_device_get_ps_cb(const struct wined3d_devi
return
NULL
;
}
return
device
->
state
.
ps_cb
[
idx
];
return
device
->
state
.
cb
[
WINED3D_SHADER_TYPE_PIXEL
]
[
idx
];
}
void
CDECL
wined3d_device_set_ps_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
...
...
@@ -2609,41 +2583,9 @@ struct wined3d_shader * CDECL wined3d_device_get_geometry_shader(const struct wi
void
CDECL
wined3d_device_set_gs_cb
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_buffer
*
buffer
)
{
struct
wined3d_buffer
*
prev
;
TRACE
(
"device %p, idx %u, buffer %p.
\n
"
,
device
,
idx
,
buffer
);
if
(
idx
>=
MAX_CONSTANT_BUFFERS
)
{
WARN
(
"Invalid constant buffer index %u.
\n
"
,
idx
);
return
;
}
prev
=
device
->
update_state
->
gs_cb
[
idx
];
device
->
update_state
->
gs_cb
[
idx
]
=
buffer
;
if
(
device
->
recording
)
{
if
(
buffer
)
wined3d_buffer_incref
(
buffer
);
if
(
prev
)
wined3d_buffer_decref
(
prev
);
return
;
}
if
(
prev
!=
buffer
)
{
if
(
buffer
)
{
InterlockedIncrement
(
&
buffer
->
resource
.
bind_count
);
wined3d_buffer_incref
(
buffer
);
}
if
(
prev
)
{
InterlockedDecrement
(
&
prev
->
resource
.
bind_count
);
wined3d_buffer_decref
(
prev
);
}
}
wined3d_device_set_constant_buffer
(
device
,
WINED3D_SHADER_TYPE_GEOMETRY
,
idx
,
buffer
);
}
struct
wined3d_buffer
*
CDECL
wined3d_device_get_gs_cb
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
...
...
@@ -2656,7 +2598,7 @@ struct wined3d_buffer * CDECL wined3d_device_get_gs_cb(const struct wined3d_devi
return
NULL
;
}
return
device
->
state
.
gs_cb
[
idx
];
return
device
->
state
.
cb
[
WINED3D_SHADER_TYPE_GEOMETRY
]
[
idx
];
}
void
CDECL
wined3d_device_set_gs_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
...
...
dlls/wined3d/stateblock.c
View file @
3caefc83
...
...
@@ -463,7 +463,7 @@ void state_unbind_resources(struct wined3d_state *state)
struct
wined3d_texture
*
texture
;
struct
wined3d_buffer
*
buffer
;
struct
wined3d_shader
*
shader
;
unsigned
int
i
;
unsigned
int
i
,
j
;
if
((
decl
=
state
->
vertex_declaration
))
{
...
...
@@ -511,14 +511,14 @@ void state_unbind_resources(struct wined3d_state *state)
state
->
shader
[
i
]
=
NULL
;
wined3d_shader_decref
(
shader
);
}
}
for
(
i
=
0
;
i
<
MAX_CONSTANT_BUFFERS
;
++
i
)
{
if
((
buffer
=
state
->
vs_cb
[
i
]))
for
(
j
=
0
;
j
<
MAX_CONSTANT_BUFFERS
;
++
j
)
{
state
->
vs_cb
[
i
]
=
NULL
;
wined3d_buffer_decref
(
buffer
);
if
((
buffer
=
state
->
cb
[
i
][
j
]))
{
state
->
cb
[
i
][
j
]
=
NULL
;
wined3d_buffer_decref
(
buffer
);
}
}
}
...
...
@@ -531,15 +531,6 @@ void state_unbind_resources(struct wined3d_state *state)
}
}
for
(
i
=
0
;
i
<
MAX_CONSTANT_BUFFERS
;
++
i
)
{
if
((
buffer
=
state
->
gs_cb
[
i
]))
{
state
->
gs_cb
[
i
]
=
NULL
;
wined3d_buffer_decref
(
buffer
);
}
}
for
(
i
=
0
;
i
<
MAX_SAMPLER_OBJECTS
;
++
i
)
{
if
((
sampler
=
state
->
gs_sampler
[
i
]))
...
...
@@ -557,15 +548,6 @@ void state_unbind_resources(struct wined3d_state *state)
wined3d_sampler_decref
(
sampler
);
}
}
for
(
i
=
0
;
i
<
MAX_CONSTANT_BUFFERS
;
++
i
)
{
if
((
buffer
=
state
->
ps_cb
[
i
]))
{
state
->
ps_cb
[
i
]
=
NULL
;
wined3d_buffer_decref
(
buffer
);
}
}
}
void
state_cleanup
(
struct
wined3d_state
*
state
)
...
...
dlls/wined3d/wined3d_private.h
View file @
3caefc83
...
...
@@ -1818,17 +1818,15 @@ struct wined3d_state
GLenum
gl_primitive_type
;
struct
wined3d_shader
*
shader
[
WINED3D_SHADER_TYPE_COUNT
];
struct
wined3d_buffer
*
cb
[
WINED3D_SHADER_TYPE_COUNT
][
MAX_CONSTANT_BUFFERS
];
struct
wined3d_buffer
*
vs_cb
[
MAX_CONSTANT_BUFFERS
];
struct
wined3d_sampler
*
vs_sampler
[
MAX_SAMPLER_OBJECTS
];
BOOL
vs_consts_b
[
MAX_CONST_B
];
INT
vs_consts_i
[
MAX_CONST_I
*
4
];
float
*
vs_consts_f
;
struct
wined3d_buffer
*
gs_cb
[
MAX_CONSTANT_BUFFERS
];
struct
wined3d_sampler
*
gs_sampler
[
MAX_SAMPLER_OBJECTS
];
struct
wined3d_buffer
*
ps_cb
[
MAX_CONSTANT_BUFFERS
];
struct
wined3d_sampler
*
ps_sampler
[
MAX_SAMPLER_OBJECTS
];
BOOL
ps_consts_b
[
MAX_CONST_B
];
INT
ps_consts_i
[
MAX_CONST_I
*
4
];
...
...
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