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
18f3fcb1
Commit
18f3fcb1
authored
Jul 18, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Jul 18, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set mipmap levels correctly (even with ATI's buggy drivers).
parent
e0241349
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
basetexture.c
dlls/wined3d/basetexture.c
+20
-8
drawprim.c
dlls/wined3d/drawprim.c
+2
-4
No files found.
dlls/wined3d/basetexture.c
View file @
18f3fcb1
...
@@ -205,6 +205,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
...
@@ -205,6 +205,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
IWineD3DBaseTextureImpl
*
This
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
IWineD3DBaseTextureImpl
*
This
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
HRESULT
hr
=
D3D_OK
;
HRESULT
hr
=
D3D_OK
;
UINT
textureDimensions
;
UINT
textureDimensions
;
BOOL
isNewTexture
=
FALSE
;
TRACE
(
"(%p) : About to bind texture
\n
"
,
This
);
TRACE
(
"(%p) : About to bind texture
\n
"
,
This
);
textureDimensions
=
IWineD3DBaseTexture_GetTextureDimensions
(
iface
);
textureDimensions
=
IWineD3DBaseTexture_GetTextureDimensions
(
iface
);
...
@@ -227,25 +228,36 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
...
@@ -227,25 +228,36 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
glPrioritizeTextures
(
1
,
&
This
->
baseTexture
.
textureName
,
&
tmp
);
glPrioritizeTextures
(
1
,
&
This
->
baseTexture
.
textureName
,
&
tmp
);
}
}
IWineD3DBaseTexture_SetDirty
(
iface
,
TRUE
);
IWineD3DBaseTexture_SetDirty
(
iface
,
TRUE
);
isNewTexture
=
TRUE
;
}
}
/* Bind the texture */
/* Bind the texture */
if
(
This
->
baseTexture
.
textureName
!=
0
)
{
if
(
This
->
baseTexture
.
textureName
!=
0
)
{
/* Always need to reset the number of mipmap levels when rebinding as it is
a property of the active texture unit, and another texture may have set it
to a different value */
if
(
This
->
baseTexture
.
levels
>
0
)
{
TRACE
(
"Setting GL_TEXTURE_MAX_LEVEL to %d
\n
"
,
This
->
baseTexture
.
levels
-
1
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAX_LEVEL
,
This
->
baseTexture
.
levels
-
1
);
checkGLcall
(
"glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)"
);
}
else
{
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
}
glBindTexture
(
textureDimensions
,
This
->
baseTexture
.
textureName
);
glBindTexture
(
textureDimensions
,
This
->
baseTexture
.
textureName
);
checkGLcall
(
"glBindTexture"
);
checkGLcall
(
"glBindTexture"
);
if
(
isNewTexture
)
{
/* For a new texture we have to set the textures levels after binding the texture,
* in theory this is all we should ever have to dom, but because ATI's drivers are broken we
* also need to set the texture dimensins before the texture is is set */
TRACE
(
"Setting GL_TEXTURE_MAX_LEVEL to %d
\n
"
,
This
->
baseTexture
.
levels
-
1
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAX_LEVEL
,
This
->
baseTexture
.
levels
-
1
);
checkGLcall
(
"glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)"
);
}
}
else
{
/* this only happened if we've run out of openGL textures */
}
else
{
/* this only happened if we've run out of openGL textures */
WARN
(
"This texture doesn't have an openGL texture assigned to it
\n
"
);
WARN
(
"This texture doesn't have an openGL texture assigned to it
\n
"
);
hr
=
D3DERR_INVALIDCALL
;
hr
=
D3DERR_INVALIDCALL
;
}
}
if
(
hr
==
D3D_OK
)
{
/* Always need to reset the number of mipmap levels when rebinding as it is
a property of the active texture unit, and another texture may have set it
to a different value */
TRACE
(
"Setting GL_TEXTURE_MAX_LEVEL to %d
\n
"
,
This
->
baseTexture
.
levels
-
1
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAX_LEVEL
,
This
->
baseTexture
.
levels
-
1
);
checkGLcall
(
"glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)"
);
}
LEAVE_GL
();
LEAVE_GL
();
return
hr
;
return
hr
;
}
}
...
...
dlls/wined3d/drawprim.c
View file @
18f3fcb1
...
@@ -1742,10 +1742,8 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -1742,10 +1742,8 @@ void drawPrimitive(IWineD3DDevice *iface,
if
(
This
->
stateBlock
->
textures
[
i
]
!=
NULL
)
{
if
(
This
->
stateBlock
->
textures
[
i
]
!=
NULL
)
{
if
(
IWineD3DBaseTexture_GetDirty
(
This
->
stateBlock
->
textures
[
i
]))
{
/* Load up the texture now */
/* Load up the texture now */
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
This
->
stateBlock
->
textures
[
i
]);
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
This
->
stateBlock
->
textures
[
i
]);
}
if
(
IWineD3DResourceImpl_GetType
((
IWineD3DResource
*
)
This
->
stateBlock
->
textures
[
i
])
==
D3DRTYPE_TEXTURE
)
{
if
(
IWineD3DResourceImpl_GetType
((
IWineD3DResource
*
)
This
->
stateBlock
->
textures
[
i
])
==
D3DRTYPE_TEXTURE
)
{
/* TODO: Is this right, as its cast all texture types to texture8... checkme */
/* TODO: Is this right, as its cast all texture types to texture8... checkme */
IWineD3DSurface
*
surface
;
IWineD3DSurface
*
surface
;
...
...
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