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
197ec1c1
Commit
197ec1c1
authored
Jan 02, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Remove IWineD3DDevice_ApplyStateChanges.
parent
c10efb34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
98 deletions
+18
-98
device.c
dlls/wined3d/device.c
+1
-81
state.c
dlls/wined3d/state.c
+17
-10
stateblock.c
dlls/wined3d/stateblock.c
+0
-4
wined3d_interface.h
include/wine/wined3d_interface.h
+0
-3
No files found.
dlls/wined3d/device.c
View file @
197ec1c1
...
@@ -315,84 +315,6 @@ static void delete_glsl_shader_list(IWineD3DDevice* iface) {
...
@@ -315,84 +315,6 @@ static void delete_glsl_shader_list(IWineD3DDevice* iface) {
}
}
}
}
/* Apply the current values to the specified texture stage */
static
void
WINAPI
IWineD3DDeviceImpl_SetupTextureStates
(
IWineD3DDevice
*
iface
,
DWORD
Sampler
,
DWORD
texture_idx
,
DWORD
Flags
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
float
col
[
4
];
union
{
float
f
;
DWORD
d
;
}
tmpvalue
;
/* In addition, IDirect3DDevice9::SetSamplerState will now be used for filtering, tiling,
clamping, MIPLOD, etc. This will work for up to 16 samplers.
*/
if
(
Sampler
>=
GL_LIMITS
(
sampler_stages
))
{
FIXME
(
"Trying to set the state of more samplers %d than are supported %d by this openGL implementation
\n
"
,
Sampler
,
GL_LIMITS
(
sampler_stages
));
return
;
}
VTRACE
((
"Activating appropriate texture state %d
\n
"
,
Sampler
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
ENTER_GL
();
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
texture_idx
));
checkGLcall
(
"glActiveTextureARB"
);
LEAVE_GL
();
/* Could we use bindTexture and then apply the states instead of GLACTIVETEXTURE */
}
else
if
(
Sampler
>
0
)
{
FIXME
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
return
;
}
/* TODO: change this to a lookup table
LOOKUP_TEXTURE_STATES lists all texture states that should be applied.
LOOKUP_CONTEXT_SATES list all context applicable states that can be applied
etc.... it's a lot cleaner, quicker and possibly easier to maintain than running a switch and setting a skip flag...
especially when there are a number of groups of states. */
TRACE
(
"-----------------------> Updating the texture at Sampler %d to have new texture state information
\n
"
,
Sampler
);
/* apply any sampler states that always need applying */
if
(
GL_SUPPORT
(
EXT_TEXTURE_LOD_BIAS
))
{
tmpvalue
.
d
=
This
->
stateBlock
->
samplerState
[
Sampler
][
WINED3DSAMP_MIPMAPLODBIAS
];
glTexEnvf
(
GL_TEXTURE_FILTER_CONTROL_EXT
,
GL_TEXTURE_LOD_BIAS_EXT
,
tmpvalue
.
f
);
checkGLcall
(
"glTexEnvi GL_TEXTURE_LOD_BIAS_EXT ..."
);
}
D3DCOLORTOGLFLOAT4
(
This
->
stateBlock
->
renderState
[
WINED3DRS_TEXTUREFACTOR
],
col
);
glTexEnvfv
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_COLOR
,
&
col
[
0
]);
checkGLcall
(
"glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);"
);
/* TODO: NV_POINT_SPRITE */
if
(
GL_SUPPORT
(
ARB_POINT_SPRITE
))
{
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSPRITEENABLE
])
{
/* Doesn't work with GL_POINT_SMOOTH on on my ATI 9600, but then ATI drivers are buggered! */
glDisable
(
GL_POINT_SMOOTH
);
/* Centre the texture on the vertex */
VTRACE
((
"glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)
\n
"
));
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
GL_TRUE
);
VTRACE
((
"glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)
\n
"
));
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
GL_TRUE
);
checkGLcall
(
"glTexEnvf(...)"
);
VTRACE
((
"glEnable( GL_POINT_SPRITE_ARB )
\n
"
));
glEnable
(
GL_POINT_SPRITE_ARB
);
checkGLcall
(
"glEnable(...)"
);
}
else
{
VTRACE
((
"glDisable( GL_POINT_SPRITE_ARB )
\n
"
));
glDisable
(
GL_POINT_SPRITE_ARB
);
checkGLcall
(
"glEnable(...)"
);
}
}
TRACE
(
"-----------------------> Updated the texture at Sampler %d to have new texture state information
\n
"
,
Sampler
);
}
/**********************************************************
/**********************************************************
* IUnknown parts follows
* IUnknown parts follows
**********************************************************/
**********************************************************/
...
@@ -3249,7 +3171,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
...
@@ -3249,7 +3171,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
* GL_MAX_TEXTURE_COORDS_ARB.
* GL_MAX_TEXTURE_COORDS_ARB.
* Ok GForce say it's ok to use glTexParameter/glGetTexParameter(...).
* Ok GForce say it's ok to use glTexParameter/glGetTexParameter(...).
******************/
******************/
/** NOTE: States are appl
ed in IWineD3DBaseTextre ApplyStateChanges and IWineD3DDevice SetupTextureStates
**/
/** NOTE: States are appl
ied in IWineD3DBaseTextre ApplyStateChanges the sampler state handler
**/
if
(
Sampler
>
GL_LIMITS
(
sampler_stages
)
||
Sampler
<
0
||
Type
>
WINED3D_HIGHEST_SAMPLER_STATE
||
Type
<
0
)
{
if
(
Sampler
>
GL_LIMITS
(
sampler_stages
)
||
Sampler
<
0
||
Type
>
WINED3D_HIGHEST_SAMPLER_STATE
||
Type
<
0
)
{
FIXME
(
"sampler %d type %s(%u) is out of range [max_samplers=%d, highest_state=%d]
\n
"
,
FIXME
(
"sampler %d type %s(%u) is out of range [max_samplers=%d, highest_state=%d]
\n
"
,
Sampler
,
debug_d3dsamplerstate
(
Type
),
Type
,
GL_LIMITS
(
sampler_stages
),
WINED3D_HIGHEST_SAMPLER_STATE
);
Sampler
,
debug_d3dsamplerstate
(
Type
),
Type
,
GL_LIMITS
(
sampler_stages
),
WINED3D_HIGHEST_SAMPLER_STATE
);
...
@@ -6864,8 +6786,6 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
...
@@ -6864,8 +6786,6 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_StretchRect
,
IWineD3DDeviceImpl_StretchRect
,
IWineD3DDeviceImpl_GetRenderTargetData
,
IWineD3DDeviceImpl_GetRenderTargetData
,
IWineD3DDeviceImpl_GetFrontBufferData
,
IWineD3DDeviceImpl_GetFrontBufferData
,
/*** Internal use IWineD3DDevice methods ***/
IWineD3DDeviceImpl_SetupTextureStates
,
/*** object tracking ***/
/*** object tracking ***/
IWineD3DDeviceImpl_ResourceReleased
IWineD3DDeviceImpl_ResourceReleased
};
};
...
...
dlls/wined3d/state.c
View file @
197ec1c1
...
@@ -1044,18 +1044,14 @@ static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
...
@@ -1044,18 +1044,14 @@ static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
return
;
return
;
}
}
/*
* Point sprites are always enabled. Value controls texture coordinate
* replacement mode. Must be set true for point sprites to use
* textures.
*/
glEnable
(
GL_POINT_SPRITE_ARB
);
checkGLcall
(
"glEnable(GL_POINT_SPRITE_ARB)"
);
if
(
stateblock
->
renderState
[
WINED3DRS_POINTSPRITEENABLE
])
{
if
(
stateblock
->
renderState
[
WINED3DRS_POINTSPRITEENABLE
])
{
glEnable
(
GL_POINT_SPRITE_ARB
);
checkGLcall
(
"glEnable(GL_POINT_SPRITE_ARB)"
);
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
TRUE
);
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
TRUE
);
checkGLcall
(
"glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, TRUE)"
);
checkGLcall
(
"glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, TRUE)"
);
}
else
{
}
else
{
glDisable
(
GL_POINT_SPRITE_ARB
);
checkGLcall
(
"glDisable(GL_POINT_SPRITE_ARB)"
);
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
FALSE
);
glTexEnvf
(
GL_POINT_SPRITE_ARB
,
GL_COORD_REPLACE_ARB
,
FALSE
);
checkGLcall
(
"glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, FALSE)"
);
checkGLcall
(
"glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, FALSE)"
);
}
}
...
@@ -1679,6 +1675,10 @@ static void tex_resultarg(DWORD state, IWineD3DStateBlockImpl *stateblock) {
...
@@ -1679,6 +1675,10 @@ static void tex_resultarg(DWORD state, IWineD3DStateBlockImpl *stateblock) {
static
void
sampler
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
static
void
sampler
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
DWORD
sampler
=
state
-
STATE_SAMPLER
(
0
);
DWORD
sampler
=
state
-
STATE_SAMPLER
(
0
);
union
{
float
f
;
DWORD
d
;
}
tmpvalue
;
TRACE
(
"Sampler: %d
\n
"
,
sampler
);
TRACE
(
"Sampler: %d
\n
"
,
sampler
);
/* Enabling and disabling texture dimensions is done by texture stage state / pixel shader setup, this function
/* Enabling and disabling texture dimensions is done by texture stage state / pixel shader setup, this function
...
@@ -1700,7 +1700,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock) {
...
@@ -1700,7 +1700,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock) {
if
(
stateblock
->
textures
[
sampler
])
{
if
(
stateblock
->
textures
[
sampler
])
{
/* NP2 textures need the texture matrix set properly for the stage */
/* NP2 textures need the texture matrix set properly for the stage */
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
&&
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
&&
sampler
<
MAX_TEXTURES
-
1
&&
stateblock
->
textureDimensions
[
sampler
]
==
GL_TEXTURE_2D
&&
stateblock
->
textureDimensions
[
sampler
]
==
GL_TEXTURE_2D
&&
(((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorX
!=
1
.
0
||
(((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorX
!=
1
.
0
||
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorY
!=
1
.
0
)
)
{
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorY
!=
1
.
0
)
)
{
...
@@ -1708,9 +1708,16 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock) {
...
@@ -1708,9 +1708,16 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
stateblock
->
textures
[
sampler
]);
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
stateblock
->
textures
[
sampler
]);
IWineD3DDevice_SetupTextureStates
((
IWineD3DDevice
*
)
stateblock
->
wineD3DDevice
,
sampler
,
stateblock
->
wineD3DDevice
->
texUnitMap
[
sampler
],
REAPPLY_ALPHAOP
);
IWineD3DBaseTexture_ApplyStateChanges
(
stateblock
->
textures
[
sampler
],
stateblock
->
textureState
[
sampler
],
stateblock
->
samplerState
[
sampler
]);
IWineD3DBaseTexture_ApplyStateChanges
(
stateblock
->
textures
[
sampler
],
stateblock
->
textureState
[
sampler
],
stateblock
->
samplerState
[
sampler
]);
if
(
GL_SUPPORT
(
EXT_TEXTURE_LOD_BIAS
))
{
tmpvalue
.
d
=
stateblock
->
samplerState
[
sampler
][
WINED3DSAMP_MIPMAPLODBIAS
];
glTexEnvf
(
GL_TEXTURE_FILTER_CONTROL_EXT
,
GL_TEXTURE_LOD_BIAS_EXT
,
tmpvalue
.
f
);
checkGLcall
(
"glTexEnvi GL_TEXTURE_LOD_BIAS_EXT ..."
);
}
if
(
stateblock
->
wineD3DDevice
->
ps_selected_mode
!=
SHADER_NONE
&&
stateblock
->
pixelShader
&&
if
(
stateblock
->
wineD3DDevice
->
ps_selected_mode
!=
SHADER_NONE
&&
stateblock
->
pixelShader
&&
((
IWineD3DPixelShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
function
)
{
((
IWineD3DPixelShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
function
)
{
/* Using a pixel shader? Verify the sampler types */
/* Using a pixel shader? Verify the sampler types */
...
...
dlls/wined3d/stateblock.c
View file @
197ec1c1
...
@@ -1069,10 +1069,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
...
@@ -1069,10 +1069,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
glTexImage1D
(
GL_TEXTURE_1D
,
0
,
GL_LUMINANCE
,
1
,
0
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
&
white
);
glTexImage1D
(
GL_TEXTURE_1D
,
0
,
GL_LUMINANCE
,
1
,
0
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
&
white
);
checkGLcall
(
"glTexImage1D"
);
checkGLcall
(
"glTexImage1D"
);
#if 1
/* TODO: move the setting texture states off to basetexture */
/* Reapply all the texture state information to this texture */
IWineD3DDevice_SetupTextureStates
(
device
,
i
,
i
,
REAPPLY_ALL
);
#endif
}
}
LEAVE_GL
();
LEAVE_GL
();
...
...
include/wine/wined3d_interface.h
View file @
197ec1c1
...
@@ -471,8 +471,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
...
@@ -471,8 +471,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD
(
StretchRect
)(
THIS_
struct
IWineD3DSurface
*
pSourceSurface
,
CONST
RECT
*
pSourceRect
,
struct
IWineD3DSurface
*
pDestinationSurface
,
CONST
RECT
*
pDestRect
,
WINED3DTEXTUREFILTERTYPE
Filter
)
PURE
;
STDMETHOD
(
StretchRect
)(
THIS_
struct
IWineD3DSurface
*
pSourceSurface
,
CONST
RECT
*
pSourceRect
,
struct
IWineD3DSurface
*
pDestinationSurface
,
CONST
RECT
*
pDestRect
,
WINED3DTEXTUREFILTERTYPE
Filter
)
PURE
;
STDMETHOD
(
GetRenderTargetData
)(
THIS_
struct
IWineD3DSurface
*
pRenderTarget
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
STDMETHOD
(
GetRenderTargetData
)(
THIS_
struct
IWineD3DSurface
*
pRenderTarget
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
STDMETHOD
(
GetFrontBufferData
)(
THIS_
UINT
iSwapChain
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
STDMETHOD
(
GetFrontBufferData
)(
THIS_
UINT
iSwapChain
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
/*** Internal use IWineD3Device methods ***/
STDMETHOD_
(
void
,
SetupTextureStates
)(
THIS_
DWORD
Stage
,
DWORD
texture_idx
,
DWORD
Flags
);
/*** object tracking ***/
/*** object tracking ***/
STDMETHOD_
(
void
,
ResourceReleased
)(
THIS_
struct
IWineD3DResource
*
resource
);
STDMETHOD_
(
void
,
ResourceReleased
)(
THIS_
struct
IWineD3DResource
*
resource
);
};
};
...
@@ -611,7 +609,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
...
@@ -611,7 +609,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
#define IWineD3DDevice_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
#define IWineD3DDevice_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b)
#define IWineD3DDevice_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b)
#define IWineD3DDevice_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b)
#define IWineD3DDevice_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b)
#define IWineD3DDevice_SetupTextureStates(p,a,b,c) (p)->lpVtbl->SetupTextureStates(p,a,b,c)
#define IWineD3DDevice_ResourceReleased(p,a) (p)->lpVtbl->ResourceReleased(p,a)
#define IWineD3DDevice_ResourceReleased(p,a) (p)->lpVtbl->ResourceReleased(p,a)
#endif
#endif
...
...
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