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
1381d179
Commit
1381d179
authored
Jun 22, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a wined3d_context_gl structure to wined3d_buffer_gl_bind().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8c231b01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
buffer.c
dlls/wined3d/buffer.c
+13
-8
No files found.
dlls/wined3d/buffer.c
View file @
1381d179
...
...
@@ -133,10 +133,8 @@ 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
*
context
)
static
void
wined3d_buffer_gl_bind
(
struct
wined3d_buffer_gl
*
buffer_gl
,
struct
wined3d_context
_gl
*
context_gl
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
wined3d_context_gl_bind_bo
(
context_gl
,
buffer_gl
->
buffer_type_hint
,
buffer_gl
->
buffer_object
);
}
...
...
@@ -200,6 +198,7 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu
/* Context activation is done by the caller. */
static
BOOL
wined3d_buffer_gl_create_buffer_object
(
struct
wined3d_buffer_gl
*
buffer_gl
,
struct
wined3d_context
*
context
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLenum
gl_usage
=
GL_STATIC_DRAW
;
GLenum
error
;
...
...
@@ -228,7 +227,7 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf
goto
fail
;
}
wined3d_buffer_gl_bind
(
buffer_gl
,
context
);
wined3d_buffer_gl_bind
(
buffer_gl
,
context
_gl
);
error
=
gl_info
->
gl_ops
.
gl
.
p_glGetError
();
if
(
error
!=
GL_NO_ERROR
)
{
...
...
@@ -541,10 +540,11 @@ ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
static
void
wined3d_buffer_gl_upload_ranges
(
struct
wined3d_buffer_gl
*
buffer_gl
,
struct
wined3d_context
*
context
,
const
void
*
data
,
unsigned
int
data_offset
,
unsigned
int
range_count
,
const
struct
wined3d_map_range
*
ranges
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_map_range
*
range
;
wined3d_buffer_gl_bind
(
buffer_gl
,
context
);
wined3d_buffer_gl_bind
(
buffer_gl
,
context
_gl
);
while
(
range_count
--
)
{
...
...
@@ -645,6 +645,7 @@ static BOOL wined3d_buffer_prepare_location(struct wined3d_buffer *buffer,
BOOL
wined3d_buffer_load_location
(
struct
wined3d_buffer
*
buffer
,
struct
wined3d_context
*
context
,
DWORD
location
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
struct
wined3d_buffer_gl
*
buffer_gl
=
wined3d_buffer_gl
(
buffer
);
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
...
...
@@ -680,7 +681,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
switch
(
location
)
{
case
WINED3D_LOCATION_SYSMEM
:
wined3d_buffer_gl_bind
(
buffer_gl
,
context
);
wined3d_buffer_gl_bind
(
buffer_gl
,
context
_gl
);
GL_EXTCALL
(
glGetBufferSubData
(
buffer_gl
->
buffer_type_hint
,
0
,
buffer
->
resource
.
size
,
buffer
->
resource
.
heap_memory
));
checkGLcall
(
"buffer download"
);
...
...
@@ -1011,6 +1012,7 @@ static HRESULT wined3d_buffer_gl_map(struct wined3d_buffer_gl *buffer_gl,
unsigned
int
offset
,
unsigned
int
size
,
BYTE
**
data
,
DWORD
flags
)
{
struct
wined3d_device
*
device
=
buffer_gl
->
b
.
resource
.
device
;
struct
wined3d_context_gl
*
context_gl
;
struct
wined3d_context
*
context
;
LONG
count
;
BYTE
*
base
;
...
...
@@ -1052,6 +1054,7 @@ static HRESULT wined3d_buffer_gl_map(struct wined3d_buffer_gl *buffer_gl,
const
struct
wined3d_gl_info
*
gl_info
;
context
=
context_acquire
(
device
,
NULL
,
0
);
context_gl
=
wined3d_context_gl
(
context
);
gl_info
=
context
->
gl_info
;
if
(
flags
&
WINED3D_MAP_DISCARD
)
...
...
@@ -1070,7 +1073,7 @@ static HRESULT wined3d_buffer_gl_map(struct wined3d_buffer_gl *buffer_gl,
if
(
count
==
1
)
{
wined3d_buffer_gl_bind
(
buffer_gl
,
context
);
wined3d_buffer_gl_bind
(
buffer_gl
,
context
_gl
);
/* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001
* multitexture fill rate test seems to depend on this. When
...
...
@@ -1168,12 +1171,14 @@ static void wined3d_buffer_gl_unmap(struct wined3d_buffer_gl *buffer_gl)
{
struct
wined3d_device
*
device
=
buffer_gl
->
b
.
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context_gl
*
context_gl
;
struct
wined3d_context
*
context
;
context
=
context_acquire
(
device
,
NULL
,
0
);
context_gl
=
wined3d_context_gl
(
context
);
gl_info
=
context
->
gl_info
;
wined3d_buffer_gl_bind
(
buffer_gl
,
context
);
wined3d_buffer_gl_bind
(
buffer_gl
,
context
_gl
);
if
(
gl_info
->
supported
[
ARB_MAP_BUFFER_RANGE
])
{
...
...
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