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
f6b5dc24
Commit
f6b5dc24
authored
Nov 22, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DSRGB enum.
parent
7427b722
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
41 deletions
+16
-41
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
context.c
dlls/wined3d/context.c
+4
-6
device.c
dlls/wined3d/device.c
+1
-1
surface.c
dlls/wined3d/surface.c
+4
-4
texture.c
dlls/wined3d/texture.c
+5
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-8
No files found.
dlls/wined3d/arb_program_shader.c
View file @
f6b5dc24
...
...
@@ -7469,7 +7469,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
src_rect
.
bottom
=
src_surface
->
resource
.
height
-
src_rect
.
bottom
;
}
else
wined3d_texture_load
(
src_surface
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
src_surface
->
container
,
context
,
FALSE
);
context_apply_blit_state
(
context
,
device
);
...
...
dlls/wined3d/context.c
View file @
f6b5dc24
...
...
@@ -2124,7 +2124,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
if
(
context
->
render_offscreen
)
{
wined3d_texture_load
(
rt
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
rt
->
container
,
context
,
FALSE
);
context_apply_fbo_state_blit
(
context
,
GL_FRAMEBUFFER
,
rt
,
NULL
,
rt
->
draw_binding
);
if
(
rt
->
resource
.
format
->
id
!=
WINED3DFMT_NULL
)
...
...
@@ -2791,13 +2791,11 @@ 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
;
wined3d_texture_load
(
texture
,
context
,
srgb
);
wined3d_texture_load
(
texture
,
context
,
state
->
sampler_states
[
idx
][
WINED3D_SAMP_SRGB_TEXTURE
]);
}
/* Context activation is done by the caller. */
...
...
@@ -2942,8 +2940,8 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
/* Read the back buffer of the old drawable into the destination texture. */
if
(
texture
->
texture_srgb
.
name
)
wined3d_texture_load
(
texture
,
context
,
SRGB_SRGB
);
wined3d_texture_load
(
texture
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
texture
,
context
,
TRUE
);
wined3d_texture_load
(
texture
,
context
,
FALSE
);
surface_invalidate_location
(
context
->
current_rt
,
SFLAG_INDRAWABLE
);
}
}
...
...
dlls/wined3d/device.c
View file @
f6b5dc24
...
...
@@ -3402,7 +3402,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
/* Make sure that the destination texture is loaded. */
context
=
context_acquire
(
device
,
NULL
);
wined3d_texture_load
(
dst_texture
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
dst_texture
,
context
,
FALSE
);
context_release
(
context
);
/* Update every surface level of the texture. */
...
...
dlls/wined3d/surface.c
View file @
f6b5dc24
...
...
@@ -4085,7 +4085,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
context
=
context_acquire
(
device
,
src_surface
);
gl_info
=
context
->
gl_info
;
context_apply_blit_state
(
context
,
device
);
wined3d_texture_load
(
dst_surface
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
dst_surface
->
container
,
context
,
FALSE
);
/* Bind the target texture */
context_bind_texture
(
context
,
dst_surface
->
container
->
target
,
dst_surface
->
container
->
texture_rgb
.
name
);
...
...
@@ -4193,14 +4193,14 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
context
=
context_acquire
(
device
,
src_surface
);
gl_info
=
context
->
gl_info
;
context_apply_blit_state
(
context
,
device
);
wined3d_texture_load
(
dst_surface
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
dst_surface
->
container
,
context
,
FALSE
);
src_offscreen
=
surface_is_offscreen
(
src_surface
);
noBackBufferBackup
=
src_offscreen
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
;
if
(
!
noBackBufferBackup
&&
!
src_surface
->
container
->
texture_rgb
.
name
)
{
/* Get it a description */
wined3d_texture_load
(
src_surface
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
src_surface
->
container
,
context
,
FALSE
);
}
/* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring.
...
...
@@ -4489,7 +4489,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
/* Make sure the surface is up-to-date. This should probably use
* surface_load_location() and worry about the destination surface too,
* unless we're overwriting it completely. */
wined3d_texture_load
(
src_surface
->
container
,
context
,
SRGB_RGB
);
wined3d_texture_load
(
src_surface
->
container
,
context
,
FALSE
);
/* Activate the destination context, set it up for blitting */
context_apply_blit_state
(
context
,
device
);
...
...
dlls/wined3d/texture.c
View file @
f6b5dc24
...
...
@@ -510,35 +510,19 @@ DWORD CDECL wined3d_texture_get_priority(const struct wined3d_texture *texture)
/* Context activation is done by the caller */
void
wined3d_texture_load
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
enum
WINED3DSRGB
srgb
)
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
UINT
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
BOOL
srgb_mode
;
DWORD
flag
;
UINT
i
;
TRACE
(
"texture %p, srgb %#x.
\n
"
,
texture
,
srgb
);
if
(
gl_info
->
supported
[
EXT_TEXTURE_SRGB_DECODE
])
srgb
=
SRGB_RGB
;
switch
(
srgb
)
{
case
SRGB_RGB
:
srgb_mode
=
FALSE
;
break
;
case
SRGB_SRGB
:
srgb_mode
=
TRUE
;
break
;
default:
srgb_mode
=
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
;
break
;
}
srgb
=
FALSE
;
if
(
srgb
_mode
)
if
(
srgb
)
flag
=
WINED3D_TEXTURE_SRGB_VALID
;
else
flag
=
WINED3D_TEXTURE_RGB_VALID
;
...
...
@@ -552,7 +536,7 @@ void wined3d_texture_load(struct wined3d_texture *texture,
/* Reload the surfaces if the texture is marked dirty. */
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
texture
->
texture_ops
->
texture_sub_resource_load
(
texture
->
sub_resources
[
i
],
context
,
srgb
_mode
);
texture
->
texture_ops
->
texture_sub_resource_load
(
texture
->
sub_resources
[
i
],
context
,
srgb
);
}
texture
->
flags
|=
flag
;
}
...
...
@@ -561,7 +545,7 @@ void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
texture
->
resource
.
device
,
NULL
);
wined3d_texture_load
(
texture
,
context
,
SRGB_ANY
);
wined3d_texture_load
(
texture
,
context
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
context_release
(
context
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
f6b5dc24
...
...
@@ -2043,13 +2043,6 @@ enum wined3d_texture_state
MAX_WINETEXTURESTATES
=
11
,
};
enum
WINED3DSRGB
{
SRGB_ANY
=
0
,
/* Uses the cached value(e.g. external calls) */
SRGB_RGB
=
1
,
/* Loads the rgb texture */
SRGB_SRGB
=
2
,
/* Loads the srgb texture */
};
struct
gl_texture
{
DWORD
states
[
MAX_WINETEXTURESTATES
];
...
...
@@ -2108,7 +2101,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
void
wined3d_texture_bind_and_dirtify
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_load
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
enum
WINED3DSRGB
srgb
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_dirty
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
#define WINED3D_VFLAG_ALLOCATED 0x00000001
...
...
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