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
fd13a6ae
Commit
fd13a6ae
authored
Mar 18, 2010
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Partially implement unserialized buffers with the apple extension.
parent
5d94fe20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
buffer.c
dlls/wined3d/buffer.c
+34
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/buffer.c
View file @
fd13a6ae
...
...
@@ -107,6 +107,8 @@ static void delete_gl_buffer(struct wined3d_buffer *This)
checkGLcall
(
"glDeleteBuffersARB"
);
LEAVE_GL
();
This
->
buffer_object
=
0
;
This
->
flags
&=
~
WINED3D_BUFFER_APPLESYNC
;
}
/* Context activation is done by the caller. */
...
...
@@ -169,6 +171,10 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This)
GL_EXTCALL
(
glBufferParameteriAPPLE
(
This
->
buffer_type_hint
,
GL_BUFFER_FLUSHING_UNMAP_APPLE
,
GL_FALSE
));
checkGLcall
(
"glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)"
);
This
->
flags
|=
WINED3D_BUFFER_FLUSH
;
GL_EXTCALL
(
glBufferParameteriAPPLE
(
This
->
buffer_type_hint
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_FALSE
));
checkGLcall
(
"glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE)"
);
This
->
flags
|=
WINED3D_BUFFER_APPLESYNC
;
}
/* No setup is needed here for GL_ARB_map_buffer_range */
}
...
...
@@ -768,6 +774,26 @@ static DWORD STDMETHODCALLTYPE buffer_GetPriority(IWineD3DBuffer *iface)
return
resource_get_priority
((
IWineD3DResource
*
)
iface
);
}
/* The caller provides a context and GL locking and binds the buffer */
static
void
buffer_sync_apple
(
struct
wined3d_buffer
*
This
,
DWORD
flags
)
{
/* No fencing needs to be done if the app promises not to overwrite
* existing data */
if
(
flags
&
WINED3DLOCK_NOOVERWRITE
)
return
;
if
(
flags
&
WINED3DLOCK_DISCARD
)
{
GL_EXTCALL
(
glBufferDataARB
(
This
->
buffer_type_hint
,
This
->
resource
.
size
,
NULL
,
This
->
buffer_object_usage
));
checkGLcall
(
"glBufferDataARB
\n
"
);
return
;
}
/* Drop the unserialized updates for now */
FIXME
(
"Implement fences for unserialized buffers
\n
"
);
GL_EXTCALL
(
glBufferParameteriAPPLE
(
This
->
buffer_type_hint
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_TRUE
));
checkGLcall
(
"glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"
);
This
->
flags
&=
~
WINED3D_BUFFER_APPLESYNC
;
}
/* The caller provides a GL context */
static
void
buffer_direct_upload
(
struct
wined3d_buffer
*
This
,
const
struct
wined3d_gl_info
*
gl_info
,
DWORD
flags
)
{
...
...
@@ -795,6 +821,13 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
}
else
{
if
(
This
->
flags
&
WINED3D_BUFFER_APPLESYNC
)
{
DWORD
syncflags
=
0
;
if
(
flags
&
WINED3D_BUFFER_DISCARD
)
syncflags
|=
WINED3DLOCK_DISCARD
;
if
(
flags
&
WINED3D_BUFFER_NOSYNC
)
syncflags
|=
WINED3DLOCK_NOOVERWRITE
;
buffer_sync_apple
(
This
,
syncflags
);
}
map
=
GL_EXTCALL
(
glMapBufferARB
(
This
->
buffer_type_hint
,
GL_WRITE_ONLY_ARB
));
checkGLcall
(
"glMapBufferARB"
);
}
...
...
@@ -1183,6 +1216,7 @@ static HRESULT STDMETHODCALLTYPE buffer_Map(IWineD3DBuffer *iface, UINT offset,
}
else
{
if
(
This
->
flags
&
WINED3D_BUFFER_APPLESYNC
)
buffer_sync_apple
(
This
,
flags
);
This
->
resource
.
allocatedMemory
=
GL_EXTCALL
(
glMapBufferARB
(
This
->
buffer_type_hint
,
GL_READ_WRITE_ARB
));
checkGLcall
(
"glMapBufferARB"
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
fd13a6ae
...
...
@@ -2476,6 +2476,7 @@ struct wined3d_map_range
#define WINED3D_BUFFER_FLUSH 0x10
/* Manual unmap flushing */
#define WINED3D_BUFFER_DISCARD 0x20
/* A DISCARD lock has occurred since the last PreLoad */
#define WINED3D_BUFFER_NOSYNC 0x40
/* All locks since the last PreLoad had NOOVERWRITE set */
#define WINED3D_BUFFER_APPLESYNC 0x80
/* Using sync as in GL_APPLE_flush_buffer_range */
struct
wined3d_buffer
{
...
...
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