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
7874a6b7
Commit
7874a6b7
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 checking a format's FBO compatibility.
parent
1407bd6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
utils.c
dlls/wined3d/utils.c
+31
-27
No files found.
dlls/wined3d/utils.c
View file @
7874a6b7
...
...
@@ -404,12 +404,36 @@ static BOOL init_format_base_info(WineD3D_GL_Info *gl_info)
return
TRUE
;
}
#define GLINFO_LOCATION (*gl_info)
static
BOOL
check_fbo_compat
(
const
WineD3D_GL_Info
*
gl_info
,
GLint
internal_format
)
{
GLuint
tex
,
fb
;
GLenum
status
;
while
(
glGetError
());
glGenTextures
(
1
,
&
tex
);
glBindTexture
(
GL_TEXTURE_2D
,
tex
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
internal_format
,
16
,
16
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
NULL
);
GL_EXTCALL
(
glGenFramebuffersEXT
(
1
,
&
fb
));
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
fb
));
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
GL_TEXTURE_2D
,
tex
,
0
));
status
=
GL_EXTCALL
(
glCheckFramebufferStatusEXT
(
GL_FRAMEBUFFER_EXT
));
GL_EXTCALL
(
glDeleteFramebuffersEXT
(
1
,
&
fb
));
glDeleteTextures
(
1
,
&
tex
);
checkGLcall
(
"Framebuffer format check"
);
return
status
==
GL_FRAMEBUFFER_COMPLETE_EXT
;
}
BOOL
initPixelFormatsNoGL
(
WineD3D_GL_Info
*
gl_info
)
{
return
init_format_base_info
(
gl_info
);
}
#define GLINFO_LOCATION (*gl_info)
BOOL
initPixelFormats
(
WineD3D_GL_Info
*
gl_info
)
{
unsigned
int
src
;
...
...
@@ -433,42 +457,22 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
desc
->
Flags
|=
gl_formats_template
[
src
].
Flags
;
desc
->
heightscale
=
1
.
0
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
gl_formats_template
[
src
].
rtInternal
!=
0
)
{
GLuint
tex
,
fb
;
GLenum
status
;
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
*/
while
(
glGetError
());
glGenTextures
(
1
,
&
tex
);
glBindTexture
(
GL_TEXTURE_2D
,
tex
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
gl_formats_template
[
src
].
glInternal
,
16
,
16
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
NULL
);
GL_EXTCALL
(
glGenFramebuffersEXT
(
1
,
&
fb
));
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
fb
));
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
GL_TEXTURE_2D
,
tex
,
0
));
status
=
GL_EXTCALL
(
glCheckFramebufferStatusEXT
(
GL_FRAMEBUFFER_EXT
));
GL_EXTCALL
(
glDeleteFramebuffersEXT
(
1
,
&
fb
));
glDeleteTextures
(
1
,
&
tex
);
checkGLcall
(
"Framebuffer format check"
);
if
(
status
!=
GL_FRAMEBUFFER_COMPLETE_EXT
)
{
TRACE
(
"Internal format of %s not supported as frame buffer target, using render target internal instead
\n
"
,
debug_d3dformat
(
gl_formats_template
[
src
].
fmt
));
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
;
}
...
...
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