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
59e0b841
Commit
59e0b841
authored
Sep 16, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move device_preload_textures into context.c.
parent
112617f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
49 deletions
+49
-49
context.c
dlls/wined3d/context.c
+49
-1
device.c
dlls/wined3d/device.c
+0
-47
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/context.c
View file @
59e0b841
...
...
@@ -2787,6 +2787,54 @@ static void context_update_stream_info(struct wined3d_context *context, const st
}
/* Context activation is done by the caller. */
static
void
context_preload_texture
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
unsigned
int
idx
)
{
struct
wined3d_texture
*
texture
;
enum
WINED3DSRGB
srgb
;
if
(
!
(
texture
=
state
->
textures
[
idx
]))
return
;
srgb
=
state
->
sampler_states
[
idx
][
WINED3D_SAMP_SRGB_TEXTURE
]
?
SRGB_SRGB
:
SRGB_RGB
;
texture
->
texture_ops
->
texture_preload
(
texture
,
context
,
srgb
);
}
/* Context activation is done by the caller. */
static
void
context_preload_textures
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{
unsigned
int
i
;
if
(
use_vs
(
state
))
{
for
(
i
=
0
;
i
<
MAX_VERTEX_SAMPLERS
;
++
i
)
{
if
(
state
->
vertex_shader
->
reg_maps
.
sampler_type
[
i
])
context_preload_texture
(
context
,
state
,
MAX_FRAGMENT_SAMPLERS
+
i
);
}
}
if
(
use_ps
(
state
))
{
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
if
(
state
->
pixel_shader
->
reg_maps
.
sampler_type
[
i
])
context_preload_texture
(
context
,
state
,
i
);
}
}
else
{
WORD
ffu_map
=
context
->
fixed_function_usage_map
;
for
(
i
=
0
;
ffu_map
;
ffu_map
>>=
1
,
++
i
)
{
if
(
ffu_map
&
1
)
context_preload_texture
(
context
,
state
,
i
);
}
}
}
/* Context activation is done by the caller. */
BOOL
context_apply_draw_state
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
)
{
const
struct
wined3d_state
*
state
=
&
device
->
state
;
...
...
@@ -2807,7 +2855,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
* result in changes to the current FBO, due to using e.g. FBO blits for
* updating a resource location. */
context_update_tex_unit_map
(
context
,
state
);
device_preload_textures
(
device
,
context
);
context_preload_textures
(
context
,
state
);
if
(
isStateDirty
(
context
,
STATE_VDECL
)
||
isStateDirty
(
context
,
STATE_STREAMSRC
))
context_update_stream_info
(
context
,
state
);
if
(
state
->
index_buffer
)
...
...
dlls/wined3d/device.c
View file @
59e0b841
...
...
@@ -134,53 +134,6 @@ static enum wined3d_primitive_type d3d_primitive_type_from_gl(GLenum primitive_t
}
}
/* Context activation is done by the caller. */
static
void
device_preload_texture
(
const
struct
wined3d_state
*
state
,
struct
wined3d_context
*
context
,
unsigned
int
idx
)
{
struct
wined3d_texture
*
texture
;
enum
WINED3DSRGB
srgb
;
if
(
!
(
texture
=
state
->
textures
[
idx
]))
return
;
srgb
=
state
->
sampler_states
[
idx
][
WINED3D_SAMP_SRGB_TEXTURE
]
?
SRGB_SRGB
:
SRGB_RGB
;
texture
->
texture_ops
->
texture_preload
(
texture
,
context
,
srgb
);
}
/* Context activation is done by the caller. */
void
device_preload_textures
(
const
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_state
*
state
=
&
device
->
state
;
unsigned
int
i
;
if
(
use_vs
(
state
))
{
for
(
i
=
0
;
i
<
MAX_VERTEX_SAMPLERS
;
++
i
)
{
if
(
state
->
vertex_shader
->
reg_maps
.
sampler_type
[
i
])
device_preload_texture
(
state
,
context
,
MAX_FRAGMENT_SAMPLERS
+
i
);
}
}
if
(
use_ps
(
state
))
{
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
if
(
state
->
pixel_shader
->
reg_maps
.
sampler_type
[
i
])
device_preload_texture
(
state
,
context
,
i
);
}
}
else
{
WORD
ffu_map
=
context
->
fixed_function_usage_map
;
for
(
i
=
0
;
ffu_map
;
ffu_map
>>=
1
,
++
i
)
{
if
(
ffu_map
&
1
)
device_preload_texture
(
state
,
context
,
i
);
}
}
}
BOOL
device_context_add
(
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
{
struct
wined3d_context
**
new_array
;
...
...
dlls/wined3d/wined3d_private.h
View file @
59e0b841
...
...
@@ -1952,7 +1952,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
HRESULT
device_init
(
struct
wined3d_device
*
device
,
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
enum
wined3d_device_type
device_type
,
HWND
focus_window
,
DWORD
flags
,
BYTE
surface_alignment
,
struct
wined3d_device_parent
*
device_parent
)
DECLSPEC_HIDDEN
;
void
device_preload_textures
(
const
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
LRESULT
device_process_message
(
struct
wined3d_device
*
device
,
HWND
window
,
BOOL
unicode
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
,
WNDPROC
proc
)
DECLSPEC_HIDDEN
;
void
device_resource_add
(
struct
wined3d_device
*
device
,
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
...
...
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