Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
6b90248a
Commit
6b90248a
authored
Nov 21, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge texture2d_bind() and texture3d_bind() into wined3d_texture_bind().
parent
cfe12f96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
70 deletions
+30
-70
state.c
dlls/wined3d/state.c
+1
-1
surface.c
dlls/wined3d/surface.c
+1
-4
texture.c
dlls/wined3d/texture.c
+25
-61
volume.c
dlls/wined3d/volume.c
+1
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/state.c
View file @
6b90248a
...
...
@@ -3644,7 +3644,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
struct
wined3d_texture
*
texture
=
state
->
textures
[
sampler
];
BOOL
srgb
=
state
->
sampler_states
[
sampler
][
WINED3D_SAMP_SRGB_TEXTURE
];
texture
->
texture_ops
->
texture_bind
(
texture
,
context
,
srgb
);
wined3d_
texture_bind
(
texture
,
context
,
srgb
);
wined3d_texture_apply_state_changes
(
texture
,
state
->
sampler_states
[
sampler
],
gl_info
);
if
(
gl_info
->
supported
[
EXT_TEXTURE_LOD_BIAS
])
...
...
dlls/wined3d/surface.c
View file @
6b90248a
...
...
@@ -597,12 +597,9 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
/* Context activation is done by the caller. */
static
void
surface_bind
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
struct
wined3d_texture
*
texture
=
surface
->
container
;
TRACE
(
"surface %p, context %p, srgb %#x.
\n
"
,
surface
,
context
,
srgb
);
TRACE
(
"Passing to container (%p).
\n
"
,
texture
);
texture
->
texture_ops
->
texture_bind
(
texture
,
context
,
srgb
);
wined3d_texture_bind
(
surface
->
container
,
context
,
srgb
);
}
/* Context activation is done by the caller. */
...
...
dlls/wined3d/texture.c
View file @
6b90248a
...
...
@@ -143,15 +143,15 @@ void wined3d_texture_set_dirty(struct wined3d_texture *texture)
}
/* Context activation is done by the caller. */
static
void
wined3d_texture_bind
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
void
wined3d_texture_bind
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
gl_texture
*
gl_tex
;
BOOL
new_texture
=
FALSE
;
GLenum
target
;
TRACE
(
"texture %p, context %p, srgb %#x
, set_surface_desc %p.
\n
"
,
texture
,
context
,
srgb
,
set_surface_desc
);
TRACE
(
"texture %p, context %p, srgb %#x
.
\n
"
,
texture
,
context
,
srgb
);
if
(
gl_info
->
supported
[
EXT_TEXTURE_SRGB_DECODE
])
srgb
=
FALSE
;
...
...
@@ -168,7 +168,6 @@ static void wined3d_texture_bind(struct wined3d_texture *texture,
/* Generate a texture name if we don't already have one. */
if
(
!
gl_tex
->
name
)
{
*
set_surface_desc
=
TRUE
;
gl_info
->
gl_ops
.
gl
.
p_glGenTextures
(
1
,
&
gl_tex
->
name
);
checkGLcall
(
"glGenTextures"
);
TRACE
(
"Generated texture %d.
\n
"
,
gl_tex
->
name
);
...
...
@@ -214,10 +213,6 @@ static void wined3d_texture_bind(struct wined3d_texture *texture,
checkGLcall
(
"glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE)"
);
}
}
else
{
*
set_surface_desc
=
FALSE
;
}
context_bind_texture
(
context
,
target
,
gl_tex
->
name
);
if
(
new_texture
)
...
...
@@ -241,6 +236,28 @@ static void wined3d_texture_bind(struct wined3d_texture *texture,
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_R
,
GL_CLAMP_TO_EDGE
);
}
if
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
)
{
/* Conditinal non power of two textures use a different clamping
* default. If we're using the GL_WINE_normalized_texrect partial
* driver emulation, we're dealing with a GL_TEXTURE_2D texture which
* has the address mode set to repeat - something that prevents us
* from hitting the accelerated codepath. Thus manually set the GL
* state. The same applies to filtering. Even if the texture has only
* one mip level, the default LINEAR_MIPMAP_LINEAR filter causes a SW
* fallback on macos. */
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
checkGLcall
(
"glTexParameteri"
);
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
]
=
WINED3D_TADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
]
=
WINED3D_TADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3D_TEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3D_TEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3D_TEXF_NONE
;
}
}
}
...
...
@@ -596,46 +613,6 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
return
WINED3D_OK
;
}
/* Context activation is done by the caller. */
static
void
texture2d_bind
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
BOOL
set_gl_texture_desc
;
TRACE
(
"texture %p, context %p, srgb %#x.
\n
"
,
texture
,
context
,
srgb
);
wined3d_texture_bind
(
texture
,
context
,
srgb
,
&
set_gl_texture_desc
);
if
(
set_gl_texture_desc
&&
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
))
{
struct
gl_texture
*
gl_tex
=
wined3d_texture_get_gl_texture
(
texture
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
GLenum
target
=
texture
->
target
;
/* Conditinal non power of two textures use a different clamping
* default. If we're using the GL_WINE_normalized_texrect partial
* driver emulation, we're dealing with a GL_TEXTURE_2D texture which
* has the address mode set to repeat - something that prevents us
* from hitting the accelerated codepath. Thus manually set the GL
* state. The same applies to filtering. Even if the texture has only
* one mip level, the default LINEAR_MIPMAP_LINEAR filter causes a SW
* fallback on macos. */
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
checkGLcall
(
"glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)"
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
checkGLcall
(
"glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)"
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
checkGLcall
(
"glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST)"
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
checkGLcall
(
"glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST)"
);
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
]
=
WINED3D_TADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
]
=
WINED3D_TADDRESS_CLAMP
;
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3D_TEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3D_TEXF_POINT
;
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3D_TEXF_NONE
;
}
}
static
BOOL
texture_srgb_mode
(
const
struct
wined3d_texture
*
texture
,
enum
WINED3DSRGB
srgb
)
{
switch
(
srgb
)
...
...
@@ -721,7 +698,6 @@ static void texture2d_unload(struct wined3d_resource *resource)
static
const
struct
wined3d_texture_ops
texture2d_ops
=
{
texture2d_bind
,
texture2d_preload
,
texture2d_sub_resource_add_dirty_region
,
texture2d_sub_resource_cleanup
,
...
...
@@ -1005,17 +981,6 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
}
/* Context activation is done by the caller. */
static
void
texture3d_bind
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
BOOL
dummy
;
TRACE
(
"texture %p, context %p, srgb %#x.
\n
"
,
texture
,
context
,
srgb
);
wined3d_texture_bind
(
texture
,
context
,
srgb
,
&
dummy
);
}
/* Context activation is done by the caller. */
static
void
texture3d_preload
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
enum
WINED3DSRGB
srgb
)
{
...
...
@@ -1082,7 +1047,6 @@ static void texture3d_unload(struct wined3d_resource *resource)
static
const
struct
wined3d_texture_ops
texture3d_ops
=
{
texture3d_bind
,
texture3d_preload
,
texture3d_sub_resource_add_dirty_region
,
texture3d_sub_resource_cleanup
,
...
...
dlls/wined3d/volume.c
View file @
6b90248a
...
...
@@ -31,7 +31,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
static
void
volume_bind_and_dirtify
(
const
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
struct
wined3d_texture
*
container
=
volume
->
container
;
DWORD
active_sampler
;
/* We don't need a specific texture unit, but after binding the texture the current unit is dirty.
...
...
@@ -47,7 +46,7 @@ static void volume_bind_and_dirtify(const struct wined3d_volume *volume,
if
(
active_sampler
!=
WINED3D_UNMAPPED_STAGE
)
context_invalidate_state
(
context
,
STATE_SAMPLER
(
active_sampler
));
container
->
texture_ops
->
texture_bind
(
container
,
context
,
srgb
);
wined3d_texture_bind
(
volume
->
container
,
context
,
srgb
);
}
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
...
...
dlls/wined3d/wined3d_private.h
View file @
6b90248a
...
...
@@ -2058,8 +2058,6 @@ struct gl_texture
struct
wined3d_texture_ops
{
void
(
*
texture_bind
)(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
);
void
(
*
texture_preload
)(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
enum
WINED3DSRGB
srgb
);
void
(
*
texture_sub_resource_add_dirty_region
)(
struct
wined3d_resource
*
sub_resource
,
...
...
@@ -2105,6 +2103,8 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t
void
wined3d_texture_apply_state_changes
(
struct
wined3d_texture
*
texture
,
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_bind
(
struct
wined3d_texture
*
texture
,
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