Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
18f3fcb1
Commit
18f3fcb1
authored
19 years ago
by
Oliver Stieber
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Set mipmap levels correctly (even with ATI's buggy drivers).
parent
e0241349
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/wined3d/basetexture.c
+20
-8
20 additions, 8 deletions
dlls/wined3d/basetexture.c
dlls/wined3d/drawprim.c
+2
-4
2 additions, 4 deletions
dlls/wined3d/drawprim.c
with
22 additions
and
12 deletions
dlls/wined3d/basetexture.c
+
20
−
8
View file @
18f3fcb1
...
...
@@ -205,6 +205,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
IWineD3DBaseTextureImpl
*
This
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
HRESULT
hr
=
D3D_OK
;
UINT
textureDimensions
;
BOOL
isNewTexture
=
FALSE
;
TRACE
(
"(%p) : About to bind texture
\n
"
,
This
);
textureDimensions
=
IWineD3DBaseTexture_GetTextureDimensions
(
iface
);
...
...
@@ -227,25 +228,36 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
glPrioritizeTextures
(
1
,
&
This
->
baseTexture
.
textureName
,
&
tmp
);
}
IWineD3DBaseTexture_SetDirty
(
iface
,
TRUE
);
isNewTexture
=
TRUE
;
}
/* Bind the texture */
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
);
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 */
WARN
(
"This texture doesn't have an openGL texture assigned to it
\n
"
);
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
();
return
hr
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/wined3d/drawprim.c
+
2
−
4
View file @
18f3fcb1
...
...
@@ -1742,10 +1742,8 @@ void drawPrimitive(IWineD3DDevice *iface,
if
(
This
->
stateBlock
->
textures
[
i
]
!=
NULL
)
{
if
(
IWineD3DBaseTexture_GetDirty
(
This
->
stateBlock
->
textures
[
i
]))
{
/* Load up the texture now */
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
This
->
stateBlock
->
textures
[
i
]);
}
/* Load up the texture now */
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
This
->
stateBlock
->
textures
[
i
]);
if
(
IWineD3DResourceImpl_GetType
((
IWineD3DResource
*
)
This
->
stateBlock
->
textures
[
i
])
==
D3DRTYPE_TEXTURE
)
{
/* TODO: Is this right, as its cast all texture types to texture8... checkme */
IWineD3DSurface
*
surface
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment