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
237f3937
Commit
237f3937
authored
Jul 30, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move the draw buffer array to the context.
parent
3ad82a82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
context.c
dlls/wined3d/context.c
+13
-8
device.c
dlls/wined3d/device.c
+2
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/context.c
View file @
237f3937
...
...
@@ -1408,6 +1408,10 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
gl_info
->
limits
.
buffers
*
sizeof
(
*
ret
->
blit_targets
));
if
(
!
ret
->
blit_targets
)
goto
out
;
ret
->
draw_buffers
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
ret
->
draw_buffers
));
if
(
!
ret
->
draw_buffers
)
goto
out
;
ret
->
free_occlusion_query_size
=
4
;
ret
->
free_occlusion_queries
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ret
->
free_occlusion_query_size
*
sizeof
(
*
ret
->
free_occlusion_queries
));
...
...
@@ -1558,6 +1562,7 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
out:
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
free_event_queries
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
free_occlusion_queries
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
draw_buffers
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
blit_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
pshader_const_dirty
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
vshader_const_dirty
);
...
...
@@ -1593,6 +1598,7 @@ void context_destroy(IWineD3DDeviceImpl *This, struct wined3d_context *context)
destroy
=
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
context
->
draw_buffers
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
blit_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
vshader_const_dirty
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
pshader_const_dirty
);
...
...
@@ -1953,19 +1959,19 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
{
if
(
device
->
render_targets
[
i
])
device
->
draw_buffers
[
i
]
=
GL_COLOR_ATTACHMENT0
+
i
;
context
->
draw_buffers
[
i
]
=
GL_COLOR_ATTACHMENT0
+
i
;
else
device
->
draw_buffers
[
i
]
=
GL_NONE
;
context
->
draw_buffers
[
i
]
=
GL_NONE
;
}
if
(
gl_info
->
supported
[
ARB_DRAW_BUFFERS
])
{
GL_EXTCALL
(
glDrawBuffersARB
(
gl_info
->
limits
.
buffers
,
device
->
draw_buffers
));
GL_EXTCALL
(
glDrawBuffersARB
(
gl_info
->
limits
.
buffers
,
context
->
draw_buffers
));
checkGLcall
(
"glDrawBuffers()"
);
}
else
{
glDrawBuffer
(
device
->
draw_buffers
[
0
]);
glDrawBuffer
(
context
->
draw_buffers
[
0
]);
checkGLcall
(
"glDrawBuffer()"
);
}
}
else
{
...
...
@@ -2139,18 +2145,17 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm
else
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLenum
buffers
[
gl_info
->
limits
.
buffers
];
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
{
if
(
i
<
rt_count
&&
rts
[
i
])
buffers
[
i
]
=
GL_COLOR_ATTACHMENT0
+
i
;
context
->
draw_
buffers
[
i
]
=
GL_COLOR_ATTACHMENT0
+
i
;
else
buffers
[
i
]
=
GL_NONE
;
context
->
draw_
buffers
[
i
]
=
GL_NONE
;
}
ENTER_GL
();
GL_EXTCALL
(
glDrawBuffersARB
(
gl_info
->
limits
.
buffers
,
buffers
));
GL_EXTCALL
(
glDrawBuffersARB
(
gl_info
->
limits
.
buffers
,
context
->
draw_
buffers
));
checkGLcall
(
"glDrawBuffers()"
);
LEAVE_GL
();
...
...
dlls/wined3d/device.c
View file @
237f3937
...
...
@@ -1802,12 +1802,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
This
->
render_targets
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
This
->
render_targets
)
*
gl_info
->
limits
.
buffers
);
This
->
draw_buffers
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
GLenum
)
*
gl_info
->
limits
.
buffers
);
This
->
NumberOfPalettes
=
1
;
This
->
palettes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
PALETTEENTRY
*
));
if
(
!
This
->
palettes
||
!
This
->
render_targets
||
!
This
->
draw_buffers
)
{
if
(
!
This
->
palettes
||
!
This
->
render_targets
)
{
ERR
(
"Out of memory!
\n
"
);
hr
=
E_OUTOFMEMORY
;
goto
err_out
;
...
...
@@ -1946,7 +1945,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
err_out:
HeapFree
(
GetProcessHeap
(),
0
,
This
->
render_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
draw_buffers
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
swapchains
);
This
->
NumberOfSwapChains
=
0
;
if
(
This
->
palettes
)
{
...
...
@@ -2150,9 +2148,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
This
->
NumberOfPalettes
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
render_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
draw_buffers
);
This
->
render_targets
=
NULL
;
This
->
draw_buffers
=
NULL
;
This
->
d3d_initialized
=
FALSE
;
...
...
dlls/wined3d/wined3d_private.h
View file @
237f3937
...
...
@@ -1060,6 +1060,7 @@ struct wined3d_context
GLuint
fbo_draw_binding
;
BOOL
rebind_fbo
;
IWineD3DSurfaceImpl
**
blit_targets
;
GLenum
*
draw_buffers
;
/* Queries */
GLuint
*
free_occlusion_queries
;
...
...
@@ -1637,7 +1638,6 @@ struct IWineD3DDeviceImpl
UINT
currentPalette
;
/* For rendering to a texture using glCopyTexImage */
GLenum
*
draw_buffers
;
GLuint
depth_blt_texture
;
GLuint
depth_blt_rb
;
UINT
depth_blt_rb_w
;
...
...
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