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
09c4e23e
Commit
09c4e23e
authored
Oct 26, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate structure for OpenGL device information.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
32e46a98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
context.c
dlls/wined3d/context.c
+3
-3
device.c
dlls/wined3d/device.c
+3
-3
directx.c
dlls/wined3d/directx.c
+6
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+13
-3
No files found.
dlls/wined3d/context.c
View file @
09c4e23e
...
...
@@ -1745,7 +1745,7 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
/* Context activation is done by the caller. */
void
context_bind_dummy_textures
(
const
struct
wined3d_context
*
context
)
{
const
struct
wined3d_dummy_textures
*
textures
=
&
context
->
device
->
dummy_textures
;
const
struct
wined3d_dummy_textures
*
textures
=
&
wined3d_device_gl
(
context
->
device
)
->
dummy_textures
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
i
;
...
...
@@ -2286,7 +2286,7 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context,
/* If this happens to be the first context for the device, dummy textures
* are not created yet. In that case, they will be created (and bound) by
* create_dummy_textures right after this context is initialized. */
if
(
device
->
dummy_textures
.
tex_2d
)
if
(
wined3d_device_gl
(
device
)
->
dummy_textures
.
tex_2d
)
context_bind_dummy_textures
(
context
);
/* Initialise all rectangles to avoid resetting unused ones later. */
...
...
@@ -2520,7 +2520,7 @@ void context_bind_bo(struct wined3d_context *context, GLenum binding, GLuint nam
void
context_bind_texture
(
struct
wined3d_context
*
context
,
GLenum
target
,
GLuint
name
)
{
const
struct
wined3d_dummy_textures
*
textures
=
&
context
->
device
->
dummy_textures
;
const
struct
wined3d_dummy_textures
*
textures
=
&
wined3d_device_gl
(
context
->
device
)
->
dummy_textures
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
DWORD
unit
=
context
->
active_texture
;
DWORD
old_texture_type
=
context
->
texture_type
[
unit
];
...
...
dlls/wined3d/device.c
View file @
09c4e23e
...
...
@@ -523,7 +523,7 @@ ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
wined3d_decref
(
device
->
wined3d
);
device
->
wined3d
=
NULL
;
heap_free
(
device
);
heap_free
(
wined3d_device_gl
(
device
)
);
TRACE
(
"Freed device %p.
\n
"
,
device
);
}
...
...
@@ -610,7 +610,7 @@ out:
/* Context activation is done by the caller. */
static
void
create_dummy_textures
(
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
{
struct
wined3d_dummy_textures
*
textures
=
&
device
->
dummy_textures
;
struct
wined3d_dummy_textures
*
textures
=
&
wined3d_device_gl
(
device
)
->
dummy_textures
;
const
struct
wined3d_d3d_info
*
d3d_info
=
context
->
d3d_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
i
;
...
...
@@ -744,7 +744,7 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
/* Context activation is done by the caller. */
static
void
destroy_dummy_textures
(
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
{
struct
wined3d_dummy_textures
*
dummy_textures
=
&
device
->
dummy_textures
;
struct
wined3d_dummy_textures
*
dummy_textures
=
&
wined3d_device_gl
(
device
)
->
dummy_textures
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
if
(
gl_info
->
supported
[
ARB_TEXTURE_MULTISAMPLE
])
...
...
dlls/wined3d/directx.c
View file @
09c4e23e
...
...
@@ -2419,7 +2419,7 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, unsigned int adapte
const
enum
wined3d_feature_level
*
feature_levels
,
unsigned
int
feature_level_count
,
struct
wined3d_device_parent
*
device_parent
,
struct
wined3d_device
**
device
)
{
struct
wined3d_device
*
object
;
struct
wined3d_device
_gl
*
device_gl
;
HRESULT
hr
;
TRACE
(
"wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, "
...
...
@@ -2430,20 +2430,20 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, unsigned int adapte
if
(
adapter_idx
>=
wined3d
->
adapter_count
)
return
WINED3DERR_INVALIDCALL
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
device_gl
=
heap_alloc_zero
(
sizeof
(
*
device_gl
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
device_init
(
object
,
wined3d
,
adapter_idx
,
if
(
FAILED
(
hr
=
device_init
(
&
device_gl
->
d
,
wined3d
,
adapter_idx
,
device_type
,
focus_window
,
flags
,
surface_alignment
,
feature_levels
,
feature_level_count
,
device_parent
)))
{
WARN
(
"Failed to initialize device, hr %#x.
\n
"
,
hr
);
heap_free
(
object
);
heap_free
(
device_gl
);
return
hr
;
}
TRACE
(
"Created device %p.
\n
"
,
object
);
*
device
=
object
;
TRACE
(
"Created device %p.
\n
"
,
device_gl
);
*
device
=
&
device_gl
->
d
;
device_parent
->
ops
->
wined3d_device_created
(
device_parent
,
*
device
);
...
...
dlls/wined3d/wined3d_private.h
View file @
09c4e23e
...
...
@@ -3029,9 +3029,6 @@ struct wined3d_device
/* The Wine logo texture */
struct
wined3d_texture
*
logo_texture
;
/* Textures for when no other textures are mapped */
struct
wined3d_dummy_textures
dummy_textures
;
/* Default sampler used to emulate the direct resource access without using wined3d_sampler */
struct
wined3d_sampler
*
default_sampler
;
struct
wined3d_sampler
*
null_sampler
;
...
...
@@ -3059,6 +3056,19 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
void
device_resource_released
(
struct
wined3d_device
*
device
,
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
void
device_invalidate_state
(
const
struct
wined3d_device
*
device
,
DWORD
state
)
DECLSPEC_HIDDEN
;
struct
wined3d_device_gl
{
struct
wined3d_device
d
;
/* Textures for when no other textures are bound. */
struct
wined3d_dummy_textures
dummy_textures
;
};
static
inline
struct
wined3d_device_gl
*
wined3d_device_gl
(
struct
wined3d_device
*
device
)
{
return
CONTAINING_RECORD
(
device
,
struct
wined3d_device_gl
,
d
);
}
static
inline
BOOL
isStateDirty
(
const
struct
wined3d_context
*
context
,
DWORD
state
)
{
DWORD
idx
=
state
/
(
sizeof
(
*
context
->
isStateDirty
)
*
CHAR_BIT
);
...
...
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