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
392a65fe
Commit
392a65fe
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 sampler binding points.
parent
3caefc83
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
63 deletions
+20
-63
device.c
dlls/wined3d/device.c
+16
-38
stateblock.c
dlls/wined3d/stateblock.c
+3
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-4
No files found.
dlls/wined3d/device.c
View file @
392a65fe
...
@@ -2144,20 +2144,19 @@ struct wined3d_buffer * CDECL wined3d_device_get_vs_cb(const struct wined3d_devi
...
@@ -2144,20 +2144,19 @@ struct wined3d_buffer * CDECL wined3d_device_get_vs_cb(const struct wined3d_devi
return
device
->
state
.
cb
[
WINED3D_SHADER_TYPE_VERTEX
][
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
)
static
void
wined3d_device_set_sampler
(
struct
wined3d_device
*
device
,
enum
wined3d_shader_type
type
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
{
{
struct
wined3d_sampler
*
prev
;
struct
wined3d_sampler
*
prev
;
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
if
(
idx
>=
MAX_SAMPLER_OBJECTS
)
if
(
idx
>=
MAX_SAMPLER_OBJECTS
)
{
{
WARN
(
"Invalid sampler index %u.
\n
"
,
idx
);
WARN
(
"Invalid sampler index %u.
\n
"
,
idx
);
return
;
return
;
}
}
prev
=
device
->
update_state
->
vs_sampler
[
idx
];
prev
=
device
->
update_state
->
sampler
[
type
]
[
idx
];
device
->
update_state
->
vs_sampler
[
idx
]
=
sampler
;
device
->
update_state
->
sampler
[
type
]
[
idx
]
=
sampler
;
if
(
sampler
)
if
(
sampler
)
wined3d_sampler_incref
(
sampler
);
wined3d_sampler_incref
(
sampler
);
...
@@ -2165,6 +2164,13 @@ void CDECL wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx
...
@@ -2165,6 +2164,13 @@ void CDECL wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx
wined3d_sampler_decref
(
prev
);
wined3d_sampler_decref
(
prev
);
}
}
void
CDECL
wined3d_device_set_vs_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
{
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
wined3d_device_set_sampler
(
device
,
WINED3D_SHADER_TYPE_VERTEX
,
idx
,
sampler
);
}
struct
wined3d_sampler
*
CDECL
wined3d_device_get_vs_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
struct
wined3d_sampler
*
CDECL
wined3d_device_get_vs_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
{
{
TRACE
(
"device %p, idx %u.
\n
"
,
device
,
idx
);
TRACE
(
"device %p, idx %u.
\n
"
,
device
,
idx
);
...
@@ -2175,7 +2181,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3
...
@@ -2175,7 +2181,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3
return
NULL
;
return
NULL
;
}
}
return
device
->
state
.
vs_sampler
[
idx
];
return
device
->
state
.
sampler
[
WINED3D_SHADER_TYPE_VERTEX
]
[
idx
];
}
}
static
void
device_invalidate_shader_constants
(
const
struct
wined3d_device
*
device
,
DWORD
mask
)
static
void
device_invalidate_shader_constants
(
const
struct
wined3d_device
*
device
,
DWORD
mask
)
...
@@ -2382,23 +2388,9 @@ struct wined3d_buffer * CDECL wined3d_device_get_ps_cb(const struct wined3d_devi
...
@@ -2382,23 +2388,9 @@ struct wined3d_buffer * CDECL wined3d_device_get_ps_cb(const struct wined3d_devi
void
CDECL
wined3d_device_set_ps_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
void
CDECL
wined3d_device_set_ps_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
{
{
struct
wined3d_sampler
*
prev
;
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
if
(
idx
>=
MAX_SAMPLER_OBJECTS
)
wined3d_device_set_sampler
(
device
,
WINED3D_SHADER_TYPE_PIXEL
,
idx
,
sampler
);
{
WARN
(
"Invalid sampler index %u.
\n
"
,
idx
);
return
;
}
prev
=
device
->
update_state
->
ps_sampler
[
idx
];
device
->
update_state
->
ps_sampler
[
idx
]
=
sampler
;
if
(
sampler
)
wined3d_sampler_incref
(
sampler
);
if
(
prev
)
wined3d_sampler_decref
(
prev
);
}
}
struct
wined3d_sampler
*
CDECL
wined3d_device_get_ps_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
struct
wined3d_sampler
*
CDECL
wined3d_device_get_ps_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
...
@@ -2411,7 +2403,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_ps_sampler(const struct wined3
...
@@ -2411,7 +2403,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_ps_sampler(const struct wined3
return
NULL
;
return
NULL
;
}
}
return
device
->
state
.
ps_sampler
[
idx
];
return
device
->
state
.
sampler
[
WINED3D_SHADER_TYPE_PIXEL
]
[
idx
];
}
}
HRESULT
CDECL
wined3d_device_set_ps_consts_b
(
struct
wined3d_device
*
device
,
HRESULT
CDECL
wined3d_device_set_ps_consts_b
(
struct
wined3d_device
*
device
,
...
@@ -2603,23 +2595,9 @@ struct wined3d_buffer * CDECL wined3d_device_get_gs_cb(const struct wined3d_devi
...
@@ -2603,23 +2595,9 @@ struct wined3d_buffer * CDECL wined3d_device_get_gs_cb(const struct wined3d_devi
void
CDECL
wined3d_device_set_gs_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
void
CDECL
wined3d_device_set_gs_sampler
(
struct
wined3d_device
*
device
,
UINT
idx
,
struct
wined3d_sampler
*
sampler
)
{
{
struct
wined3d_sampler
*
prev
;
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
TRACE
(
"device %p, idx %u, sampler %p.
\n
"
,
device
,
idx
,
sampler
);
if
(
idx
>=
MAX_SAMPLER_OBJECTS
)
wined3d_device_set_sampler
(
device
,
WINED3D_SHADER_TYPE_GEOMETRY
,
idx
,
sampler
);
{
WARN
(
"Invalid sampler index %u.
\n
"
,
idx
);
return
;
}
prev
=
device
->
update_state
->
gs_sampler
[
idx
];
device
->
update_state
->
gs_sampler
[
idx
]
=
sampler
;
if
(
sampler
)
wined3d_sampler_incref
(
sampler
);
if
(
prev
)
wined3d_sampler_decref
(
prev
);
}
}
struct
wined3d_sampler
*
CDECL
wined3d_device_get_gs_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
struct
wined3d_sampler
*
CDECL
wined3d_device_get_gs_sampler
(
const
struct
wined3d_device
*
device
,
UINT
idx
)
...
@@ -2632,7 +2610,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_gs_sampler(const struct wined3
...
@@ -2632,7 +2610,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_gs_sampler(const struct wined3
return
NULL
;
return
NULL
;
}
}
return
device
->
state
.
gs_sampler
[
idx
];
return
device
->
state
.
sampler
[
WINED3D_SHADER_TYPE_GEOMETRY
]
[
idx
];
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
...
...
dlls/wined3d/stateblock.c
View file @
392a65fe
...
@@ -520,33 +520,15 @@ void state_unbind_resources(struct wined3d_state *state)
...
@@ -520,33 +520,15 @@ void state_unbind_resources(struct wined3d_state *state)
wined3d_buffer_decref
(
buffer
);
wined3d_buffer_decref
(
buffer
);
}
}
}
}
}
for
(
i
=
0
;
i
<
MAX_SAMPLER_OBJECTS
;
++
i
)
{
if
((
sampler
=
state
->
vs_sampler
[
i
]))
{
state
->
vs_sampler
[
i
]
=
NULL
;
wined3d_sampler_decref
(
sampler
);
}
}
for
(
i
=
0
;
i
<
MAX_SAMPLER_OBJECTS
;
++
i
)
for
(
j
=
0
;
j
<
MAX_SAMPLER_OBJECTS
;
++
j
)
{
{
if
((
sampler
=
state
->
gs_sampler
[
i
]))
if
((
sampler
=
state
->
sampler
[
i
][
j
]))
{
{
state
->
gs_sampler
[
i
]
=
NULL
;
state
->
sampler
[
i
][
j
]
=
NULL
;
wined3d_sampler_decref
(
sampler
);
wined3d_sampler_decref
(
sampler
);
}
}
}
}
for
(
i
=
0
;
i
<
MAX_SAMPLER_OBJECTS
;
++
i
)
{
if
((
sampler
=
state
->
ps_sampler
[
i
]))
{
state
->
ps_sampler
[
i
]
=
NULL
;
wined3d_sampler_decref
(
sampler
);
}
}
}
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
392a65fe
...
@@ -1819,15 +1819,12 @@ struct wined3d_state
...
@@ -1819,15 +1819,12 @@ struct wined3d_state
struct
wined3d_shader
*
shader
[
WINED3D_SHADER_TYPE_COUNT
];
struct
wined3d_shader
*
shader
[
WINED3D_SHADER_TYPE_COUNT
];
struct
wined3d_buffer
*
cb
[
WINED3D_SHADER_TYPE_COUNT
][
MAX_CONSTANT_BUFFERS
];
struct
wined3d_buffer
*
cb
[
WINED3D_SHADER_TYPE_COUNT
][
MAX_CONSTANT_BUFFERS
];
struct
wined3d_sampler
*
sampler
[
WINED3D_SHADER_TYPE_COUNT
][
MAX_SAMPLER_OBJECTS
];
struct
wined3d_sampler
*
vs_sampler
[
MAX_SAMPLER_OBJECTS
];
BOOL
vs_consts_b
[
MAX_CONST_B
];
BOOL
vs_consts_b
[
MAX_CONST_B
];
INT
vs_consts_i
[
MAX_CONST_I
*
4
];
INT
vs_consts_i
[
MAX_CONST_I
*
4
];
float
*
vs_consts_f
;
float
*
vs_consts_f
;
struct
wined3d_sampler
*
gs_sampler
[
MAX_SAMPLER_OBJECTS
];
struct
wined3d_sampler
*
ps_sampler
[
MAX_SAMPLER_OBJECTS
];
BOOL
ps_consts_b
[
MAX_CONST_B
];
BOOL
ps_consts_b
[
MAX_CONST_B
];
INT
ps_consts_i
[
MAX_CONST_I
*
4
];
INT
ps_consts_i
[
MAX_CONST_I
*
4
];
float
*
ps_consts_f
;
float
*
ps_consts_f
;
...
...
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