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
9a889f6b
Commit
9a889f6b
authored
Jan 02, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Convert textures to a bitmap in struct SAVEDSTATES.
parent
39909f2a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
device.c
dlls/wined3d/device.c
+1
-1
stateblock.c
dlls/wined3d/stateblock.c
+19
-16
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
9a889f6b
...
...
@@ -4541,7 +4541,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
TRACE
(
"GL_LIMITS %d
\n
"
,
GL_LIMITS
(
sampler_stages
));
TRACE
(
"(%p) : oldtexture(%p)
\n
"
,
This
,
oldTexture
);
This
->
updateStateBlock
->
changed
.
textures
[
Stage
]
=
TRUE
;
This
->
updateStateBlock
->
changed
.
textures
|=
1
<<
Stage
;
TRACE
(
"(%p) : setting new texture to %p
\n
"
,
This
,
pTexture
);
This
->
updateStateBlock
->
textures
[
Stage
]
=
pTexture
;
...
...
dlls/wined3d/stateblock.c
View file @
9a889f6b
...
...
@@ -88,7 +88,7 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
/* Fixed size arrays */
dest
->
streamSource
=
source
->
streamSource
;
dest
->
streamFreq
=
source
->
streamFreq
;
memcpy
(
dest
->
textures
,
source
->
textures
,
bsize
*
MAX_COMBINED_SAMPLERS
)
;
dest
->
textures
=
source
->
textures
;
memcpy
(
dest
->
transform
,
source
->
transform
,
bsize
*
(
HIGHEST_TRANSFORMSTATE
+
1
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
bsize
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memcpy
(
dest
->
textureState
,
source
->
textureState
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
...
...
@@ -125,7 +125,7 @@ void stateblock_savedstates_set(
/* Fixed size arrays */
states
->
streamSource
=
value
?
0xffff
:
0
;
states
->
streamFreq
=
value
?
0xffff
:
0
;
memset
(
states
->
textures
,
value
,
bsize
*
MAX_COMBINED_SAMPLERS
)
;
states
->
textures
=
value
?
0xfffff
:
0
;
memset
(
states
->
transform
,
value
,
bsize
*
(
HIGHEST_TRANSFORMSTATE
+
1
));
memset
(
states
->
renderState
,
value
,
bsize
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memset
(
states
->
textureState
,
value
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
...
...
@@ -574,11 +574,13 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
/* Samplers */
/* TODO: move over to using memcpy */
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
)
{
if
(
This
->
changed
.
textures
[
j
])
{
TRACE
(
"Updating texture %u to %p (was %p)
\n
"
,
j
,
targetStateBlock
->
textures
[
j
],
This
->
textures
[
j
]);
This
->
textures
[
j
]
=
targetStateBlock
->
textures
[
j
];
}
map
=
This
->
changed
.
textures
;
for
(
i
=
0
;
map
;
map
>>=
1
,
++
i
)
{
if
(
!
(
map
&
1
))
continue
;
TRACE
(
"Updating texture %u to %p (was %p)
\n
"
,
i
,
targetStateBlock
->
textures
[
i
],
This
->
textures
[
i
]);
This
->
textures
[
i
]
=
targetStateBlock
->
textures
[
i
];
}
for
(
j
=
0
;
j
<
This
->
num_contained_sampler_states
;
j
++
)
{
...
...
@@ -832,14 +834,15 @@ should really perform a delta so that only the changes get updated*/
{
if
(
map
&
1
)
IWineD3DDevice_SetStreamSourceFreq
(
pDevice
,
i
,
This
->
streamFreq
[
i
]
|
This
->
streamFlags
[
i
]);
}
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
){
if
(
This
->
changed
.
textures
[
j
])
{
if
(
j
<
MAX_FRAGMENT_SAMPLERS
)
{
IWineD3DDevice_SetTexture
(
pDevice
,
j
,
This
->
textures
[
j
]);
}
else
{
IWineD3DDevice_SetTexture
(
pDevice
,
WINED3DVERTEXTEXTURESAMPLER0
+
j
-
MAX_FRAGMENT_SAMPLERS
,
This
->
textures
[
j
]);
}
}
map
=
This
->
changed
.
textures
;
for
(
i
=
0
;
map
;
map
>>=
1
,
++
i
)
{
if
(
!
(
map
&
1
))
continue
;
if
(
i
<
MAX_FRAGMENT_SAMPLERS
)
IWineD3DDevice_SetTexture
(
pDevice
,
i
,
This
->
textures
[
i
]);
else
IWineD3DDevice_SetTexture
(
pDevice
,
WINED3DVERTEXTEXTURESAMPLER0
+
i
-
MAX_FRAGMENT_SAMPLERS
,
This
->
textures
[
i
]);
}
map
=
This
->
changed
.
clipplane
;
...
...
@@ -1239,7 +1242,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
for
(
i
=
0
;
i
<
GL_LIMITS
(
textures
);
i
++
)
{
/* Note: This avoids calling SetTexture, so pretend it has been called */
This
->
changed
.
textures
[
i
]
=
TRUE
;
This
->
changed
.
textures
|=
1
<<
i
;
This
->
textures
[
i
]
=
NULL
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
9a889f6b
...
...
@@ -1760,7 +1760,7 @@ extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl;
typedef
struct
SAVEDSTATES
{
WORD
streamSource
;
/* MAX_STREAMS, 16 */
WORD
streamFreq
;
/* MAX_STREAMS, 16 */
BOOL
textures
[
MAX_COMBINED_SAMPLERS
];
DWORD
textures
;
/* MAX_COMBINED_SAMPLERS, 20 */
BOOL
transform
[
HIGHEST_TRANSFORMSTATE
+
1
];
BOOL
renderState
[
WINEHIGHEST_RENDER_STATE
+
1
];
BOOL
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
...
...
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