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
8a7744b0
Commit
8a7744b0
authored
Sep 30, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Call state_init_default() from state_init() when the appropriate flag is set.
parent
bc0f990b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
37 deletions
+42
-37
cs.c
dlls/wined3d/cs.c
+2
-2
device.c
dlls/wined3d/device.c
+4
-4
stateblock.c
dlls/wined3d/stateblock.c
+33
-29
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-2
No files found.
dlls/wined3d/cs.c
View file @
8a7744b0
...
...
@@ -224,13 +224,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return
NULL
;
}
if
(
FAILED
(
state_init
(
&
cs
->
state
,
&
cs
->
fb
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_NO_REF
)))
if
(
FAILED
(
state_init
(
&
cs
->
state
,
&
cs
->
fb
,
gl_info
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_NO_REF
|
WINED3D_STATE_INIT_DEFAULT
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
cs
->
fb
.
render_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
cs
);
return
NULL
;
}
state_init_default
(
&
cs
->
state
,
gl_info
);
cs
->
ops
=
&
wined3d_cs_st_ops
;
cs
->
device
=
device
;
...
...
dlls/wined3d/device.c
View file @
8a7744b0
...
...
@@ -4705,9 +4705,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if
(
device
->
d3d_initialized
)
delete_opengl_contexts
(
device
,
swapchain
);
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
fb
,
&
device
->
adapter
->
d3d_info
,
0
)))
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
fb
,
&
device
->
adapter
->
gl_info
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_INIT_DEFAULT
)))
ERR
(
"Failed to initialize device state, hr %#x.
\n
"
,
hr
);
state_init_default
(
&
device
->
state
,
&
device
->
adapter
->
gl_info
);
device
->
update_state
=
&
device
->
state
;
device_init_swapchain_state
(
device
,
swapchain
);
...
...
@@ -4969,12 +4969,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device
->
blitter
=
adapter
->
blitter
;
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
fb
,
&
adapter
->
d3d_info
,
0
)))
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
fb
,
&
adapter
->
gl_info
,
&
adapter
->
d3d_info
,
WINED3D_STATE_INIT_DEFAULT
)))
{
ERR
(
"Failed to initialize device state, hr %#x.
\n
"
,
hr
);
goto
err
;
}
state_init_default
(
&
device
->
state
,
&
adapter
->
gl_info
);
device
->
update_state
=
&
device
->
state
;
if
(
!
(
device
->
cs
=
wined3d_cs_create
(
device
)))
...
...
dlls/wined3d/stateblock.c
View file @
8a7744b0
...
...
@@ -599,33 +599,6 @@ void state_cleanup(struct wined3d_state *state)
HeapFree
(
GetProcessHeap
(),
0
,
state
->
ps_consts_f
);
}
HRESULT
state_init
(
struct
wined3d_state
*
state
,
struct
wined3d_fb_state
*
fb
,
const
struct
wined3d_d3d_info
*
d3d_info
,
DWORD
flags
)
{
unsigned
int
i
;
state
->
flags
=
flags
;
state
->
fb
=
fb
;
for
(
i
=
0
;
i
<
LIGHTMAP_SIZE
;
i
++
)
{
list_init
(
&
state
->
light_map
[
i
]);
}
if
(
!
(
state
->
vs_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
4
*
sizeof
(
float
)
*
d3d_info
->
limits
.
vs_uniform_count
)))
return
E_OUTOFMEMORY
;
if
(
!
(
state
->
ps_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
4
*
sizeof
(
float
)
*
d3d_info
->
limits
.
ps_uniform_count
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
state
->
vs_consts_f
);
return
E_OUTOFMEMORY
;
}
return
WINED3D_OK
;
}
ULONG
CDECL
wined3d_stateblock_decref
(
struct
wined3d_stateblock
*
stateblock
)
{
ULONG
refcount
=
InterlockedDecrement
(
&
stateblock
->
ref
);
...
...
@@ -1173,7 +1146,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
TRACE
(
"Applied stateblock %p.
\n
"
,
stateblock
);
}
void
state_init_default
(
struct
wined3d_state
*
state
,
const
struct
wined3d_gl_info
*
gl_info
)
static
void
state_init_default
(
struct
wined3d_state
*
state
,
const
struct
wined3d_gl_info
*
gl_info
)
{
union
{
...
...
@@ -1379,6 +1352,37 @@ void state_init_default(struct wined3d_state *state, const struct wined3d_gl_inf
}
}
HRESULT
state_init
(
struct
wined3d_state
*
state
,
struct
wined3d_fb_state
*
fb
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_d3d_info
*
d3d_info
,
DWORD
flags
)
{
unsigned
int
i
;
state
->
flags
=
flags
;
state
->
fb
=
fb
;
for
(
i
=
0
;
i
<
LIGHTMAP_SIZE
;
i
++
)
{
list_init
(
&
state
->
light_map
[
i
]);
}
if
(
!
(
state
->
vs_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
4
*
sizeof
(
float
)
*
d3d_info
->
limits
.
vs_uniform_count
)))
return
E_OUTOFMEMORY
;
if
(
!
(
state
->
ps_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
4
*
sizeof
(
float
)
*
d3d_info
->
limits
.
ps_uniform_count
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
state
->
vs_consts_f
);
return
E_OUTOFMEMORY
;
}
if
(
flags
&
WINED3D_STATE_INIT_DEFAULT
)
state_init_default
(
state
,
gl_info
);
return
WINED3D_OK
;
}
static
HRESULT
stateblock_init
(
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_device
*
device
,
enum
wined3d_stateblock_type
type
)
{
...
...
@@ -1388,7 +1392,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
stateblock
->
ref
=
1
;
stateblock
->
device
=
device
;
if
(
FAILED
(
hr
=
state_init
(
&
stateblock
->
state
,
NULL
,
d3d_info
,
0
)))
if
(
FAILED
(
hr
=
state_init
(
&
stateblock
->
state
,
NULL
,
&
device
->
adapter
->
gl_info
,
d3d_info
,
0
)))
return
hr
;
if
(
FAILED
(
hr
=
stateblock_allocate_shader_constants
(
stateblock
)))
...
...
dlls/wined3d/wined3d_private.h
View file @
8a7744b0
...
...
@@ -1805,6 +1805,7 @@ struct wined3d_stream_state
};
#define WINED3D_STATE_NO_REF 0x00000001
#define WINED3D_STATE_INIT_DEFAULT 0x00000002
struct
wined3d_state
{
...
...
@@ -2454,8 +2455,8 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DEC
void
state_cleanup
(
struct
wined3d_state
*
state
)
DECLSPEC_HIDDEN
;
HRESULT
state_init
(
struct
wined3d_state
*
state
,
struct
wined3d_fb_state
*
fb
,
const
struct
wined3d_
d3d_info
*
d3d_info
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
state_init_default
(
struct
wined3d_state
*
state
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_
gl_info
*
gl_info
,
const
struct
wined3d_d3d_info
*
d3d_info
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
state_unbind_resources
(
struct
wined3d_state
*
state
)
DECLSPEC_HIDDEN
;
struct
wined3d_cs_ops
...
...
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