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
b35045ba
Commit
b35045ba
authored
May 27, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
May 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't create FBOs in context_bind_fbo().
We can just do this in context_create_fbo_entry() now.
parent
7ca6839c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
40 deletions
+26
-40
context.c
dlls/wined3d/context.c
+26
-40
No files found.
dlls/wined3d/context.c
View file @
b35045ba
...
@@ -38,43 +38,27 @@ static DWORD wined3d_context_tls_idx;
...
@@ -38,43 +38,27 @@ static DWORD wined3d_context_tls_idx;
/* FBO helper functions */
/* FBO helper functions */
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
static
void
context_bind_fbo
(
struct
wined3d_context
*
context
,
GLenum
target
,
GLuint
*
fbo
)
static
void
context_bind_fbo
(
struct
wined3d_context
*
context
,
GLenum
target
,
GLuint
fbo
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLuint
f
;
if
(
!
fbo
)
{
f
=
0
;
}
else
{
if
(
!*
fbo
)
{
gl_info
->
fbo_ops
.
glGenFramebuffers
(
1
,
fbo
);
checkGLcall
(
"glGenFramebuffers()"
);
TRACE
(
"Created FBO %u.
\n
"
,
*
fbo
);
}
f
=
*
fbo
;
}
switch
(
target
)
switch
(
target
)
{
{
case
GL_READ_FRAMEBUFFER
:
case
GL_READ_FRAMEBUFFER
:
if
(
context
->
fbo_read_binding
==
f
)
return
;
if
(
context
->
fbo_read_binding
==
f
bo
)
return
;
context
->
fbo_read_binding
=
f
;
context
->
fbo_read_binding
=
f
bo
;
break
;
break
;
case
GL_DRAW_FRAMEBUFFER
:
case
GL_DRAW_FRAMEBUFFER
:
if
(
context
->
fbo_draw_binding
==
f
)
return
;
if
(
context
->
fbo_draw_binding
==
f
bo
)
return
;
context
->
fbo_draw_binding
=
f
;
context
->
fbo_draw_binding
=
f
bo
;
break
;
break
;
case
GL_FRAMEBUFFER
:
case
GL_FRAMEBUFFER
:
if
(
context
->
fbo_read_binding
==
f
if
(
context
->
fbo_read_binding
==
f
bo
&&
context
->
fbo_draw_binding
==
f
)
return
;
&&
context
->
fbo_draw_binding
==
f
bo
)
return
;
context
->
fbo_read_binding
=
f
;
context
->
fbo_read_binding
=
f
bo
;
context
->
fbo_draw_binding
=
f
;
context
->
fbo_draw_binding
=
f
bo
;
break
;
break
;
default:
default:
...
@@ -82,7 +66,7 @@ static void context_bind_fbo(struct wined3d_context *context, GLenum target, GLu
...
@@ -82,7 +66,7 @@ static void context_bind_fbo(struct wined3d_context *context, GLenum target, GLu
break
;
break
;
}
}
gl_info
->
fbo_ops
.
glBindFramebuffer
(
target
,
f
);
gl_info
->
fbo_ops
.
glBindFramebuffer
(
target
,
f
bo
);
checkGLcall
(
"glBindFramebuffer()"
);
checkGLcall
(
"glBindFramebuffer()"
);
}
}
...
@@ -104,15 +88,15 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info,
...
@@ -104,15 +88,15 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info,
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
static
void
context_destroy_fbo
(
struct
wined3d_context
*
context
,
GLuint
*
fbo
)
static
void
context_destroy_fbo
(
struct
wined3d_context
*
context
,
GLuint
fbo
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
fbo
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
fbo
);
context_clean_fbo_attachments
(
gl_info
,
GL_FRAMEBUFFER
);
context_clean_fbo_attachments
(
gl_info
,
GL_FRAMEBUFFER
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
NULL
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
0
);
gl_info
->
fbo_ops
.
glDeleteFramebuffers
(
1
,
fbo
);
gl_info
->
fbo_ops
.
glDeleteFramebuffers
(
1
,
&
fbo
);
checkGLcall
(
"glDeleteFramebuffers()"
);
checkGLcall
(
"glDeleteFramebuffers()"
);
}
}
...
@@ -338,7 +322,9 @@ static struct fbo_entry *context_create_fbo_entry(const struct wined3d_context *
...
@@ -338,7 +322,9 @@ static struct fbo_entry *context_create_fbo_entry(const struct wined3d_context *
entry
->
location
=
location
;
entry
->
location
=
location
;
entry
->
rt_mask
=
context_generate_rt_mask
(
GL_COLOR_ATTACHMENT0
);
entry
->
rt_mask
=
context_generate_rt_mask
(
GL_COLOR_ATTACHMENT0
);
entry
->
attached
=
FALSE
;
entry
->
attached
=
FALSE
;
entry
->
id
=
0
;
gl_info
->
fbo_ops
.
glGenFramebuffers
(
1
,
&
entry
->
id
);
checkGLcall
(
"glGenFramebuffers()"
);
TRACE
(
"Created FBO %u.
\n
"
,
entry
->
id
);
return
entry
;
return
entry
;
}
}
...
@@ -350,7 +336,7 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum targ
...
@@ -350,7 +336,7 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum targ
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
context_bind_fbo
(
context
,
target
,
&
entry
->
id
);
context_bind_fbo
(
context
,
target
,
entry
->
id
);
context_clean_fbo_attachments
(
gl_info
,
target
);
context_clean_fbo_attachments
(
gl_info
,
target
);
memcpy
(
entry
->
render_targets
,
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
memcpy
(
entry
->
render_targets
,
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
...
@@ -364,8 +350,8 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
...
@@ -364,8 +350,8 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
{
{
if
(
entry
->
id
)
if
(
entry
->
id
)
{
{
TRACE
(
"Destroy FBO %
d
\n
"
,
entry
->
id
);
TRACE
(
"Destroy FBO %
u.
\n
"
,
entry
->
id
);
context_destroy_fbo
(
context
,
&
entry
->
id
);
context_destroy_fbo
(
context
,
entry
->
id
);
}
}
--
context
->
fbo_entry_count
;
--
context
->
fbo_entry_count
;
list_remove
(
&
entry
->
entry
);
list_remove
(
&
entry
->
entry
);
...
@@ -428,13 +414,13 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
...
@@ -428,13 +414,13 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
if
(
entry
->
attached
)
if
(
entry
->
attached
)
{
{
context_bind_fbo
(
context
,
target
,
&
entry
->
id
);
context_bind_fbo
(
context
,
target
,
entry
->
id
);
return
;
return
;
}
}
read_binding
=
context
->
fbo_read_binding
;
read_binding
=
context
->
fbo_read_binding
;
draw_binding
=
context
->
fbo_draw_binding
;
draw_binding
=
context
->
fbo_draw_binding
;
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
&
entry
->
id
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
entry
->
id
);
/* Apply render targets */
/* Apply render targets */
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
...
@@ -454,9 +440,9 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
...
@@ -454,9 +440,9 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
if
(
target
!=
GL_FRAMEBUFFER
)
if
(
target
!=
GL_FRAMEBUFFER
)
{
{
if
(
target
==
GL_READ_FRAMEBUFFER
)
if
(
target
==
GL_READ_FRAMEBUFFER
)
context_bind_fbo
(
context
,
GL_DRAW_FRAMEBUFFER
,
draw_binding
?
&
draw_binding
:
NULL
);
context_bind_fbo
(
context
,
GL_DRAW_FRAMEBUFFER
,
draw_binding
);
else
else
context_bind_fbo
(
context
,
GL_READ_FRAMEBUFFER
,
read_binding
?
&
read_binding
:
NULL
);
context_bind_fbo
(
context
,
GL_READ_FRAMEBUFFER
,
read_binding
);
}
}
entry
->
attached
=
TRUE
;
entry
->
attached
=
TRUE
;
...
@@ -475,14 +461,14 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
...
@@ -475,14 +461,14 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
if
(
context
->
rebind_fbo
)
if
(
context
->
rebind_fbo
)
{
{
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
NULL
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
0
);
context
->
rebind_fbo
=
FALSE
;
context
->
rebind_fbo
=
FALSE
;
}
}
if
(
location
==
SFLAG_INDRAWABLE
)
if
(
location
==
SFLAG_INDRAWABLE
)
{
{
context
->
current_fbo
=
NULL
;
context
->
current_fbo
=
NULL
;
context_bind_fbo
(
context
,
target
,
NULL
);
context_bind_fbo
(
context
,
target
,
0
);
}
}
else
else
{
{
...
@@ -2150,7 +2136,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
...
@@ -2150,7 +2136,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
else
else
{
{
context
->
current_fbo
=
NULL
;
context
->
current_fbo
=
NULL
;
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
NULL
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
0
);
rt_mask
=
context_generate_rt_mask_from_surface
(
rt
);
rt_mask
=
context_generate_rt_mask_from_surface
(
rt
);
}
}
}
}
...
...
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