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
a3e1a6f2
Commit
a3e1a6f2
authored
Jan 27, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use correct texture stage limits in a couple of places.
parent
daf0aeb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
device.c
dlls/wined3d/device.c
+11
-5
state.c
dlls/wined3d/state.c
+3
-3
No files found.
dlls/wined3d/device.c
View file @
a3e1a6f2
...
...
@@ -3024,6 +3024,7 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
static
void
device_map_psamplers
(
IWineD3DDeviceImpl
*
This
)
{
const
WINED3DSAMPLER_TEXTURE_TYPE
*
sampler_type
=
((
IWineD3DPixelShaderImpl
*
)
This
->
stateBlock
->
pixelShader
)
->
baseShader
.
reg_maps
.
sampler_type
;
const
struct
wined3d_gl_info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
...
...
@@ -3031,7 +3032,8 @@ static void device_map_psamplers(IWineD3DDeviceImpl *This) {
{
device_map_stage
(
This
,
i
,
i
);
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_SAMPLER
(
i
));
if
(
i
<
MAX_TEXTURES
)
{
if
(
i
<
gl_info
->
limits
.
texture_stages
)
{
markTextureStagesDirty
(
This
,
i
);
}
}
...
...
@@ -3735,11 +3737,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetTextureStageState
(
IWineD3DDevice
*
iface
,
DWORD
Stage
,
WINED3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
DWORD
oldValue
=
This
->
updateStateBlock
->
textureState
[
Stage
][
Type
];
const
struct
wined3d_gl_info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
TRACE
(
"(%p) : Stage=%d, Type=%s(%d), Value=%d
\n
"
,
This
,
Stage
,
debug_d3dtexturestate
(
Type
),
Type
,
Value
);
if
(
Stage
>=
MAX_TEXTURES
)
{
WARN
(
"Attempting to set stage %u which is higher than the max stage %u, ignoring
\n
"
,
Stage
,
MAX_TEXTURES
-
1
);
if
(
Stage
>=
gl_info
->
limits
.
texture_stages
)
{
WARN
(
"Attempting to set stage %u which is higher than the max stage %u, ignoring.
\n
"
,
Stage
,
gl_info
->
limits
.
texture_stages
-
1
);
return
WINED3D_OK
;
}
...
...
@@ -3820,6 +3825,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
DWORD
stage
,
IWineD3DBaseTexture
*
texture
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
const
struct
wined3d_gl_info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
IWineD3DBaseTexture
*
prev
;
TRACE
(
"iface %p, stage %u, texture %p.
\n
"
,
iface
,
stage
,
texture
);
...
...
@@ -3878,7 +3884,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_PIXELSHADER
);
}
if
(
!
prev
&&
stage
<
MAX_TEXTURES
)
if
(
!
prev
&&
stage
<
gl_info
->
limits
.
texture_stages
)
{
/* The source arguments for color and alpha ops have different
* meanings when a NULL texture is bound, so the COLOROP and
...
...
@@ -3897,7 +3903,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
IWineD3DBaseTexture_Release
(
prev
);
if
(
!
texture
&&
stage
<
MAX_TEXTURES
)
if
(
!
texture
&&
stage
<
gl_info
->
limits
.
texture_stages
)
{
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_TEXTURESTAGE
(
stage
,
WINED3DTSS_COLOROP
));
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_TEXTURESTAGE
(
stage
,
WINED3DTSS_ALPHAOP
));
...
...
dlls/wined3d/state.c
View file @
a3e1a6f2
...
...
@@ -3601,9 +3601,9 @@ void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct w
}
}
else
{
/* Disabled the pixel shader - color ops weren't applied
* while it was enabled, so re-apply them.
*/
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
i
++
)
{
* while it was enabled, so re-apply them.
*/
for
(
i
=
0
;
i
<
context
->
gl_info
->
limits
.
texture_stages
;
++
i
)
{
if
(
!
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
i
,
WINED3DTSS_COLOROP
)))
{
device
->
StateTable
[
STATE_TEXTURESTAGE
(
i
,
WINED3DTSS_COLOROP
)].
apply
(
STATE_TEXTURESTAGE
(
i
,
WINED3DTSS_COLOROP
),
stateblock
,
context
);
...
...
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