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
9a86a0b0
Commit
9a86a0b0
authored
Sep 29, 2005
by
H. Verbeet
Committed by
Alexandre Julliard
Sep 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DXT2 & DXT4 support for d3d8.
parent
ed8379d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
surface.c
dlls/d3d8/surface.c
+7
-3
utils.c
dlls/d3d8/utils.c
+8
-0
No files found.
dlls/d3d8/surface.c
View file @
9a86a0b0
...
...
@@ -167,11 +167,12 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
}
/* DXTn formats don't have exact pitches as they are to the new row of blocks,
where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt
3
/5)
where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt
2/3/4
/5)
ie pitch = (width/4) * bytes per block */
if
(
This
->
myDesc
.
Format
==
D3DFMT_DXT1
)
/* DXT1 is 8 bytes per block */
pLockedRect
->
Pitch
=
(
This
->
myDesc
.
Width
/
4
)
*
8
;
else
if
(
This
->
myDesc
.
Format
==
D3DFMT_DXT3
||
This
->
myDesc
.
Format
==
D3DFMT_DXT5
)
/* DXT3/5 is 16 bytes per block */
else
if
(
This
->
myDesc
.
Format
==
D3DFMT_DXT2
||
This
->
myDesc
.
Format
==
D3DFMT_DXT3
||
This
->
myDesc
.
Format
==
D3DFMT_DXT4
||
This
->
myDesc
.
Format
==
D3DFMT_DXT5
)
/* DXT2/3/4/5 is 16 bytes per block */
pLockedRect
->
Pitch
=
(
This
->
myDesc
.
Width
/
4
)
*
16
;
else
pLockedRect
->
Pitch
=
This
->
bytesPerPixel
*
This
->
myDesc
.
Width
;
/* Bytes / row */
...
...
@@ -495,7 +496,8 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, UINT
if
(
gl_level
!=
0
)
FIXME
(
"Surface in texture is only supported for level 0
\n
"
);
else
if
(
This
->
myDesc
.
Format
==
D3DFMT_P8
||
This
->
myDesc
.
Format
==
D3DFMT_A8P8
||
This
->
myDesc
.
Format
==
D3DFMT_DXT1
||
This
->
myDesc
.
Format
==
D3DFMT_DXT3
||
This
->
myDesc
.
Format
==
D3DFMT_DXT1
||
This
->
myDesc
.
Format
==
D3DFMT_DXT2
||
This
->
myDesc
.
Format
==
D3DFMT_DXT3
||
This
->
myDesc
.
Format
==
D3DFMT_DXT4
||
This
->
myDesc
.
Format
==
D3DFMT_DXT5
)
FIXME
(
"Format %d not supported
\n
"
,
This
->
myDesc
.
Format
);
else
{
...
...
@@ -568,7 +570,9 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, UINT
}
if
(
This
->
myDesc
.
Format
==
D3DFMT_DXT1
||
This
->
myDesc
.
Format
==
D3DFMT_DXT2
||
This
->
myDesc
.
Format
==
D3DFMT_DXT3
||
This
->
myDesc
.
Format
==
D3DFMT_DXT4
||
This
->
myDesc
.
Format
==
D3DFMT_DXT5
)
{
if
(
GL_SUPPORT_DEV
(
EXT_TEXTURE_COMPRESSION_S3TC
,
This
->
Device
))
{
TRACE
(
"Calling glCompressedTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, sz=%d, Mem=%p
\n
"
,
...
...
dlls/d3d8/utils.c
View file @
9a86a0b0
...
...
@@ -406,7 +406,9 @@ SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
case
D3DFMT_X8L8V8U8
:
retVal
=
4
;
break
;
/* Compressed */
case
D3DFMT_DXT1
:
retVal
=
1
;
break
;
/* Actually 8 bytes per 16 pixels - Special cased later */
case
D3DFMT_DXT2
:
retVal
=
1
;
break
;
/* Actually 16 bytes per 16 pixels */
case
D3DFMT_DXT3
:
retVal
=
1
;
break
;
/* Actually 16 bytes per 16 pixels */
case
D3DFMT_DXT4
:
retVal
=
1
;
break
;
/* Actually 16 bytes per 16 pixels */
case
D3DFMT_DXT5
:
retVal
=
1
;
break
;
/* Actually 16 bytes per 16 pixels */
/* to see */
case
D3DFMT_A8
:
retVal
=
1
;
break
;
...
...
@@ -431,7 +433,9 @@ GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_S3TC
))
{
switch
(
fmt
)
{
case
D3DFMT_DXT1
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
;
break
;
case
D3DFMT_DXT2
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
break
;
case
D3DFMT_DXT3
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
break
;
case
D3DFMT_DXT4
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
break
;
case
D3DFMT_DXT5
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
break
;
default:
/* stupid compiler */
...
...
@@ -480,7 +484,9 @@ GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_S3TC
))
{
switch
(
fmt
)
{
case
D3DFMT_DXT1
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
;
break
;
case
D3DFMT_DXT2
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
break
;
case
D3DFMT_DXT3
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
break
;
case
D3DFMT_DXT4
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
break
;
case
D3DFMT_DXT5
:
retVal
=
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
break
;
default:
/* stupid compiler */
...
...
@@ -530,7 +536,9 @@ GLenum D3DFmt2GLType(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_S3TC
))
{
switch
(
fmt
)
{
case
D3DFMT_DXT1
:
retVal
=
0
;
break
;
case
D3DFMT_DXT2
:
retVal
=
0
;
break
;
case
D3DFMT_DXT3
:
retVal
=
0
;
break
;
case
D3DFMT_DXT4
:
retVal
=
0
;
break
;
case
D3DFMT_DXT5
:
retVal
=
0
;
break
;
default:
/* stupid compiler */
...
...
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