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
837f1636
Commit
837f1636
authored
Mar 27, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Create a separate function for setting a format's GL texture info.
parent
b8f25ef6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
41 deletions
+44
-41
utils.c
dlls/wined3d/utils.c
+44
-41
No files found.
dlls/wined3d/utils.c
View file @
837f1636
...
...
@@ -429,6 +429,49 @@ static BOOL check_fbo_compat(const WineD3D_GL_Info *gl_info, GLint internal_form
return
status
==
GL_FRAMEBUFFER_COMPLETE_EXT
;
}
static
void
init_format_texture_info
(
WineD3D_GL_Info
*
gl_info
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
gl_formats_template
)
/
sizeof
(
gl_formats_template
[
0
]);
++
i
)
{
int
fmt_idx
=
getFmtIdx
(
gl_formats_template
[
i
].
fmt
);
struct
GlPixelFormatDesc
*
desc
;
desc
=
&
gl_info
->
gl_formats
[
fmt_idx
];
desc
->
glInternal
=
gl_formats_template
[
i
].
glInternal
;
desc
->
glGammaInternal
=
gl_formats_template
[
i
].
glGammaInternal
;
desc
->
glFormat
=
gl_formats_template
[
i
].
glFormat
;
desc
->
glType
=
gl_formats_template
[
i
].
glType
;
desc
->
color_fixup
=
COLOR_FIXUP_IDENTITY
;
desc
->
Flags
|=
gl_formats_template
[
i
].
Flags
;
desc
->
heightscale
=
1
.
0
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
gl_formats_template
[
i
].
rtInternal
)
{
/* Check if the default internal format is supported as a frame buffer target, otherwise
* fall back to the render target internal.
*
* Try to stick to the standard format if possible, this limits precision differences */
if
(
!
check_fbo_compat
(
gl_info
,
gl_formats_template
[
i
].
glInternal
))
{
TRACE
(
"Internal format of %s not supported as FBO target, using render target internal instead
\n
"
,
debug_d3dformat
(
gl_formats_template
[
i
].
fmt
));
desc
->
rtInternal
=
gl_formats_template
[
i
].
rtInternal
;
}
else
{
TRACE
(
"Format %s is supported as fbo target
\n
"
,
debug_d3dformat
(
gl_formats_template
[
i
].
fmt
));
desc
->
rtInternal
=
gl_formats_template
[
i
].
glInternal
;
}
}
else
{
desc
->
rtInternal
=
gl_formats_template
[
i
].
glInternal
;
}
}
}
static
void
apply_format_fixups
(
WineD3D_GL_Info
*
gl_info
)
{
int
idx
;
...
...
@@ -563,49 +606,9 @@ BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info)
BOOL
initPixelFormats
(
WineD3D_GL_Info
*
gl_info
)
{
unsigned
int
src
;
if
(
!
init_format_base_info
(
gl_info
))
return
FALSE
;
/* If a format depends on some extensions, remove them from the table above and initialize them
* after this loop */
for
(
src
=
0
;
src
<
sizeof
(
gl_formats_template
)
/
sizeof
(
gl_formats_template
[
0
]);
++
src
)
{
struct
GlPixelFormatDesc
*
desc
;
int
dst
=
getFmtIdx
(
gl_formats_template
[
src
].
fmt
);
desc
=
&
gl_info
->
gl_formats
[
dst
];
desc
->
glInternal
=
gl_formats_template
[
src
].
glInternal
;
desc
->
glGammaInternal
=
gl_formats_template
[
src
].
glGammaInternal
;
desc
->
glFormat
=
gl_formats_template
[
src
].
glFormat
;
desc
->
glType
=
gl_formats_template
[
src
].
glType
;
desc
->
color_fixup
=
COLOR_FIXUP_IDENTITY
;
desc
->
Flags
|=
gl_formats_template
[
src
].
Flags
;
desc
->
heightscale
=
1
.
0
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
gl_formats_template
[
src
].
rtInternal
)
{
/* Check if the default internal format is supported as a frame buffer target, otherwise
* fall back to the render target internal.
*
* Try to stick to the standard format if possible, this limits precision differences */
if
(
!
check_fbo_compat
(
gl_info
,
gl_formats_template
[
src
].
glInternal
))
{
TRACE
(
"Internal format of %s not supported as FBO target, using render target internal instead
\n
"
,
debug_d3dformat
(
gl_formats_template
[
src
].
fmt
));
gl_info
->
gl_formats
[
dst
].
rtInternal
=
gl_formats_template
[
src
].
rtInternal
;
}
else
{
TRACE
(
"Format %s is supported as fbo target
\n
"
,
debug_d3dformat
(
gl_formats_template
[
src
].
fmt
));
gl_info
->
gl_formats
[
dst
].
rtInternal
=
gl_formats_template
[
src
].
glInternal
;
}
}
else
{
gl_info
->
gl_formats
[
dst
].
rtInternal
=
gl_formats_template
[
src
].
glInternal
;
}
}
init_format_texture_info
(
gl_info
);
apply_format_fixups
(
gl_info
);
...
...
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