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
31d51fb1
Commit
31d51fb1
authored
Feb 03, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Preload textures before applying states.
parent
7ff576bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
context.c
dlls/wined3d/context.c
+1
-0
device.c
dlls/wined3d/device.c
+44
-0
state.c
dlls/wined3d/state.c
+0
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/context.c
View file @
31d51fb1
...
...
@@ -2214,6 +2214,7 @@ static void context_apply_state(struct wined3d_context *context, IWineD3DDeviceI
}
IWineD3DDeviceImpl_FindTexUnitMap
(
device
);
device_preload_textures
(
device
);
ENTER_GL
();
for
(
i
=
0
;
i
<
context
->
numDirtyEntries
;
++
i
)
...
...
dlls/wined3d/device.c
View file @
31d51fb1
...
...
@@ -370,6 +370,50 @@ void device_stream_info_from_strided(const struct wined3d_gl_info *gl_info,
}
}
static
void
device_preload_texture
(
IWineD3DStateBlockImpl
*
stateblock
,
unsigned
int
idx
)
{
IWineD3DBaseTextureImpl
*
texture
;
enum
WINED3DSRGB
srgb
;
if
(
!
(
texture
=
(
IWineD3DBaseTextureImpl
*
)
stateblock
->
textures
[
idx
]))
return
;
srgb
=
stateblock
->
samplerState
[
idx
][
WINED3DSAMP_SRGBTEXTURE
]
?
SRGB_SRGB
:
SRGB_RGB
;
texture
->
baseTexture
.
internal_preload
((
IWineD3DBaseTexture
*
)
texture
,
srgb
);
}
void
device_preload_textures
(
IWineD3DDeviceImpl
*
device
)
{
IWineD3DStateBlockImpl
*
stateblock
=
device
->
stateBlock
;
unsigned
int
i
;
if
(
use_vs
(
stateblock
))
{
for
(
i
=
0
;
i
<
MAX_VERTEX_SAMPLERS
;
++
i
)
{
if
(((
IWineD3DBaseShaderImpl
*
)
stateblock
->
vertexShader
)
->
baseShader
.
reg_maps
.
sampler_type
[
i
])
device_preload_texture
(
stateblock
,
MAX_FRAGMENT_SAMPLERS
+
i
);
}
}
if
(
use_ps
(
stateblock
))
{
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
if
(((
IWineD3DBaseShaderImpl
*
)
stateblock
->
pixelShader
)
->
baseShader
.
reg_maps
.
sampler_type
[
i
])
device_preload_texture
(
stateblock
,
i
);
}
}
else
{
WORD
ffu_map
=
device
->
fixed_function_usage_map
;
for
(
i
=
0
;
ffu_map
;
ffu_map
>>=
1
,
++
i
)
{
if
(
ffu_map
&
1
)
device_preload_texture
(
stateblock
,
i
);
}
}
}
/**********************************************************
* IUnknown parts follows
**********************************************************/
...
...
dlls/wined3d/state.c
View file @
31d51fb1
...
...
@@ -3527,7 +3527,6 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wine
if
(
stateblock
->
textures
[
sampler
])
{
BOOL
srgb
=
stateblock
->
samplerState
[
sampler
][
WINED3DSAMP_SRGBTEXTURE
];
IWineD3DBaseTextureImpl
*
tex_impl
=
(
IWineD3DBaseTextureImpl
*
)
stateblock
->
textures
[
sampler
];
tex_impl
->
baseTexture
.
internal_preload
(
stateblock
->
textures
[
sampler
],
srgb
?
SRGB_SRGB
:
SRGB_RGB
);
IWineD3DBaseTexture_BindTexture
(
stateblock
->
textures
[
sampler
],
srgb
);
basetexture_apply_state_changes
(
stateblock
->
textures
[
sampler
],
stateblock
->
textureState
[
sampler
],
stateblock
->
samplerState
[
sampler
],
gl_info
);
...
...
dlls/wined3d/wined3d_private.h
View file @
31d51fb1
...
...
@@ -1620,6 +1620,7 @@ struct IWineD3DDeviceImpl
HRESULT
device_init
(
IWineD3DDeviceImpl
*
device
,
IWineD3DImpl
*
wined3d
,
UINT
adapter_idx
,
WINED3DDEVTYPE
device_type
,
HWND
focus_window
,
DWORD
flags
,
IUnknown
*
parent
,
IWineD3DDeviceParent
*
device_parent
)
DECLSPEC_HIDDEN
;
void
device_preload_textures
(
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
LRESULT
device_process_message
(
IWineD3DDeviceImpl
*
device
,
HWND
window
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
,
WNDPROC
proc
)
DECLSPEC_HIDDEN
;
void
device_resource_add
(
IWineD3DDeviceImpl
*
This
,
IWineD3DResource
*
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