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
a147fd9c
Commit
a147fd9c
authored
Nov 18, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix the indentation in buffer_direct_upload().
parent
03f7a2d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
53 deletions
+57
-53
buffer.c
dlls/wined3d/buffer.c
+57
-53
No files found.
dlls/wined3d/buffer.c
View file @
a147fd9c
...
...
@@ -863,71 +863,75 @@ drop_query:
/* The caller provides a GL context */
static
void
buffer_direct_upload
(
struct
wined3d_buffer
*
This
,
const
struct
wined3d_gl_info
*
gl_info
,
DWORD
flags
)
{
BYTE
*
map
;
UINT
start
=
0
,
len
=
0
;
BYTE
*
map
;
UINT
start
=
0
,
len
=
0
;
ENTER_GL
();
GL_EXTCALL
(
glBindBufferARB
(
This
->
buffer_type_hint
,
This
->
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
if
(
gl_info
->
supported
[
ARB_MAP_BUFFER_RANGE
])
ENTER_GL
();
/* This potentially invalidates the element array buffer binding, but the
* caller always takes care of this. */
GL_EXTCALL
(
glBindBufferARB
(
This
->
buffer_type_hint
,
This
->
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
if
(
gl_info
->
supported
[
ARB_MAP_BUFFER_RANGE
])
{
GLbitfield
mapflags
;
mapflags
=
GL_MAP_WRITE_BIT
|
GL_MAP_FLUSH_EXPLICIT_BIT
;
if
(
flags
&
WINED3D_BUFFER_DISCARD
)
{
GLbitfield
mapflags
;
mapflags
=
GL_MAP_WRITE_BIT
|
GL_MAP_FLUSH_EXPLICIT_BIT
;
if
(
flags
&
WINED3D_BUFFER_DISCARD
)
{
mapflags
|=
GL_MAP_UNSYNCHRONIZED_BIT
|
GL_MAP_INVALIDATE_BUFFER_BIT
;
}
else
if
(
flags
&
WINED3D_BUFFER_NOSYNC
)
{
mapflags
|=
GL_MAP_UNSYNCHRONIZED_BIT
;
}
map
=
GL_EXTCALL
(
glMapBufferRange
(
This
->
buffer_type_hint
,
0
,
This
->
resource
.
size
,
mapflags
));
checkGLcall
(
"glMapBufferRange"
);
mapflags
|=
GL_MAP_UNSYNCHRONIZED_BIT
|
GL_MAP_INVALIDATE_BUFFER_BIT
;
}
else
else
if
(
flags
&
WINED3D_BUFFER_NOSYNC
)
{
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
;
LEAVE_GL
();
buffer_sync_apple
(
This
,
syncflags
,
gl_info
);
ENTER_GL
();
}
map
=
GL_EXTCALL
(
glMapBufferARB
(
This
->
buffer_type_hint
,
GL_WRITE_ONLY_ARB
));
checkGLcall
(
"glMapBufferARB"
);
mapflags
|=
GL_MAP_UNSYNCHRONIZED_BIT
;
}
if
(
!
map
)
map
=
GL_EXTCALL
(
glMapBufferRange
(
This
->
buffer_type_hint
,
0
,
This
->
resource
.
size
,
mapflags
));
checkGLcall
(
"glMapBufferRange"
);
}
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
;
LEAVE_GL
();
ERR
(
"Failed to map opengl buffer
\n
"
);
return
;
buffer_sync_apple
(
This
,
syncflags
,
gl_info
);
ENTER_GL
()
;
}
map
=
GL_EXTCALL
(
glMapBufferARB
(
This
->
buffer_type_hint
,
GL_WRITE_ONLY_ARB
));
checkGLcall
(
"glMapBufferARB"
);
}
if
(
!
map
)
{
LEAVE_GL
();
ERR
(
"Failed to map opengl buffer
\n
"
);
return
;
}
while
(
This
->
modified_areas
)
{
This
->
modified_areas
--
;
start
=
This
->
maps
[
This
->
modified_areas
].
offset
;
len
=
This
->
maps
[
This
->
modified_areas
].
size
;
while
(
This
->
modified_areas
)
{
This
->
modified_areas
--
;
start
=
This
->
maps
[
This
->
modified_areas
].
offset
;
len
=
This
->
maps
[
This
->
modified_areas
].
size
;
memcpy
(
map
+
start
,
This
->
resource
.
allocatedMemory
+
start
,
len
);
memcpy
(
map
+
start
,
This
->
resource
.
allocatedMemory
+
start
,
len
);
if
(
gl_info
->
supported
[
ARB_MAP_BUFFER_RANGE
])
{
GL_EXTCALL
(
glFlushMappedBufferRange
(
This
->
buffer_type_hint
,
start
,
len
));
checkGLcall
(
"glFlushMappedBufferRange"
);
}
else
if
(
This
->
flags
&
WINED3D_BUFFER_FLUSH
)
{
GL_EXTCALL
(
glFlushMappedBufferRangeAPPLE
(
This
->
buffer_type_hint
,
start
,
len
));
checkGLcall
(
"glFlushMappedBufferRangeAPPLE"
);
}
if
(
gl_info
->
supported
[
ARB_MAP_BUFFER_RANGE
])
{
GL_EXTCALL
(
glFlushMappedBufferRange
(
This
->
buffer_type_hint
,
start
,
len
));
checkGLcall
(
"glFlushMappedBufferRange"
);
}
GL_EXTCALL
(
glUnmapBufferARB
(
This
->
buffer_type_hint
));
checkGLcall
(
"glUnmapBufferARB"
);
LEAVE_GL
();
else
if
(
This
->
flags
&
WINED3D_BUFFER_FLUSH
)
{
GL_EXTCALL
(
glFlushMappedBufferRangeAPPLE
(
This
->
buffer_type_hint
,
start
,
len
));
checkGLcall
(
"glFlushMappedBufferRangeAPPLE"
);
}
}
GL_EXTCALL
(
glUnmapBufferARB
(
This
->
buffer_type_hint
));
checkGLcall
(
"glUnmapBufferARB"
);
LEAVE_GL
();
}
/* Do not call while under the GL lock. */
...
...
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