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
2820ecc5
Commit
2820ecc5
authored
Jan 02, 2008
by
H. Verbeet
Committed by
Alexandre Julliard
Jan 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Call SetGlTextureDesc() from BindTexture() rather than from PreLoad().
parent
c46c53a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
cubetexture.c
dlls/wined3d/cubetexture.c
+15
-6
texture.c
dlls/wined3d/texture.c
+13
-6
No files found.
dlls/wined3d/cubetexture.c
View file @
2820ecc5
...
...
@@ -102,7 +102,6 @@ static DWORD WINAPI IWineD3DCubeTextureImpl_GetPriority(IWineD3DCubeTexture *ifa
static
void
WINAPI
IWineD3DCubeTextureImpl_PreLoad
(
IWineD3DCubeTexture
*
iface
)
{
/* Override the IWineD3DResource Preload method */
unsigned
int
i
,
j
;
BOOL
setGlTextureDesc
=
FALSE
;
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
BOOL
srgb_mode
=
This
->
baseTexture
.
is_srgb
;
...
...
@@ -110,8 +109,6 @@ static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) {
TRACE
(
"(%p) : About to load texture: dirtified(%d)
\n
"
,
This
,
This
->
baseTexture
.
dirty
);
if
(
This
->
baseTexture
.
textureName
==
0
)
setGlTextureDesc
=
TRUE
;
/* We only have to activate a context for gl when we're not drawing. In most cases PreLoad will be called during draw
* and a context was activated at the beginning of drawPrimitive
*/
...
...
@@ -132,8 +129,6 @@ static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) {
if
(
This
->
baseTexture
.
dirty
)
{
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
i
++
)
{
for
(
j
=
WINED3DCUBEMAP_FACE_POSITIVE_X
;
j
<=
WINED3DCUBEMAP_FACE_NEGATIVE_Z
;
j
++
)
{
if
(
setGlTextureDesc
)
IWineD3DSurface_SetGlTextureDesc
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
textureName
,
cube_targets
[
j
]);
IWineD3DSurface_LoadTexture
(
This
->
surfaces
[
j
][
i
],
srgb_mode
);
}
}
...
...
@@ -210,8 +205,22 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_GetDirty(IWineD3DCubeTexture *iface)
static
HRESULT
WINAPI
IWineD3DCubeTextureImpl_BindTexture
(
IWineD3DCubeTexture
*
iface
)
{
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
BOOL
set_gl_texture_desc
=
This
->
baseTexture
.
textureName
==
0
;
HRESULT
hr
;
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
return
IWineD3DBaseTextureImpl_BindTexture
((
IWineD3DBaseTexture
*
)
iface
);
hr
=
IWineD3DBaseTextureImpl_BindTexture
((
IWineD3DBaseTexture
*
)
iface
);
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
UINT
i
,
j
;
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
++
i
)
{
for
(
j
=
WINED3DCUBEMAP_FACE_POSITIVE_X
;
j
<=
WINED3DCUBEMAP_FACE_NEGATIVE_Z
;
++
j
)
{
IWineD3DSurface_SetGlTextureDesc
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
textureName
,
cube_targets
[
j
]);
}
}
}
return
hr
;
}
static
HRESULT
WINAPI
IWineD3DCubeTextureImpl_UnBindTexture
(
IWineD3DCubeTexture
*
iface
)
{
...
...
dlls/wined3d/texture.c
View file @
2820ecc5
...
...
@@ -95,7 +95,6 @@ static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) {
/* Override the IWineD3DResource PreLoad method */
unsigned
int
i
;
BOOL
setGlTextureDesc
=
FALSE
;
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
BOOL
srgb_mode
=
This
->
baseTexture
.
is_srgb
;
...
...
@@ -103,8 +102,6 @@ static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) {
TRACE
(
"(%p) : About to load texture
\n
"
,
This
);
if
(
This
->
baseTexture
.
textureName
==
0
)
setGlTextureDesc
=
TRUE
;
if
(
!
device
->
isInDraw
)
{
/* ActivateContext sets isInDraw to TRUE when loading a pbuffer into a texture, thus no danger of
* recursive calls
...
...
@@ -121,8 +118,6 @@ static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) {
/* If the texture is marked dirty or the srgb sampler setting has changed since the last load then reload the surfaces */
if
(
This
->
baseTexture
.
dirty
)
{
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
i
++
)
{
if
(
setGlTextureDesc
)
IWineD3DSurface_SetGlTextureDesc
(
This
->
surfaces
[
i
],
This
->
baseTexture
.
textureName
,
IWineD3DTexture_GetTextureDimensions
(
iface
));
IWineD3DSurface_LoadTexture
(
This
->
surfaces
[
i
],
srgb_mode
);
}
}
else
if
(
srgb_was_toggled
)
{
...
...
@@ -193,8 +188,20 @@ static BOOL WINAPI IWineD3DTextureImpl_GetDirty(IWineD3DTexture *iface) {
static
HRESULT
WINAPI
IWineD3DTextureImpl_BindTexture
(
IWineD3DTexture
*
iface
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
BOOL
set_gl_texture_desc
=
This
->
baseTexture
.
textureName
==
0
;
HRESULT
hr
;
TRACE
(
"(%p) : relay to BaseTexture
\n
"
,
This
);
return
IWineD3DBaseTextureImpl_BindTexture
((
IWineD3DBaseTexture
*
)
iface
);
hr
=
IWineD3DBaseTextureImpl_BindTexture
((
IWineD3DBaseTexture
*
)
iface
);
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
UINT
i
;
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
++
i
)
{
IWineD3DSurface_SetGlTextureDesc
(
This
->
surfaces
[
i
],
This
->
baseTexture
.
textureName
,
IWineD3DTexture_GetTextureDimensions
(
iface
));
}
}
return
hr
;
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_UnBindTexture
(
IWineD3DTexture
*
iface
)
{
...
...
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