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
1fb85cd5
Commit
1fb85cd5
authored
Apr 21, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the preferred binding in the wined3d_bo_gl structure.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77fe33f5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
22 deletions
+21
-22
buffer.c
dlls/wined3d/buffer.c
+10
-12
texture.c
dlls/wined3d/texture.c
+4
-3
view.c
dlls/wined3d/view.c
+6
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/buffer.c
View file @
1fb85cd5
...
...
@@ -135,7 +135,7 @@ void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD loc
/* Context activation is done by the caller. */
static
void
wined3d_buffer_gl_bind
(
struct
wined3d_buffer_gl
*
buffer_gl
,
struct
wined3d_context_gl
*
context_gl
)
{
wined3d_context_gl_bind_bo
(
context_gl
,
buffer_gl
->
b
uffer_type_hint
,
buffer_gl
->
bo
.
id
);
wined3d_context_gl_bind_bo
(
context_gl
,
buffer_gl
->
b
o
.
binding
,
buffer_gl
->
bo
.
id
);
}
/* Context activation is done by the caller. */
...
...
@@ -225,6 +225,7 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf
bo
=
&
buffer_gl
->
bo
;
GL_EXTCALL
(
glGenBuffers
(
1
,
&
bo
->
id
));
bo
->
binding
=
wined3d_buffer_gl_binding_from_bind_flags
(
gl_info
,
buffer_gl
->
b
.
resource
.
bind_flags
);
buffer_gl
->
b
.
buffer_object
=
(
uintptr_t
)
bo
;
error
=
gl_info
->
gl_ops
.
gl
.
p_glGetError
();
if
(
!
bo
->
id
||
error
!=
GL_NO_ERROR
)
...
...
@@ -248,17 +249,15 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf
if
(
gl_info
->
supported
[
APPLE_FLUSH_BUFFER_RANGE
])
{
GL_EXTCALL
(
glBufferParameteriAPPLE
(
buffer_gl
->
buffer_type_hint
,
GL_BUFFER_FLUSHING_UNMAP_APPLE
,
GL_FALSE
));
GL_EXTCALL
(
glBufferParameteriAPPLE
(
buffer_gl
->
buffer_type_hint
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_FALSE
));
GL_EXTCALL
(
glBufferParameteriAPPLE
(
bo
->
binding
,
GL_BUFFER_FLUSHING_UNMAP_APPLE
,
GL_FALSE
));
GL_EXTCALL
(
glBufferParameteriAPPLE
(
bo
->
binding
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_FALSE
));
checkGLcall
(
"glBufferParameteriAPPLE"
);
buffer_gl
->
b
.
flags
|=
WINED3D_BUFFER_APPLESYNC
;
}
/* No setup is needed here for GL_ARB_map_buffer_range. */
}
GL_EXTCALL
(
glBufferData
(
b
uffer_gl
->
buffer_type_hint
,
buffer_gl
->
b
.
resource
.
size
,
NULL
,
gl_usage
));
GL_EXTCALL
(
glBufferData
(
b
o
->
binding
,
buffer_gl
->
b
.
resource
.
size
,
NULL
,
gl_usage
));
error
=
gl_info
->
gl_ops
.
gl
.
p_glGetError
();
if
(
error
!=
GL_NO_ERROR
)
{
...
...
@@ -803,7 +802,7 @@ static void wined3d_buffer_gl_sync_apple(struct wined3d_buffer_gl *buffer_gl,
{
wined3d_buffer_gl_bind
(
buffer_gl
,
context_gl
);
GL_EXTCALL
(
glBufferData
(
buffer_gl
->
b
uffer_type_hint
,
buffer_gl
->
b
.
resource
.
size
,
GL_EXTCALL
(
glBufferData
(
buffer_gl
->
b
o
.
binding
,
buffer_gl
->
b
.
resource
.
size
,
NULL
,
buffer_gl
->
buffer_object_usage
));
checkGLcall
(
"glBufferData"
);
return
;
...
...
@@ -854,7 +853,7 @@ drop_fence:
gl_info
->
gl_ops
.
gl
.
p_glFinish
();
wined3d_buffer_gl_bind
(
buffer_gl
,
context_gl
);
GL_EXTCALL
(
glBufferParameteriAPPLE
(
buffer_gl
->
b
uffer_type_hint
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_TRUE
));
GL_EXTCALL
(
glBufferParameteriAPPLE
(
buffer_gl
->
b
o
.
binding
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_TRUE
));
checkGLcall
(
"glBufferParameteriAPPLE(buffer_gl->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"
);
buffer_gl
->
b
.
flags
&=
~
WINED3D_BUFFER_APPLESYNC
;
}
...
...
@@ -1172,7 +1171,7 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou
wined3d_buffer_gl_bind
(
buffer_gl
,
context_gl
);
for
(
i
=
0
;
i
<
range_count
;
++
i
)
{
GL_EXTCALL
(
glFlushMappedBufferRangeAPPLE
(
buffer_gl
->
b
uffer_type_hint
,
GL_EXTCALL
(
glFlushMappedBufferRangeAPPLE
(
buffer_gl
->
b
o
.
binding
,
buffer
->
maps
[
i
].
offset
,
buffer
->
maps
[
i
].
size
));
checkGLcall
(
"glFlushMappedBufferRangeAPPLE"
);
}
...
...
@@ -1503,7 +1502,7 @@ static void wined3d_buffer_gl_upload_ranges(struct wined3d_buffer *buffer, struc
while
(
range_count
--
)
{
range
=
&
ranges
[
range_count
];
GL_EXTCALL
(
glBufferSubData
(
buffer_gl
->
b
uffer_type_hint
,
GL_EXTCALL
(
glBufferSubData
(
buffer_gl
->
b
o
.
binding
,
range
->
offset
,
range
->
size
,
(
BYTE
*
)
data
+
range
->
offset
-
data_offset
));
}
checkGLcall
(
"buffer upload"
);
...
...
@@ -1526,7 +1525,7 @@ static void wined3d_buffer_gl_download_ranges(struct wined3d_buffer *buffer, str
while
(
range_count
--
)
{
range
=
&
ranges
[
range_count
];
GL_EXTCALL
(
glGetBufferSubData
(
buffer_gl
->
b
uffer_type_hint
,
GL_EXTCALL
(
glGetBufferSubData
(
buffer_gl
->
b
o
.
binding
,
range
->
offset
,
range
->
size
,
(
BYTE
*
)
data
+
range
->
offset
-
data_offset
));
}
checkGLcall
(
"buffer download"
);
...
...
@@ -1561,7 +1560,6 @@ HRESULT wined3d_buffer_gl_init(struct wined3d_buffer_gl *buffer_gl, struct wined
TRACE
(
"Not creating a BO because the buffer has dynamic usage and no GL support.
\n
"
);
else
buffer_gl
->
b
.
flags
|=
WINED3D_BUFFER_USE_BO
;
buffer_gl
->
buffer_type_hint
=
wined3d_buffer_gl_binding_from_bind_flags
(
gl_info
,
desc
->
bind_flags
);
return
wined3d_buffer_init
(
&
buffer_gl
->
b
,
device
,
desc
,
data
,
parent
,
parent_ops
,
&
wined3d_buffer_gl_ops
);
}
...
...
dlls/wined3d/texture.c
View file @
1fb85cd5
...
...
@@ -1638,9 +1638,10 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
return
;
GL_EXTCALL
(
glGenBuffers
(
1
,
&
bo
->
id
));
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
bo
->
id
));
GL_EXTCALL
(
glBufferData
(
GL_PIXEL_UNPACK_BUFFER
,
sub_resource
->
size
,
NULL
,
GL_STREAM_DRAW
));
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
0
));
bo
->
binding
=
GL_PIXEL_UNPACK_BUFFER
;
GL_EXTCALL
(
glBindBuffer
(
bo
->
binding
,
bo
->
id
));
GL_EXTCALL
(
glBufferData
(
bo
->
binding
,
sub_resource
->
size
,
NULL
,
GL_STREAM_DRAW
));
GL_EXTCALL
(
glBindBuffer
(
bo
->
binding
,
0
));
checkGLcall
(
"Create buffer object"
);
TRACE
(
"Created buffer object %u for texture %p, sub-resource %u.
\n
"
,
bo
->
id
,
texture
,
sub_resource_idx
);
...
...
dlls/wined3d/view.c
View file @
1fb85cd5
...
...
@@ -1032,8 +1032,8 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
wined3d_unordered_access_view_invalidate_location
(
&
view_gl
->
v
,
~
WINED3D_LOCATION_BUFFER
);
get_buffer_view_range
(
&
buffer_gl
->
b
,
&
view_gl
->
v
.
desc
,
&
format
->
f
,
&
offset
,
&
size
);
wined3d_context_gl_bind_bo
(
context_gl
,
buffer_gl
->
b
uffer_type_hint
,
buffer_gl
->
bo
.
id
);
GL_EXTCALL
(
glClearBufferSubData
(
buffer_gl
->
b
uffer_type_hint
,
format
->
internal
,
wined3d_context_gl_bind_bo
(
context_gl
,
buffer_gl
->
b
o
.
binding
,
buffer_gl
->
bo
.
id
);
GL_EXTCALL
(
glClearBufferSubData
(
buffer_gl
->
b
o
.
binding
,
format
->
internal
,
offset
,
size
,
format
->
format
,
format
->
type
,
clear_value
));
checkGLcall
(
"clear unordered access view"
);
}
...
...
@@ -1073,7 +1073,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
src
.
buffer_object
=
(
uintptr_t
)
&
view_gl
->
counter_bo
;
src
.
addr
=
NULL
;
wined3d_context_gl_copy_bo_address
(
context_gl
,
&
dst
,
wined3d_buffer_gl
(
buffer
)
->
b
uffer_type_hint
,
wined3d_context_gl_copy_bo_address
(
context_gl
,
&
dst
,
wined3d_buffer_gl
(
buffer
)
->
b
o
.
binding
,
&
src
,
GL_ATOMIC_COUNTER_BUFFER
,
sizeof
(
GLuint
));
wined3d_buffer_invalidate_location
(
buffer
,
~
dst_location
);
...
...
@@ -1102,9 +1102,9 @@ static void wined3d_unordered_access_view_gl_cs_init(void *object)
static
const
GLuint
initial_value
=
0
;
GL_EXTCALL
(
glGenBuffers
(
1
,
&
bo
->
id
));
GL_EXTCALL
(
glBindBuffer
(
GL_ATOMIC_COUNTER_BUFFER
,
bo
->
id
))
;
GL_EXTCALL
(
glB
ufferData
(
GL_ATOMIC_COUNTER_BUFFER
,
sizeof
(
initial_value
),
&
initial_value
,
GL_STATIC_DRAW
));
bo
->
binding
=
GL_ATOMIC_COUNTER_BUFFER
;
GL_EXTCALL
(
glB
indBuffer
(
bo
->
binding
,
bo
->
id
));
GL_EXTCALL
(
glBufferData
(
bo
->
binding
,
sizeof
(
initial_value
),
&
initial_value
,
GL_STATIC_DRAW
));
checkGLcall
(
"create atomic counter buffer"
);
}
context_release
(
context
);
...
...
dlls/wined3d/wined3d_private.h
View file @
1fb85cd5
...
...
@@ -1522,6 +1522,7 @@ do { \
struct
wined3d_bo_gl
{
GLuint
id
;
GLenum
binding
;
};
static
inline
GLuint
wined3d_bo_gl_id
(
uintptr_t
bo
)
...
...
@@ -4422,7 +4423,6 @@ struct wined3d_buffer_gl
struct
wined3d_bo_gl
bo
;
GLenum
buffer_object_usage
;
GLenum
buffer_type_hint
;
};
static
inline
struct
wined3d_buffer_gl
*
wined3d_buffer_gl
(
struct
wined3d_buffer
*
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