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
19e66a0d
Commit
19e66a0d
authored
Mar 28, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Replace "is_srgb" in wined3d_texture with a flag.
parent
0e22aea0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
texture.c
dlls/wined3d/texture.c
+25
-11
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/texture.c
View file @
19e66a0d
...
...
@@ -57,7 +57,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture
->
lod
=
0
;
texture
->
texture_rgb
.
dirty
=
TRUE
;
texture
->
texture_srgb
.
dirty
=
TRUE
;
texture
->
is_srgb
=
FALSE
;
texture
->
flags
=
WINED3D_TEXTURE_POW2_MAT_IDENT
;
if
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_FILTERING
)
...
...
@@ -143,7 +142,12 @@ static HRESULT wined3d_texture_bind(struct wined3d_texture *texture,
TRACE
(
"texture %p, srgb %#x, set_surface_desc %p.
\n
"
,
texture
,
srgb
,
set_surface_desc
);
texture
->
is_srgb
=
srgb
;
/* sRGB mode cache for preload() calls outside drawprim. */
/* sRGB mode cache for preload() calls outside drawprim. */
if
(
srgb
)
texture
->
flags
|=
WINED3D_TEXTURE_IS_SRGB
;
else
texture
->
flags
&=
~
WINED3D_TEXTURE_IS_SRGB
;
gl_tex
=
wined3d_texture_get_gl_texture
(
texture
,
gl_info
,
srgb
);
target
=
texture
->
target
;
...
...
@@ -270,7 +274,8 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
TRACE
(
"texture %p, sampler_states %p.
\n
"
,
texture
,
sampler_states
);
gl_tex
=
wined3d_texture_get_gl_texture
(
texture
,
gl_info
,
texture
->
is_srgb
);
gl_tex
=
wined3d_texture_get_gl_texture
(
texture
,
gl_info
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
/* This function relies on the correct texture being bound and loaded. */
...
...
@@ -646,7 +651,8 @@ static HRESULT texture2d_bind(struct wined3d_texture *texture,
if
(
set_gl_texture_desc
&&
SUCCEEDED
(
hr
))
{
UINT
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
BOOL
srgb_tex
=
!
gl_info
->
supported
[
EXT_TEXTURE_SRGB_DECODE
]
&&
texture
->
is_srgb
;
BOOL
srgb_tex
=
!
gl_info
->
supported
[
EXT_TEXTURE_SRGB_DECODE
]
&&
(
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
struct
gl_texture
*
gl_tex
;
UINT
i
;
...
...
@@ -718,7 +724,7 @@ static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
break
;
default:
srgb_mode
=
texture
->
is_srgb
;
srgb_mode
=
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
;
break
;
}
...
...
@@ -1115,7 +1121,6 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{
IWineD3DDeviceImpl
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
=
NULL
;
BOOL
srgb_mode
=
texture
->
is_srgb
;
BOOL
srgb_was_toggled
=
FALSE
;
unsigned
int
i
;
...
...
@@ -1125,9 +1130,17 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
context
=
context_acquire
(
device
,
NULL
);
else
if
(
texture
->
bind_count
>
0
)
{
srgb_mode
=
device
->
stateBlock
->
state
.
sampler_states
[
texture
->
sampler
][
WINED3DSAMP_SRGBTEXTURE
];
srgb_was_toggled
=
texture
->
is_srgb
!=
srgb_mode
;
texture
->
is_srgb
=
srgb_mode
;
BOOL
texture_srgb
=
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
;
BOOL
sampler_srgb
=
device
->
stateBlock
->
state
.
sampler_states
[
texture
->
sampler
][
WINED3DSAMP_SRGBTEXTURE
];
srgb_was_toggled
=
!
texture_srgb
!=
!
sampler_srgb
;
if
(
srgb_was_toggled
)
{
if
(
sampler_srgb
)
texture
->
flags
|=
WINED3D_TEXTURE_IS_SRGB
;
else
texture
->
flags
&=
~
WINED3D_TEXTURE_IS_SRGB
;
}
}
/* If the texture is marked dirty or the sRGB sampler setting has changed
...
...
@@ -1136,7 +1149,8 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
)
{
volume_load
(
volume_from_resource
(
texture
->
sub_resources
[
i
]),
i
,
srgb_mode
);
volume_load
(
volume_from_resource
(
texture
->
sub_resources
[
i
]),
i
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
}
}
else
if
(
srgb_was_toggled
)
...
...
@@ -1145,7 +1159,7 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{
IWineD3DVolumeImpl
*
volume
=
volume_from_resource
(
texture
->
sub_resources
[
i
]);
volume_add_dirty_box
(
volume
,
NULL
);
volume_load
(
volume
,
i
,
srgb_mode
);
volume_load
(
volume
,
i
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
}
}
else
...
...
dlls/wined3d/wined3d_private.h
View file @
19e66a0d
...
...
@@ -1890,6 +1890,7 @@ struct wined3d_texture_ops
#define WINED3D_TEXTURE_COND_NP2 0x1
#define WINED3D_TEXTURE_POW2_MAT_IDENT 0x2
#define WINED3D_TEXTURE_IS_SRGB 0x4
struct
wined3d_texture
{
...
...
@@ -1904,7 +1905,6 @@ struct wined3d_texture
WINED3DTEXTUREFILTERTYPE
filter_type
;
LONG
bind_count
;
DWORD
sampler
;
BOOL
is_srgb
;
DWORD
flags
;
const
struct
min_lookup
*
min_mip_lookup
;
const
GLenum
*
mag_lookup
;
...
...
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