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
09c3537a
Commit
09c3537a
authored
Mar 03, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Retrieve the GL texture through a function.
parent
59f7b889
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
24 deletions
+22
-24
basetexture.c
dlls/wined3d/basetexture.c
+2
-8
context.c
dlls/wined3d/context.c
+5
-8
cubetexture.c
dlls/wined3d/cubetexture.c
+5
-4
texture.c
dlls/wined3d/texture.c
+5
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/basetexture.c
View file @
09c3537a
...
...
@@ -248,10 +248,7 @@ HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb, BOOL *set_
TRACE
(
"texture %p, srgb %#x, set_surface_desc %p.
\n
"
,
texture
,
srgb
,
set_surface_desc
);
texture
->
baseTexture
.
is_srgb
=
srgb
;
/* SRGB mode cache for PreLoad calls outside drawprim */
if
(
srgb
)
gl_tex
=
&
texture
->
baseTexture
.
texture_srgb
;
else
gl_tex
=
&
texture
->
baseTexture
.
texture_rgb
;
gl_tex
=
basetexture_get_gl_texture
(
texture
,
srgb
);
textureDimensions
=
texture
->
baseTexture
.
target
;
...
...
@@ -377,10 +374,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
TRACE
(
"texture %p, samplerStates %p
\n
"
,
texture
,
samplerStates
);
if
(
texture
->
baseTexture
.
is_srgb
)
gl_tex
=
&
texture
->
baseTexture
.
texture_srgb
;
else
gl_tex
=
&
texture
->
baseTexture
.
texture_rgb
;
gl_tex
=
basetexture_get_gl_texture
(
texture
,
texture
->
baseTexture
.
is_srgb
);
/* This function relies on the correct texture being bound and loaded. */
...
...
dlls/wined3d/context.c
View file @
09c3537a
...
...
@@ -117,7 +117,7 @@ static void context_apply_attachment_filter_states(IWineD3DSurfaceImpl *surface,
/* Update base texture states array */
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
_impl
=
surface
->
container
.
u
.
texture
;
IWineD3DBaseTextureImpl
*
texture
=
surface
->
container
.
u
.
texture
;
IWineD3DDeviceImpl
*
device
=
surface
->
resource
.
device
;
BOOL
update_minfilter
=
FALSE
;
BOOL
update_magfilter
=
FALSE
;
...
...
@@ -126,16 +126,13 @@ static void context_apply_attachment_filter_states(IWineD3DSurfaceImpl *surface,
switch
(
location
)
{
case
SFLAG_INTEXTURE
:
gl_tex
=
&
texture_impl
->
baseTexture
.
texture_rgb
;
break
;
case
SFLAG_INSRGBTEX
:
gl_tex
=
&
texture_impl
->
baseTexture
.
texture_srgb
;
gl_tex
=
basetexture_get_gl_texture
(
texture
,
location
==
SFLAG_INSRGBTEX
)
;
break
;
default:
ERR
(
"Unsupported location %s (%#x).
\n
"
,
debug_surflocation
(
location
),
location
);
IWineD3DBaseTexture_Release
((
IWineD3DBaseTexture
*
)
texture
_impl
);
IWineD3DBaseTexture_Release
((
IWineD3DBaseTexture
*
)
texture
);
return
;
}
...
...
@@ -153,10 +150,10 @@ static void context_apply_attachment_filter_states(IWineD3DSurfaceImpl *surface,
update_magfilter
=
TRUE
;
}
if
(
texture
_impl
->
baseTexture
.
bindCount
)
if
(
texture
->
baseTexture
.
bindCount
)
{
WARN
(
"Render targets should not be bound to a sampler
\n
"
);
IWineD3DDeviceImpl_MarkStateDirty
(
device
,
STATE_SAMPLER
(
texture
_impl
->
baseTexture
.
sampler
));
IWineD3DDeviceImpl_MarkStateDirty
(
device
,
STATE_SAMPLER
(
texture
->
baseTexture
.
sampler
));
}
if
(
update_minfilter
||
update_magfilter
)
...
...
dlls/wined3d/cubetexture.c
View file @
09c3537a
...
...
@@ -61,8 +61,8 @@ static void cubetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSR
UINT
sub_count
=
texture
->
baseTexture
.
level_count
*
texture
->
baseTexture
.
layer_count
;
IWineD3DDeviceImpl
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
=
NULL
;
struct
gl_texture
*
gl_tex
;
BOOL
srgb_mode
;
BOOL
*
dirty
;
UINT
i
;
TRACE
(
"texture %p, srgb %#x.
\n
"
,
texture
,
srgb
);
...
...
@@ -85,7 +85,8 @@ static void cubetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSR
srgb_mode
=
texture
->
baseTexture
.
is_srgb
;
break
;
}
dirty
=
srgb_mode
?
&
texture
->
baseTexture
.
texture_srgb
.
dirty
:
&
texture
->
baseTexture
.
texture_rgb
.
dirty
;
gl_tex
=
basetexture_get_gl_texture
(
texture
,
srgb_mode
);
/* We only have to activate a context for gl when we're not drawing.
* In most cases PreLoad will be called during draw and a context was
...
...
@@ -118,7 +119,7 @@ static void cubetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSR
/* If the texture is marked dirty or the srgb sampler setting has changed
* since the last load then reload the surfaces. */
if
(
*
dirty
)
if
(
gl_tex
->
dirty
)
{
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
...
...
@@ -131,7 +132,7 @@ static void cubetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSR
}
/* No longer dirty. */
*
dirty
=
FALSE
;
gl_tex
->
dirty
=
FALSE
;
if
(
context
)
context_release
(
context
);
}
...
...
dlls/wined3d/texture.c
View file @
09c3537a
...
...
@@ -90,9 +90,9 @@ static void texture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB s
{
IWineD3DDeviceImpl
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
=
NULL
;
struct
gl_texture
*
gl_tex
;
unsigned
int
i
;
BOOL
srgb_mode
;
BOOL
*
dirty
;
TRACE
(
"texture %p, srgb %#x.
\n
"
,
texture
,
srgb
);
...
...
@@ -114,7 +114,8 @@ static void texture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB s
srgb_mode
=
texture
->
baseTexture
.
is_srgb
;
break
;
}
dirty
=
srgb_mode
?
&
texture
->
baseTexture
.
texture_srgb
.
dirty
:
&
texture
->
baseTexture
.
texture_rgb
.
dirty
;
gl_tex
=
basetexture_get_gl_texture
(
texture
,
srgb_mode
);
if
(
!
device
->
isInDraw
)
{
...
...
@@ -142,7 +143,7 @@ static void texture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB s
/* If the texture is marked dirty or the srgb sampler setting has changed
* since the last load then reload the surfaces. */
if
(
*
dirty
)
if
(
gl_tex
->
dirty
)
{
for
(
i
=
0
;
i
<
texture
->
baseTexture
.
level_count
;
++
i
)
{
...
...
@@ -157,7 +158,7 @@ static void texture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB s
if
(
context
)
context_release
(
context
);
/* No longer dirty. */
*
dirty
=
FALSE
;
gl_tex
->
dirty
=
FALSE
;
}
/* Do not call while under the GL lock. */
...
...
dlls/wined3d/wined3d_private.h
View file @
09c3537a
...
...
@@ -1908,6 +1908,11 @@ static inline IWineD3DBaseTextureImpl *basetexture_from_resource(struct wined3d_
return
CONTAINING_RECORD
(
resource
,
IWineD3DBaseTextureImpl
,
resource
);
}
static
inline
struct
gl_texture
*
basetexture_get_gl_texture
(
IWineD3DBaseTextureImpl
*
texture
,
BOOL
srgb
)
{
return
srgb
?
&
texture
->
baseTexture
.
texture_srgb
:
&
texture
->
baseTexture
.
texture_rgb
;
}
void
basetexture_apply_state_changes
(
IWineD3DBaseTextureImpl
*
texture
,
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
struct
wined3d_gl_info
*
gl_info
)
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