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
726d9d47
Commit
726d9d47
authored
Jul 23, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: ATI2N support using GL_EXT_texture_compression_rgtc.
parent
dc25a86c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
3 deletions
+40
-3
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+8
-1
directx.c
dlls/wined3d/directx.c
+2
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+15
-0
utils.c
dlls/wined3d/utils.c
+6
-1
wined3d_gl.h
include/wine/wined3d_gl.h
+9
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
726d9d47
...
...
@@ -820,9 +820,15 @@ static void shader_arb_color_correction(SHADER_OPCODE_ARG* arg) {
/* GL_ATI_texture_compression_3dc returns the two channels as luminance-alpha,
* which means the first one is replicated accross .rgb, and the 2nd one is in
* .a. We need the 2nd in .g
*
* GL_EXT_texture_compression_rgtc returns the values in .rg, however, they
* are swapped compared to d3d. So swap red and green.
*/
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_RGTC
))
{
shader_addline
(
arg
->
buffer
,
"SWZ %s, %s, %c, %c, 1, 0;
\n
"
,
reg
,
reg
,
writemask
[
2
],
writemask
[
1
]);
}
else
{
if
(
strlen
(
writemask
)
==
5
)
{
/* Swap y and z (U and L), and do a sign conversion on x and the new y(V and U) */
shader_addline
(
arg
->
buffer
,
"MOV %s.%c, %s.%c;
\n
"
,
reg
,
writemask
[
2
],
reg
,
writemask
[
4
]);
}
else
if
(
strlen
(
writemask
)
==
2
)
{
...
...
@@ -831,6 +837,7 @@ static void shader_arb_color_correction(SHADER_OPCODE_ARG* arg) {
/* This is bad: We have VL, but we need VU */
FIXME
(
"2 or 3 components sampled from a converted ATI2N texture
\n
"
);
}
}
break
;
/* stupid compiler */
...
...
dlls/wined3d/directx.c
View file @
726d9d47
...
...
@@ -105,6 +105,7 @@ static const struct {
{
"GL_EXT_stencil_wrap"
,
EXT_STENCIL_WRAP
,
0
},
{
"GL_EXT_texture3D"
,
EXT_TEXTURE3D
,
MAKEDWORD_VERSION
(
1
,
2
)
},
{
"GL_EXT_texture_compression_s3tc"
,
EXT_TEXTURE_COMPRESSION_S3TC
,
0
},
{
"GL_EXT_texture_compression_rgtc"
,
EXT_TEXTURE_COMPRESSION_RGTC
,
0
},
{
"GL_EXT_texture_env_add"
,
EXT_TEXTURE_ENV_ADD
,
0
},
{
"GL_EXT_texture_env_combine"
,
EXT_TEXTURE_ENV_COMBINE
,
0
},
{
"GL_EXT_texture_env_dot3"
,
EXT_TEXTURE_ENV_DOT3
,
0
},
...
...
@@ -2374,7 +2375,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
/* Vendor specific formats */
case
WINED3DFMT_ATI2N
:
if
(
GL_SUPPORT
(
ATI_TEXTURE_COMPRESSION_3DC
))
{
if
(
GL_SUPPORT
(
ATI_TEXTURE_COMPRESSION_3DC
)
||
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_RGTC
)
)
{
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
726d9d47
...
...
@@ -1348,9 +1348,23 @@ static void shader_glsl_color_correction(SHADER_OPCODE_ARG* arg) {
/* GL_ATI_texture_compression_3dc returns the two channels as luminance-alpha,
* which means the first one is replicated accross .rgb, and the 2nd one is in
* .a. We need the 2nd in .g
*
* GL_EXT_texture_compression_rgtc returns the values in .rg, however, they
* are swapped compared to d3d. So swap red and green.
*/
mask
=
shader_glsl_add_dst_param
(
arg
,
arg
->
dst
,
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
dst_param
);
mask_size
=
shader_glsl_get_write_mask_size
(
mask
);
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_RGTC
))
{
if
(
mask_size
>=
2
)
{
shader_addline
(
arg
->
buffer
,
"%s.%c%c = %s.%c%c;
\n
"
,
dst_param
.
reg_name
,
dst_param
.
mask_str
[
1
],
dst_param
.
mask_str
[
2
],
dst_param
.
reg_name
,
dst_param
.
mask_str
[
2
],
dst_param
.
mask_str
[
1
]);
}
else
{
FIXME
(
"%u components sampled from a converted ATI2N texture
\n
"
,
mask_size
);
}
}
else
{
if
(
mask_size
==
4
)
{
/* Swap y and z (U and L), and do a sign conversion on x and the new y(V and U) */
shader_addline
(
arg
->
buffer
,
"%s.%c = %s.%c;
\n
"
,
...
...
@@ -1362,6 +1376,7 @@ static void shader_glsl_color_correction(SHADER_OPCODE_ARG* arg) {
FIXME
(
"%u components sampled from a converted ATI2N texture
\n
"
,
mask_size
);
/* This is bad: We have .r[gb], but we need .ra */
}
}
break
;
/* stupid compiler */
...
...
dlls/wined3d/utils.c
View file @
726d9d47
...
...
@@ -395,7 +395,12 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
*/
}
if
(
GL_SUPPORT
(
ATI_TEXTURE_COMPRESSION_3DC
))
{
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_RGTC
))
{
dst
=
getFmtIdx
(
WINED3DFMT_ATI2N
);
gl_info
->
gl_formats
[
dst
].
glInternal
=
GL_COMPRESSED_RED_GREEN_RGTC2_EXT
;
gl_info
->
gl_formats
[
dst
].
glGammaInternal
=
GL_COMPRESSED_RED_GREEN_RGTC2_EXT
;
gl_info
->
gl_formats
[
dst
].
conversion_group
=
WINED3DFMT_ATI2N
;
}
else
if
(
GL_SUPPORT
(
ATI_TEXTURE_COMPRESSION_3DC
))
{
dst
=
getFmtIdx
(
WINED3DFMT_ATI2N
);
gl_info
->
gl_formats
[
dst
].
glInternal
=
GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI
;
gl_info
->
gl_formats
[
dst
].
glGammaInternal
=
GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI
;
...
...
include/wine/wined3d_gl.h
View file @
726d9d47
...
...
@@ -2996,6 +2996,14 @@ typedef void (WINE_GLAPI *PGLFNSETFRAGMENTSHADERCONSTANTATI) (GLuint dst, const
#define GL_ATI_texture_compression_3dc
#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
#endif
/* GL_EXT_texture_compression_rgtc */
#ifndef GL_EXT_texture_compression_rgtc
#define GL_EXT_texture_compression_rgtc
#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
#endif
/* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_0
...
...
@@ -3327,6 +3335,7 @@ typedef enum _GL_SupportedExt {
EXT_STENCIL_WRAP
,
EXT_TEXTURE3D
,
EXT_TEXTURE_COMPRESSION_S3TC
,
EXT_TEXTURE_COMPRESSION_RGTC
,
EXT_TEXTURE_FILTER_ANISOTROPIC
,
EXT_TEXTURE_LOD
,
EXT_TEXTURE_LOD_BIAS
,
...
...
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