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
18ec2525
Commit
18ec2525
authored
Mar 15, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the swapchain instead of the surface in the context.
parent
b281f23e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
62 deletions
+54
-62
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-4
context.c
dlls/wined3d/context.c
+38
-38
device.c
dlls/wined3d/device.c
+5
-7
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+3
-8
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
18ec2525
...
...
@@ -576,7 +576,7 @@ static inline void shader_arb_vs_local_constants(IWineD3DDeviceImpl* deviceImpl)
/* GL locking is done by the caller (state handler) */
static
void
shader_arb_load_constants
(
const
struct
wined3d_context
*
context
,
char
usePixelShader
,
char
useVertexShader
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
IWineD3DStateBlockImpl
*
stateBlock
=
device
->
stateBlock
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
...
...
@@ -606,7 +606,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
* context. On a context switch the old context will be fully dirtified */
if
(
!
context
||
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
!=
This
)
return
;
if
(
!
context
||
context
->
swapchain
->
device
!=
This
)
return
;
memset
(
context
->
vshader_const_dirty
+
start
,
1
,
sizeof
(
*
context
->
vshader_const_dirty
)
*
count
);
This
->
highest_dirty_vs_const
=
max
(
This
->
highest_dirty_vs_const
,
start
+
count
);
...
...
@@ -619,7 +619,7 @@ static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
* context. On a context switch the old context will be fully dirtified */
if
(
!
context
||
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
!=
This
)
return
;
if
(
!
context
||
context
->
swapchain
->
device
!=
This
)
return
;
memset
(
context
->
pshader_const_dirty
+
start
,
1
,
sizeof
(
*
context
->
pshader_const_dirty
)
*
count
);
This
->
highest_dirty_ps_const
=
max
(
This
->
highest_dirty_ps_const
,
start
+
count
);
...
...
@@ -4339,7 +4339,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
/* GL locking is done by the caller */
static
void
shader_arb_select
(
const
struct
wined3d_context
*
context
,
BOOL
usePS
,
BOOL
useVS
)
{
IWineD3DDeviceImpl
*
This
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
;
IWineD3DDeviceImpl
*
This
=
context
->
swapchain
->
device
;
struct
shader_arb_priv
*
priv
=
This
->
shader_priv
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
int
i
;
...
...
dlls/wined3d/context.c
View file @
18ec2525
This diff is collapsed.
Click to expand it.
dlls/wined3d/device.c
View file @
18ec2525
...
...
@@ -6442,8 +6442,7 @@ HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *
}
target
=
(
IWineD3DSurfaceImpl
*
)(
swapchain
->
backBuffer
?
swapchain
->
backBuffer
[
0
]
:
swapchain
->
frontBuffer
);
context
=
context_create
(
This
,
target
,
swapchain
->
win_handle
,
&
swapchain
->
presentParms
);
if
(
!
context
)
if
(
!
(
context
=
context_create
(
swapchain
,
target
)))
{
WARN
(
"Failed to create context.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
swapchain
->
context
);
...
...
@@ -7155,13 +7154,12 @@ void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *h
void
get_drawable_size_backbuffer
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DS
urfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
context
->
surface
;
IWineD3DS
wapChainImpl
*
swapchain
=
context
->
swapchain
;
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
* current context's drawable, which is the size of the back buffer of the swapchain
* the active context belongs to. The back buffer of the swapchain is stored as the
* surface the context belongs to. */
*
width
=
surface
->
currentDesc
.
Width
;
*
height
=
surface
->
currentDesc
.
Height
;
* the active context belongs to. */
*
width
=
swapchain
->
presentParms
.
BackBufferWidth
;
*
height
=
swapchain
->
presentParms
.
BackBufferHeight
;
}
LRESULT
device_process_message
(
IWineD3DDeviceImpl
*
device
,
HWND
window
,
...
...
dlls/wined3d/glsl_shader.c
View file @
18ec2525
...
...
@@ -719,8 +719,8 @@ static void shader_glsl_load_np2fixup_constants(
static
void
shader_glsl_load_constants
(
const
struct
wined3d_context
*
context
,
char
usePixelShader
,
char
useVertexShader
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
IWineD3DStateBlockImpl
*
stateBlock
=
device
->
stateBlock
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
...
...
@@ -4530,8 +4530,8 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info,
/* GL locking is done by the caller */
static
void
shader_glsl_select
(
const
struct
wined3d_context
*
context
,
BOOL
usePS
,
BOOL
useVS
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
GLhandleARB
program_id
=
0
;
GLenum
old_vertex_color_clamp
,
current_vertex_color_clamp
;
...
...
dlls/wined3d/swapchain.c
View file @
18ec2525
...
...
@@ -546,8 +546,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_SetDestWindowOverride(IWineD3DSwapCh
IWineD3DSurface_UnlockRect
(
This
->
backBuffer
[
0
]);
context_destroy
(
This
->
device
,
This
->
context
[
0
]);
This
->
context
[
0
]
=
context_create
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
win_handle
,
&
This
->
presentParms
);
This
->
context
[
0
]
=
context_create
(
This
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
);
context_release
(
This
->
context
[
0
]);
IWineD3DSurface_LockRect
(
This
->
backBuffer
[
0
],
&
r
,
NULL
,
WINED3DLOCK_DISCARD
);
...
...
@@ -816,9 +815,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
if
(
surface_type
==
SURFACE_OPENGL
)
{
swapchain
->
context
[
0
]
=
context_create
(
device
,
(
IWineD3DSurfaceImpl
*
)
swapchain
->
frontBuffer
,
window
,
present_parameters
);
if
(
!
swapchain
->
context
[
0
])
if
(
!
(
swapchain
->
context
[
0
]
=
context_create
(
swapchain
,
(
IWineD3DSurfaceImpl
*
)
swapchain
->
frontBuffer
)))
{
WARN
(
"Failed to create context.
\n
"
);
hr
=
WINED3DERR_NOTAVAILABLE
;
...
...
@@ -935,9 +932,7 @@ struct wined3d_context *swapchain_create_context_for_thread(IWineD3DSwapChain *i
TRACE
(
"Creating a new context for swapchain %p, thread %d
\n
"
,
This
,
GetCurrentThreadId
());
ctx
=
context_create
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
context
[
0
]
->
win_handle
,
&
This
->
presentParms
);
if
(
!
ctx
)
if
(
!
(
ctx
=
context_create
(
This
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
)))
{
ERR
(
"Failed to create a new context for the swapchain
\n
"
);
return
NULL
;
...
...
dlls/wined3d/wined3d_private.h
View file @
18ec2525
...
...
@@ -1051,7 +1051,7 @@ struct wined3d_context
DWORD
numDirtyEntries
;
DWORD
isStateDirty
[
STATE_HIGHEST
/
(
sizeof
(
DWORD
)
*
CHAR_BIT
)
+
1
];
/* Bitmap to find out quickly if a state is dirty */
IWineD3DS
urface
*
surface
;
IWineD3DS
wapChainImpl
*
swapchain
;
IWineD3DSurface
*
current_rt
;
DWORD
tid
;
/* Thread ID which owns this context at the moment */
...
...
@@ -1199,8 +1199,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum
fbo_target
,
IWineD3DSurface
*
depth_stencil
,
BOOL
use_render_buffer
)
DECLSPEC_HIDDEN
;
void
context_attach_surface_fbo
(
const
struct
wined3d_context
*
context
,
GLenum
fbo_target
,
DWORD
idx
,
IWineD3DSurface
*
surface
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context_create
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
const
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context_create
(
IWineD3DSwapChainImpl
*
swapchain
,
IWineD3DSurfaceImpl
*
target
)
DECLSPEC_HIDDEN
;
void
context_destroy
(
IWineD3DDeviceImpl
*
This
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
context_free_event_query
(
struct
wined3d_event_query
*
query
)
DECLSPEC_HIDDEN
;
void
context_free_occlusion_query
(
struct
wined3d_occlusion_query
*
query
)
DECLSPEC_HIDDEN
;
...
...
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