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
e6d52c0c
Commit
e6d52c0c
authored
Sep 12, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add argument check for Type to Get/SetTextureStageState().
parent
7e8ab4c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
12 deletions
+64
-12
device.c
dlls/d3d8/device.c
+22
-4
device.c
dlls/d3d9/device.c
+16
-2
device.c
dlls/ddraw/device.c
+6
-3
device.c
dlls/wined3d/device.c
+20
-3
No files found.
dlls/d3d8/device.c
View file @
e6d52c0c
...
...
@@ -1575,13 +1575,22 @@ tss_lookup[] =
{
FALSE
,
WINED3DTSS_RESULTARG
},
/* 28, D3DTSS_RESULTARG */
};
static
HRESULT
WINAPI
IDirect3DDevice8Impl_GetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
static
HRESULT
WINAPI
IDirect3DDevice8Impl_GetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
Type
]
;
const
struct
tss_lookup
*
l
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, state %#x, value %p.
\n
"
,
iface
,
Stage
,
Type
,
pValue
);
if
(
Type
>=
sizeof
(
tss_lookup
)
/
sizeof
(
*
tss_lookup
))
{
WARN
(
"Invalid Type %#x passed.
\n
"
,
Type
);
return
D3D_OK
;
}
l
=
&
tss_lookup
[
Type
];
wined3d_mutex_lock
();
if
(
l
->
sampler_state
)
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
pValue
);
else
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
pValue
);
...
...
@@ -1590,13 +1599,22 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVI
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
Type
]
;
const
struct
tss_lookup
*
l
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, state %#x, value %#x.
\n
"
,
iface
,
Stage
,
Type
,
Value
);
if
(
Type
>=
sizeof
(
tss_lookup
)
/
sizeof
(
*
tss_lookup
))
{
WARN
(
"Invalid Type %#x passed.
\n
"
,
Type
);
return
D3D_OK
;
}
l
=
&
tss_lookup
[
Type
];
wined3d_mutex_lock
();
if
(
l
->
sampler_state
)
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
Value
);
else
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
Value
);
...
...
dlls/d3d9/device.c
View file @
e6d52c0c
...
...
@@ -1681,12 +1681,19 @@ static const WINED3DTEXTURESTAGESTATETYPE tss_lookup[] =
WINED3DTSS_CONSTANT
,
/* 32, D3DTSS_CONSTANT */
};
static
HRESULT
WINAPI
IDirect3DDevice9Impl_GetTextureStageState
(
LPDIRECT3DDEVICE9EX
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
static
HRESULT
WINAPI
IDirect3DDevice9Impl_GetTextureStageState
(
LPDIRECT3DDEVICE9EX
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, state %#x, value %p.
\n
"
,
iface
,
Stage
,
Type
,
pValue
);
if
(
Type
>=
sizeof
(
tss_lookup
)
/
sizeof
(
*
tss_lookup
))
{
WARN
(
"Invalid Type %#x passed.
\n
"
,
Type
);
return
D3D_OK
;
}
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
tss_lookup
[
Type
],
pValue
);
wined3d_mutex_unlock
();
...
...
@@ -1694,12 +1701,19 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVI
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_SetTextureStageState
(
LPDIRECT3DDEVICE9EX
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
static
HRESULT
WINAPI
IDirect3DDevice9Impl_SetTextureStageState
(
LPDIRECT3DDEVICE9EX
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, state %#x, value %#x.
\n
"
,
iface
,
Stage
,
Type
,
Value
);
if
(
Type
>=
sizeof
(
tss_lookup
)
/
sizeof
(
*
tss_lookup
))
{
WARN
(
"Invalid Type %#x passed.
\n
"
,
Type
);
return
D3D_OK
;
}
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
tss_lookup
[
Type
],
Value
);
wined3d_mutex_unlock
();
...
...
dlls/ddraw/device.c
View file @
e6d52c0c
...
...
@@ -4870,7 +4870,7 @@ IDirect3DDeviceImpl_7_GetTextureStageState(IDirect3DDevice7 *iface,
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
HRESULT
hr
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
TexStageStateType
]
;
const
struct
tss_lookup
*
l
;
TRACE
(
"iface %p, stage %u, state %#x, value %p.
\n
"
,
iface
,
Stage
,
TexStageStateType
,
State
);
...
...
@@ -4881,10 +4881,11 @@ IDirect3DDeviceImpl_7_GetTextureStageState(IDirect3DDevice7 *iface,
if
(
TexStageStateType
>
D3DTSS_TEXTURETRANSFORMFLAGS
)
{
WARN
(
"Invalid TexStageStateType %#x passed.
\n
"
,
TexStageStateType
);
*
State
=
0
;
return
DD_OK
;
}
l
=
&
tss_lookup
[
TexStageStateType
];
EnterCriticalSection
(
&
ddraw_cs
);
if
(
l
->
sampler_state
)
...
...
@@ -5003,7 +5004,7 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
DWORD
State
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
TexStageStateType
]
;
const
struct
tss_lookup
*
l
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, state %#x, value %#x.
\n
"
,
...
...
@@ -5015,6 +5016,8 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
return
DD_OK
;
}
l
=
&
tss_lookup
[
TexStageStateType
];
EnterCriticalSection
(
&
ddraw_cs
);
if
(
l
->
sampler_state
)
...
...
dlls/wined3d/device.c
View file @
e6d52c0c
...
...
@@ -4199,13 +4199,20 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
* Get / Set Texture Stage States
* TODO: Verify against dx9 definitions
*****/
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetTextureStageState
(
IWineD3DDevice
*
iface
,
DWORD
Stage
,
WINED3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
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
;
DWORD
oldValue
;
TRACE
(
"(%p) : Stage=%d, Type=%s(%d), Value=%d
\n
"
,
This
,
Stage
,
debug_d3dtexturestate
(
Type
),
Type
,
Value
);
if
(
Type
>
WINED3D_HIGHEST_TEXTURE_STATE
)
{
WARN
(
"Invalid Type %d passed.
\n
"
,
Type
);
return
WINED3D_OK
;
}
if
(
Stage
>=
gl_info
->
limits
.
texture_stages
)
{
WARN
(
"Attempting to set stage %u which is higher than the max stage %u, ignoring.
\n
"
,
...
...
@@ -4213,6 +4220,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
return
WINED3D_OK
;
}
oldValue
=
This
->
updateStateBlock
->
textureState
[
Stage
][
Type
];
This
->
updateStateBlock
->
changed
.
textureState
[
Stage
]
|=
1
<<
Type
;
This
->
updateStateBlock
->
textureState
[
Stage
][
Type
]
=
Value
;
...
...
@@ -4276,9 +4284,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetTextureStageState
(
IWineD3DDevice
*
iface
,
DWORD
Stage
,
WINED3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetTextureStageState
(
IWineD3DDevice
*
iface
,
DWORD
Stage
,
WINED3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
if
(
Type
>
WINED3D_HIGHEST_TEXTURE_STATE
)
{
WARN
(
"Invalid Type %d passed.
\n
"
,
Type
);
return
WINED3D_OK
;
}
TRACE
(
"(%p) : requesting Stage %d, Type %d getting %d
\n
"
,
This
,
Stage
,
Type
,
This
->
updateStateBlock
->
textureState
[
Stage
][
Type
]);
*
pValue
=
This
->
updateStateBlock
->
textureState
[
Stage
][
Type
];
return
WINED3D_OK
;
}
...
...
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