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
31f8cd96
Commit
31f8cd96
authored
Mar 26, 2009
by
Tobias Jakobi
Committed by
Alexandre Julliard
Mar 31, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add pow2Matrix_identity flag to BaseTextureClass struct.
New flag helps to quickly find out whether the pow2Matrix is a identity matrix (no texcoord fixup needed) or not.
parent
c5bdfdfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
basetexture.c
dlls/wined3d/basetexture.c
+1
-0
device.c
dlls/wined3d/device.c
+15
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/basetexture.c
View file @
31f8cd96
...
...
@@ -35,6 +35,7 @@ void basetexture_init(struct IWineD3DBaseTextureClass *texture, UINT levels, DWO
texture
->
dirty
=
TRUE
;
texture
->
srgbDirty
=
TRUE
;
texture
->
is_srgb
=
FALSE
;
texture
->
pow2Matrix_identity
=
TRUE
;
}
void
basetexture_cleanup
(
IWineD3DBaseTexture
*
iface
)
...
...
dlls/wined3d/device.c
View file @
31f8cd96
...
...
@@ -1233,6 +1233,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
(
Width
!=
pow2Width
||
Height
!=
pow2Height
)
&&
!
((
Format
==
WINED3DFMT_P8
)
&&
GL_SUPPORT
(
EXT_PALETTED_TEXTURE
)
&&
(
wined3d_settings
.
rendertargetlock_mode
==
RTL_READTEX
||
wined3d_settings
.
rendertargetlock_mode
==
RTL_TEXTEX
)))
{
if
((
Width
!=
1
)
||
(
Height
!=
1
))
{
object
->
baseTexture
.
pow2Matrix_identity
=
FALSE
;
}
object
->
baseTexture
.
pow2Matrix
[
0
]
=
(
float
)
Width
;
object
->
baseTexture
.
pow2Matrix
[
5
]
=
(
float
)
Height
;
object
->
baseTexture
.
pow2Matrix
[
10
]
=
1
.
0
;
...
...
@@ -1241,8 +1245,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
object
->
cond_np2
=
TRUE
;
object
->
baseTexture
.
minMipLookup
=
minMipLookup_noFilter
;
}
else
{
object
->
baseTexture
.
pow2Matrix
[
0
]
=
(((
float
)
Width
)
/
((
float
)
pow2Width
));
object
->
baseTexture
.
pow2Matrix
[
5
]
=
(((
float
)
Height
)
/
((
float
)
pow2Height
));
if
((
Width
!=
pow2Width
)
||
(
Height
!=
pow2Height
))
{
object
->
baseTexture
.
pow2Matrix_identity
=
FALSE
;
object
->
baseTexture
.
pow2Matrix
[
0
]
=
(((
float
)
Width
)
/
((
float
)
pow2Width
));
object
->
baseTexture
.
pow2Matrix
[
5
]
=
(((
float
)
Height
)
/
((
float
)
pow2Height
));
}
else
{
object
->
baseTexture
.
pow2Matrix
[
0
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
5
]
=
1
.
0
;
}
object
->
baseTexture
.
pow2Matrix
[
10
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
object
->
target
=
GL_TEXTURE_2D
;
...
...
@@ -1540,7 +1551,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
pow2EdgeLength
=
1
;
while
(
pow2EdgeLength
<
EdgeLength
)
pow2EdgeLength
<<=
1
;
if
(
GL_SUPPORT
(
ARB_TEXTURE_NON_POWER_OF_TWO
))
{
if
(
GL_SUPPORT
(
ARB_TEXTURE_NON_POWER_OF_TWO
)
||
(
EdgeLength
==
pow2EdgeLength
)
)
{
/* Precalculated scaling for 'faked' non power of two texture coords */
object
->
baseTexture
.
pow2Matrix
[
0
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
5
]
=
1
.
0
;
...
...
@@ -1552,6 +1563,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
object
->
baseTexture
.
pow2Matrix
[
5
]
=
((
float
)
EdgeLength
)
/
((
float
)
pow2EdgeLength
);
object
->
baseTexture
.
pow2Matrix
[
10
]
=
((
float
)
EdgeLength
)
/
((
float
)
pow2EdgeLength
);
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix_identity
=
FALSE
;
}
if
(
object
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
...
...
dlls/wined3d/wined3d_private.h
View file @
31f8cd96
...
...
@@ -1384,6 +1384,7 @@ typedef struct IWineD3DBaseTextureClass
LONG
bindCount
;
DWORD
sampler
;
BOOL
is_srgb
;
BOOL
pow2Matrix_identity
;
const
struct
min_lookup
*
minMipLookup
;
const
GLenum
*
magLookup
;
void
(
*
internal_preload
)(
IWineD3DBaseTexture
*
iface
,
enum
WINED3DSRGB
srgb
);
...
...
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