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
c0417812
Commit
c0417812
authored
Apr 29, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the sRGB read format capability in the format table.
parent
16394054
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
39 deletions
+15
-39
directx.c
dlls/wined3d/directx.c
+2
-29
utils.c
dlls/wined3d/utils.c
+12
-10
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/directx.c
View file @
c0417812
...
@@ -3298,35 +3298,8 @@ static BOOL CheckRenderTargetCapability(struct wined3d_adapter *adapter,
...
@@ -3298,35 +3298,8 @@ static BOOL CheckRenderTargetCapability(struct wined3d_adapter *adapter,
static
BOOL
CheckSrgbReadCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format_desc
*
format_desc
)
static
BOOL
CheckSrgbReadCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format_desc
*
format_desc
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
&
adapter
->
gl_info
;
return
adapter
->
gl_info
.
supported
[
EXT_TEXTURE_SRGB
]
&&
(
format_desc
->
Flags
&
WINED3DFMT_FLAG_SRGB_READ
);
/* Check for supported sRGB formats (Texture loading and framebuffer) */
if
(
!
gl_info
->
supported
[
EXT_TEXTURE_SRGB
])
{
TRACE_
(
d3d_caps
)(
"[FAILED] GL_EXT_texture_sRGB not supported
\n
"
);
return
FALSE
;
}
switch
(
format_desc
->
format
)
{
case
WINED3DFMT_B8G8R8A8_UNORM
:
case
WINED3DFMT_B8G8R8X8_UNORM
:
case
WINED3DFMT_B4G4R4A4_UNORM
:
case
WINED3DFMT_L8_UNORM
:
case
WINED3DFMT_L8A8_UNORM
:
case
WINED3DFMT_DXT1
:
case
WINED3DFMT_DXT2
:
case
WINED3DFMT_DXT3
:
case
WINED3DFMT_DXT4
:
case
WINED3DFMT_DXT5
:
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
default:
TRACE_
(
d3d_caps
)(
"[FAILED] Gamma texture format %s not supported.
\n
"
,
debug_d3dformat
(
format_desc
->
format
));
return
FALSE
;
}
return
FALSE
;
}
}
static
BOOL
CheckSrgbWriteCapability
(
struct
wined3d_adapter
*
adapter
,
static
BOOL
CheckSrgbWriteCapability
(
struct
wined3d_adapter
*
adapter
,
...
...
dlls/wined3d/utils.c
View file @
c0417812
...
@@ -582,23 +582,23 @@ static const struct wined3d_format_texture_info format_texture_info[] =
...
@@ -582,23 +582,23 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_DXT1
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
,
0
,
{
WINED3DFMT_DXT1
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
{
WINED3DFMT_DXT2
,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
,
0
,
{
WINED3DFMT_DXT2
,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
{
WINED3DFMT_DXT3
,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
,
0
,
{
WINED3DFMT_DXT3
,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
{
WINED3DFMT_DXT4
,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
,
0
,
{
WINED3DFMT_DXT4
,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
{
WINED3DFMT_DXT5
,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
,
0
,
{
WINED3DFMT_DXT5
,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
EXT_TEXTURE_COMPRESSION_S3TC
,
NULL
},
/* IEEE formats */
/* IEEE formats */
{
WINED3DFMT_R32_FLOAT
,
GL_RGB32F_ARB
,
GL_RGB32F_ARB
,
0
,
{
WINED3DFMT_R32_FLOAT
,
GL_RGB32F_ARB
,
GL_RGB32F_ARB
,
0
,
...
@@ -658,11 +658,13 @@ static const struct wined3d_format_texture_info format_texture_info[] =
...
@@ -658,11 +658,13 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_B8G8R8A8_UNORM
,
GL_RGBA8
,
GL_SRGB8_ALPHA8_EXT
,
0
,
{
WINED3DFMT_B8G8R8A8_UNORM
,
GL_RGBA8
,
GL_SRGB8_ALPHA8_EXT
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_8_8_8_8_REV
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_8_8_8_8_REV
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_RENDERTARGET
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_RENDERTARGET
|
WINED3DFMT_FLAG_SRGB_READ
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_B8G8R8X8_UNORM
,
GL_RGB8
,
GL_SRGB8_EXT
,
0
,
{
WINED3DFMT_B8G8R8X8_UNORM
,
GL_RGB8
,
GL_SRGB8_EXT
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_8_8_8_8_REV
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_8_8_8_8_REV
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_RENDERTARGET
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_RENDERTARGET
|
WINED3DFMT_FLAG_SRGB_READ
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_B5G6R5_UNORM
,
GL_RGB5
,
GL_RGB5
,
GL_RGB8
,
{
WINED3DFMT_B5G6R5_UNORM
,
GL_RGB5
,
GL_RGB5
,
GL_RGB8
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
0
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
0
,
...
@@ -678,7 +680,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
...
@@ -678,7 +680,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_B4G4R4A4_UNORM
,
GL_RGBA4
,
GL_SRGB8_ALPHA8_EXT
,
0
,
{
WINED3DFMT_B4G4R4A4_UNORM
,
GL_RGBA4
,
GL_SRGB8_ALPHA8_EXT
,
0
,
GL_BGRA
,
GL_UNSIGNED_SHORT_4_4_4_4_REV
,
0
,
GL_BGRA
,
GL_UNSIGNED_SHORT_4_4_4_4_REV
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_B2G3R3_UNORM
,
GL_R3_G3_B2
,
GL_R3_G3_B2
,
0
,
{
WINED3DFMT_B2G3R3_UNORM
,
GL_R3_G3_B2
,
GL_R3_G3_B2
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE_3_3_2
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE_3_3_2
,
0
,
...
@@ -719,11 +721,11 @@ static const struct wined3d_format_texture_info format_texture_info[] =
...
@@ -719,11 +721,11 @@ static const struct wined3d_format_texture_info format_texture_info[] =
/* Luminance */
/* Luminance */
{
WINED3DFMT_L8_UNORM
,
GL_LUMINANCE8
,
GL_SLUMINANCE8_EXT
,
0
,
{
WINED3DFMT_L8_UNORM
,
GL_LUMINANCE8
,
GL_SLUMINANCE8_EXT
,
0
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
0
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_L8A8_UNORM
,
GL_LUMINANCE8_ALPHA8
,
GL_SLUMINANCE8_ALPHA8_EXT
,
0
,
{
WINED3DFMT_L8A8_UNORM
,
GL_LUMINANCE8_ALPHA8
,
GL_SLUMINANCE8_ALPHA8_EXT
,
0
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
0
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_SRGB_READ
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_L4A4_UNORM
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE4_ALPHA4
,
0
,
{
WINED3DFMT_L4A4_UNORM
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE4_ALPHA4
,
0
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
2
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
2
,
...
...
dlls/wined3d/wined3d_private.h
View file @
c0417812
...
@@ -2989,6 +2989,7 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN;
...
@@ -2989,6 +2989,7 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN;
#define WINED3DFMT_FLAG_GETDC 0x00000100
#define WINED3DFMT_FLAG_GETDC 0x00000100
#define WINED3DFMT_FLAG_FLOAT 0x00000200
#define WINED3DFMT_FLAG_FLOAT 0x00000200
#define WINED3DFMT_FLAG_BUMPMAP 0x00000400
#define WINED3DFMT_FLAG_BUMPMAP 0x00000400
#define WINED3DFMT_FLAG_SRGB_READ 0x00000800
struct
wined3d_format_desc
struct
wined3d_format_desc
{
{
...
...
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