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
5b5e3bd0
Commit
5b5e3bd0
authored
Sep 19, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Track GL texture states in a separate structure.
parent
1c93ab1e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
35 deletions
+45
-35
basetexture.c
dlls/wined3d/basetexture.c
+0
-0
context.c
dlls/wined3d/context.c
+6
-6
cubetexture.c
dlls/wined3d/cubetexture.c
+5
-5
surface.c
dlls/wined3d/surface.c
+3
-3
texture.c
dlls/wined3d/texture.c
+17
-13
volume.c
dlls/wined3d/volume.c
+2
-1
volumetexture.c
dlls/wined3d/volumetexture.c
+4
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-4
No files found.
dlls/wined3d/basetexture.c
View file @
5b5e3bd0
This diff is collapsed.
Click to expand it.
dlls/wined3d/context.c
View file @
5b5e3bd0
...
...
@@ -125,17 +125,17 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOO
/* Update base texture states array */
if
(
SUCCEEDED
(
IWineD3DSurface_GetContainer
(
surface
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
texture_impl
)))
{
if
(
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MINFILTER
]
!=
WINED3DTEXF_POINT
||
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MIPFILTER
]
!=
WINED3DTEXF_NONE
)
if
(
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MINFILTER
]
!=
WINED3DTEXF_POINT
||
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MIPFILTER
]
!=
WINED3DTEXF_NONE
)
{
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
update_minfilter
=
TRUE
;
}
if
(
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MAGFILTER
]
!=
WINED3DTEXF_POINT
)
if
(
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MAGFILTER
]
!=
WINED3DTEXF_POINT
)
{
texture_impl
->
baseTexture
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
texture_impl
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
update_magfilter
=
TRUE
;
}
...
...
dlls/wined3d/cubetexture.c
View file @
5b5e3bd0
...
...
@@ -56,7 +56,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
srgb_mode
=
This
->
baseTexture
.
is_srgb
;
break
;
}
dirty
=
srgb_mode
?
&
This
->
baseTexture
.
srgbDirty
:
&
This
->
baseTexture
.
dirty
;
dirty
=
srgb_mode
?
&
This
->
baseTexture
.
texture_srgb
.
dirty
:
&
This
->
baseTexture
.
texture_rgb
.
dirty
;
TRACE
(
"(%p) : About to load texture: dirtified(%u).
\n
"
,
This
,
*
dirty
);
...
...
@@ -293,9 +293,9 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *i
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
++
i
)
{
for
(
j
=
WINED3DCUBEMAP_FACE_POSITIVE_X
;
j
<=
WINED3DCUBEMAP_FACE_NEGATIVE_Z
;
++
j
)
{
if
(
This
->
baseTexture
.
is_srgb
)
{
surface_set_texture_name
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
srgbTextureN
ame
,
TRUE
);
surface_set_texture_name
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
texture_srgb
.
n
ame
,
TRUE
);
}
else
{
surface_set_texture_name
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
texture
N
ame
,
FALSE
);
surface_set_texture_name
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
texture
_rgb
.
n
ame
,
FALSE
);
}
}
}
...
...
@@ -387,8 +387,8 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *if
static
HRESULT
WINAPI
IWineD3DCubeTextureImpl_AddDirtyRect
(
IWineD3DCubeTexture
*
iface
,
WINED3DCUBEMAP_FACES
FaceType
,
CONST
RECT
*
pDirtyRect
)
{
HRESULT
hr
=
WINED3DERR_INVALIDCALL
;
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
This
->
baseTexture
.
dirty
=
TRUE
;
This
->
baseTexture
.
srgbD
irty
=
TRUE
;
This
->
baseTexture
.
texture_rgb
.
dirty
=
TRUE
;
This
->
baseTexture
.
texture_srgb
.
d
irty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of faceType(%d) Level (0)
\n
"
,
This
,
FaceType
);
if
(
FaceType
<=
WINED3DCUBEMAP_FACE_NEGATIVE_Z
)
{
surface_add_dirty_rect
(
This
->
surfaces
[
FaceType
][
0
],
pDirtyRect
);
...
...
dlls/wined3d/surface.c
View file @
5b5e3bd0
...
...
@@ -4696,9 +4696,9 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
*/
if
(
SUCCEEDED
(
IWineD3DSurface_GetContainer
((
IWineD3DSurface
*
)
This
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
texture
)))
{
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
((
IWineD3DBaseTextureImpl
*
)
texture
)
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
IWineD3DBaseTexture_Release
(
texture
);
}
}
...
...
dlls/wined3d/texture.c
View file @
5b5e3bd0
...
...
@@ -58,7 +58,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
srgb_mode
=
This
->
baseTexture
.
is_srgb
;
break
;
}
dirty
=
srgb_mode
?
&
This
->
baseTexture
.
srgbDirty
:
&
This
->
baseTexture
.
dirty
;
dirty
=
srgb_mode
?
&
This
->
baseTexture
.
texture_srgb
.
dirty
:
&
This
->
baseTexture
.
texture_rgb
.
dirty
;
if
(
!
device
->
isInDraw
)
{
...
...
@@ -275,12 +275,16 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
hr
=
basetexture_bind
((
IWineD3DBaseTexture
*
)
iface
,
srgb
,
&
set_gl_texture_desc
);
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
UINT
i
;
struct
gl_texture
*
gl_tex
;
if
(
This
->
baseTexture
.
is_srgb
)
{
gl_tex
=
&
This
->
baseTexture
.
texture_srgb
;
}
else
{
gl_tex
=
&
This
->
baseTexture
.
texture_rgb
;
}
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
++
i
)
{
if
(
This
->
baseTexture
.
is_srgb
)
{
surface_set_texture_name
(
This
->
surfaces
[
i
],
This
->
baseTexture
.
srgbTextureName
,
TRUE
);
}
else
{
surface_set_texture_name
(
This
->
surfaces
[
i
],
This
->
baseTexture
.
textureName
,
FALSE
);
}
surface_set_texture_name
(
This
->
surfaces
[
i
],
gl_tex
->
name
,
This
->
baseTexture
.
is_srgb
);
}
/* Conditinal non power of two textures use a different clamping default. If we're using the GL_WINE_normalized_texrect
* partial driver emulation, we're dealing with a GL_TEXTURE_2D texture which has the address mode set to repeat - something
...
...
@@ -298,11 +302,11 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
glTexParameteri
(
IWineD3DTexture_GetTextureDimensions
(
iface
),
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
checkGLcall
(
"glTexParameteri(dimension, GL_TEXTURE_MAG_FILTER, GL_NEAREST)"
);
LEAVE_GL
();
This
->
baseTexture
.
states
[
WINED3DTEXSTA_ADDRESSU
]
=
WINED3DTADDRESS_CLAMP
;
This
->
baseTexture
.
states
[
WINED3DTEXSTA_ADDRESSV
]
=
WINED3DTADDRESS_CLAMP
;
This
->
baseTexture
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
This
->
baseTexture
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
This
->
baseTexture
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
]
=
WINED3DTADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
]
=
WINED3DTADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
}
}
...
...
@@ -388,8 +392,8 @@ static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UIN
static
HRESULT
WINAPI
IWineD3DTextureImpl_AddDirtyRect
(
IWineD3DTexture
*
iface
,
CONST
RECT
*
pDirtyRect
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
This
->
baseTexture
.
dirty
=
TRUE
;
This
->
baseTexture
.
srgbD
irty
=
TRUE
;
This
->
baseTexture
.
texture_rgb
.
dirty
=
TRUE
;
This
->
baseTexture
.
texture_srgb
.
d
irty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of surface Level (0)
\n
"
,
This
);
surface_add_dirty_rect
(
This
->
surfaces
[
0
],
pDirtyRect
);
...
...
dlls/wined3d/volume.c
View file @
5b5e3bd0
...
...
@@ -266,7 +266,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
if
(
containerType
==
WINED3DRTYPE_VOLUMETEXTURE
)
{
IWineD3DBaseTextureImpl
*
pTexture
=
(
IWineD3DBaseTextureImpl
*
)
cont
;
pTexture
->
baseTexture
.
dirty
=
TRUE
;
pTexture
->
baseTexture
.
texture_rgb
.
dirty
=
TRUE
;
pTexture
->
baseTexture
.
texture_srgb
.
dirty
=
TRUE
;
}
else
{
FIXME
(
"Set dirty on container type %d
\n
"
,
containerType
);
}
...
...
dlls/wined3d/volumetexture.c
View file @
5b5e3bd0
...
...
@@ -53,7 +53,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
/* If the texture is marked dirty or the srgb sampler setting has changed
* since the last load then reload the volumes. */
if
(
This
->
baseTexture
.
dirty
)
if
(
This
->
baseTexture
.
texture_rgb
.
dirty
)
{
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
++
i
)
{
...
...
@@ -74,7 +74,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
}
/* No longer dirty */
This
->
baseTexture
.
dirty
=
FALSE
;
This
->
baseTexture
.
texture_rgb
.
dirty
=
FALSE
;
}
static
void
volumetexture_cleanup
(
IWineD3DVolumeTextureImpl
*
This
)
...
...
@@ -312,7 +312,8 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture
static
HRESULT
WINAPI
IWineD3DVolumeTextureImpl_AddDirtyBox
(
IWineD3DVolumeTexture
*
iface
,
CONST
WINED3DBOX
*
pDirtyBox
)
{
IWineD3DVolumeTextureImpl
*
This
=
(
IWineD3DVolumeTextureImpl
*
)
iface
;
This
->
baseTexture
.
dirty
=
TRUE
;
This
->
baseTexture
.
texture_rgb
.
dirty
=
TRUE
;
This
->
baseTexture
.
texture_srgb
.
dirty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of volume Level (0)
\n
"
,
This
);
volume_add_dirty_box
(
This
->
volumes
[
0
],
pDirtyBox
);
...
...
dlls/wined3d/wined3d_private.h
View file @
5b5e3bd0
...
...
@@ -1756,16 +1756,20 @@ enum WINED3DSRGB
SRGB_BOTH
=
3
,
/* Loads both textures */
};
struct
gl_texture
{
DWORD
states
[
MAX_WINETEXTURESTATES
];
BOOL
dirty
;
GLuint
name
;
};
/*****************************************************************************
* IWineD3DBaseTexture implementation structure (extends IWineD3DResourceImpl)
*/
typedef
struct
IWineD3DBaseTextureClass
{
DWORD
states
[
MAX_WINETEXTURESTATES
];
DWORD
srgbstates
[
MAX_WINETEXTURESTATES
];
struct
gl_texture
texture_rgb
,
texture_srgb
;
UINT
levels
;
BOOL
dirty
,
srgbDirty
;
UINT
textureName
,
srgbTextureName
;
float
pow2Matrix
[
16
];
UINT
LOD
;
WINED3DTEXTUREFILTERTYPE
filterType
;
...
...
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