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
eb5bfad1
Commit
eb5bfad1
authored
Mar 18, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the IWineD3DBaseTexture typedefs.
parent
fd8e18bd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
80 additions
and
87 deletions
+80
-87
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+2
-2
context.c
dlls/wined3d/context.c
+1
-1
device.c
dlls/wined3d/device.c
+44
-48
glsl_shader.c
dlls/wined3d/glsl_shader.c
+5
-5
shader.c
dlls/wined3d/shader.c
+2
-2
state.c
dlls/wined3d/state.c
+4
-4
stateblock.c
dlls/wined3d/stateblock.c
+1
-1
surface.c
dlls/wined3d/surface.c
+4
-4
utils.c
dlls/wined3d/utils.c
+7
-4
volume.c
dlls/wined3d/volume.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+9
-15
No files found.
dlls/wined3d/arb_program_shader.c
View file @
eb5bfad1
...
...
@@ -492,7 +492,7 @@ static void shader_arb_load_np2fixup_constants(void *shader_priv,
for
(
i
=
0
;
active
;
active
>>=
1
,
++
i
)
{
const
IWineD3DBaseTextureImpl
*
tex
=
state
->
textures
[
i
];
const
struct
wined3d_texture
*
tex
=
state
->
textures
[
i
];
const
unsigned
char
idx
=
fixup
->
super
.
idx
[
i
];
GLfloat
*
tex_dim
=
&
np2fixup_constants
[(
idx
>>
1
)
*
4
];
...
...
@@ -1325,7 +1325,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
{
struct
wined3d_shader_buffer
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
const
char
*
tex_type
;
BOOL
np2_fixup
=
FALSE
;
struct
IWineD3DBaseShaderImpl
*
shader
=
ins
->
ctx
->
shader
;
...
...
dlls/wined3d/context.c
View file @
eb5bfad1
...
...
@@ -118,7 +118,7 @@ static void context_apply_attachment_filter_states(const struct wined3d_context
/* Update base texture states array */
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
=
surface
->
container
.
u
.
texture
;
struct
wined3d_texture
*
texture
=
surface
->
container
.
u
.
texture
;
IWineD3DDeviceImpl
*
device
=
surface
->
resource
.
device
;
BOOL
update_minfilter
=
FALSE
;
BOOL
update_magfilter
=
FALSE
;
...
...
dlls/wined3d/device.c
View file @
eb5bfad1
This diff is collapsed.
Click to expand it.
dlls/wined3d/glsl_shader.c
View file @
eb5bfad1
...
...
@@ -701,7 +701,7 @@ static void shader_glsl_load_np2fixup_constants(void *shader_priv,
for
(
i
=
0
;
fixup
;
fixup
>>=
1
,
++
i
)
{
const
IWineD3DBaseTextureImpl
*
tex
=
state
->
textures
[
i
];
const
struct
wined3d_texture
*
tex
=
state
->
textures
[
i
];
const
unsigned
char
idx
=
prog
->
np2Fixup_info
->
idx
[
i
];
GLfloat
*
tex_dim
=
&
np2fixup_constants
[(
idx
>>
1
)
*
4
];
...
...
@@ -1051,7 +1051,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
{
if
(
reg_maps
->
sampler_type
[
i
])
{
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
switch
(
reg_maps
->
sampler_type
[
i
])
{
...
...
@@ -3029,7 +3029,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
DWORD
shader_version
=
WINED3D_SHADER_VERSION
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
,
ins
->
ctx
->
reg_maps
->
shader_version
.
minor
);
glsl_sample_function_t
sample_function
;
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
DWORD
sample_flags
=
0
;
DWORD
sampler_idx
;
DWORD
mask
=
0
,
swizzle
;
...
...
@@ -3122,7 +3122,7 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
DWORD
sample_flags
=
WINED3D_GLSL_SAMPLE_GRAD
;
DWORD
sampler_idx
;
DWORD
swizzle
=
ins
->
src
[
1
].
swizzle
;
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
if
(
!
gl_info
->
supported
[
ARB_SHADER_TEXTURE_LOD
]
&&
!
gl_info
->
supported
[
EXT_GPU_SHADER4
])
{
...
...
@@ -3155,7 +3155,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
DWORD
sample_flags
=
WINED3D_GLSL_SAMPLE_LOD
;
DWORD
sampler_idx
;
DWORD
swizzle
=
ins
->
src
[
1
].
swizzle
;
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
sampler_idx
=
ins
->
src
[
1
].
reg
.
idx
;
texture
=
device
->
stateBlock
->
state
.
textures
[
sampler_idx
];
...
...
dlls/wined3d/shader.c
View file @
eb5bfad1
...
...
@@ -2063,7 +2063,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
IWineD3DPixelShaderImpl
*
shader
,
struct
ps_compile_args
*
args
)
{
IWineD3DDeviceImpl
*
device
=
shader
->
baseShader
.
device
;
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
UINT
i
;
memset
(
args
,
0
,
sizeof
(
*
args
));
/* FIXME: Make sure all bits are set. */
...
...
@@ -2313,7 +2313,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
return
WINED3D_OK
;
}
void
pixelshader_update_samplers
(
struct
wined3d_shader_reg_maps
*
reg_maps
,
IWineD3DBaseTextureImpl
*
const
*
textures
)
void
pixelshader_update_samplers
(
struct
wined3d_shader_reg_maps
*
reg_maps
,
struct
wined3d_texture
*
const
*
textures
)
{
WINED3DSAMPLER_TEXTURE_TYPE
*
sampler_type
=
reg_maps
->
sampler_type
;
unsigned
int
i
;
...
...
dlls/wined3d/state.c
View file @
eb5bfad1
...
...
@@ -498,7 +498,7 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
*/
if
(
stateblock
->
state
.
textures
[
0
])
{
IWineD3DBaseTextureImpl
*
texture
=
stateblock
->
state
.
textures
[
0
];
struct
wined3d_texture
*
texture
=
stateblock
->
state
.
textures
[
0
];
GLenum
texture_dimensions
=
texture
->
baseTexture
.
target
;
if
(
texture_dimensions
==
GL_TEXTURE_2D
||
texture_dimensions
==
GL_TEXTURE_RECTANGLE_ARB
)
...
...
@@ -3191,7 +3191,7 @@ void tex_alphaop(DWORD state, struct wined3d_stateblock *stateblock, struct wine
if
(
stateblock
->
state
.
render_states
[
WINED3DRS_COLORKEYENABLE
]
&&
!
stage
&&
stateblock
->
state
.
textures
[
0
])
{
IWineD3DBaseTextureImpl
*
texture
=
stateblock
->
state
.
textures
[
0
];
struct
wined3d_texture
*
texture
=
stateblock
->
state
.
textures
[
0
];
GLenum
texture_dimensions
=
texture
->
baseTexture
.
target
;
if
(
texture_dimensions
==
GL_TEXTURE_2D
||
texture_dimensions
==
GL_TEXTURE_RECTANGLE_ARB
)
...
...
@@ -3586,7 +3586,7 @@ static void tex_bumpenvlscale(DWORD state, struct wined3d_stateblock *stateblock
static
void
sampler_texmatrix
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
DWORD
sampler
=
state
-
STATE_SAMPLER
(
0
);
IWineD3DBaseTextureImpl
*
texture
=
stateblock
->
state
.
textures
[
sampler
];
struct
wined3d_texture
*
texture
=
stateblock
->
state
.
textures
[
sampler
];
TRACE
(
"state %#x, stateblock %p, context %p
\n
"
,
state
,
stateblock
,
context
);
...
...
@@ -3643,7 +3643,7 @@ static void sampler(DWORD state_id, struct wined3d_stateblock *stateblock, struc
if
(
state
->
textures
[
sampler
])
{
IWineD3DBaseTextureImpl
*
texture
=
state
->
textures
[
sampler
];
struct
wined3d_texture
*
texture
=
state
->
textures
[
sampler
];
BOOL
srgb
=
state
->
sampler_states
[
sampler
][
WINED3DSAMP_SRGBTEXTURE
];
texture
->
baseTexture
.
texture_ops
->
texture_bind
(
texture
,
gl_info
,
srgb
);
...
...
dlls/wined3d/stateblock.c
View file @
eb5bfad1
...
...
@@ -1033,7 +1033,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
if
(
!
(
map
&
1
))
continue
;
stage
=
i
<
MAX_FRAGMENT_SAMPLERS
?
i
:
WINED3DVERTEXTEXTURESAMPLER0
+
i
-
MAX_FRAGMENT_SAMPLERS
;
IWineD3DDevice_SetTexture
(
device
,
stage
,
(
IWineD3DBaseTexture
*
)
stateblock
->
state
.
textures
[
i
]);
IWineD3DDevice_SetTexture
(
device
,
stage
,
stateblock
->
state
.
textures
[
i
]);
}
map
=
stateblock
->
changed
.
clipplane
;
...
...
dlls/wined3d/surface.c
View file @
eb5bfad1
...
...
@@ -326,7 +326,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
* container about this to get the filters reset properly next draw. */
if
(
src_surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
=
src_surface
->
container
.
u
.
texture
;
struct
wined3d_texture
*
texture
=
src_surface
->
container
.
u
.
texture
;
texture
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MAGFILTER
]
=
WINED3DTEXF_POINT
;
texture
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MINFILTER
]
=
WINED3DTEXF_POINT
;
texture
->
baseTexture
.
texture_rgb
.
states
[
WINED3DTEXSTA_MIPFILTER
]
=
WINED3DTEXF_NONE
;
...
...
@@ -697,7 +697,7 @@ void surface_bind(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
=
surface
->
container
.
u
.
texture
;
struct
wined3d_texture
*
texture
=
surface
->
container
.
u
.
texture
;
TRACE
(
"Passing to container (%p).
\n
"
,
texture
);
texture
->
baseTexture
.
texture_ops
->
texture_bind
(
texture
,
gl_info
,
srgb
);
...
...
@@ -1362,7 +1362,7 @@ void surface_internal_preload(IWineD3DSurfaceImpl *surface, enum WINED3DSRGB srg
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
=
surface
->
container
.
u
.
texture
;
struct
wined3d_texture
*
texture
=
surface
->
container
.
u
.
texture
;
TRACE
(
"Passing to container (%p).
\n
"
,
texture
);
texture
->
baseTexture
.
texture_ops
->
texture_preload
(
texture
,
srgb
);
...
...
@@ -1751,7 +1751,7 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_
{
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
{
IWineD3DBaseTextureImpl
*
texture
=
surface
->
container
.
u
.
texture
;
struct
wined3d_texture
*
texture
=
surface
->
container
.
u
.
texture
;
UINT
sub_count
=
texture
->
baseTexture
.
level_count
*
texture
->
baseTexture
.
layer_count
;
UINT
i
;
...
...
dlls/wined3d/utils.c
View file @
eb5bfad1
...
...
@@ -2777,7 +2777,8 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
for
(
i
=
0
;
i
<
gl_info
->
limits
.
texture_stages
;
++
i
)
{
IWineD3DBaseTextureImpl
*
texture
;
const
struct
wined3d_texture
*
texture
;
settings
->
op
[
i
].
padding
=
0
;
if
(
stateblock
->
state
.
texture_states
[
i
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_DISABLE
)
{
...
...
@@ -2859,8 +2860,10 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
if
(
!
i
&&
stateblock
->
state
.
textures
[
0
]
&&
stateblock
->
state
.
render_states
[
WINED3DRS_COLORKEYENABLE
])
{
IWineD3DBaseTextureImpl
*
texture
=
stateblock
->
state
.
textures
[
0
];
GLenum
texture_dimensions
=
texture
->
baseTexture
.
target
;
GLenum
texture_dimensions
;
texture
=
stateblock
->
state
.
textures
[
0
];
texture_dimensions
=
texture
->
baseTexture
.
target
;
if
(
texture_dimensions
==
GL_TEXTURE_2D
||
texture_dimensions
==
GL_TEXTURE_RECTANGLE_ARB
)
{
...
...
@@ -3025,7 +3028,7 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
* Requires the caller to activate the correct unit before
*/
/* GL locking is done by the caller (state handler) */
void
texture_activate_dimensions
(
IWineD3DBaseTextureImpl
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
void
texture_activate_dimensions
(
const
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
{
if
(
texture
)
{
...
...
dlls/wined3d/volume.c
View file @
eb5bfad1
...
...
@@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
/* Context activation is done by the caller. */
static
void
volume_bind_and_dirtify
(
struct
IWineD3DVolumeImpl
*
volume
,
const
struct
wined3d_gl_info
*
gl_info
)
{
IWineD3DBaseTextureImpl
*
container
=
(
IWineD3DBaseTextureImpl
*
)
volume
->
container
;
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.
...
...
dlls/wined3d/wined3d_private.h
View file @
eb5bfad1
...
...
@@ -55,8 +55,6 @@
typedef
struct
IWineD3DSurfaceImpl
IWineD3DSurfaceImpl
;
typedef
struct
IWineD3DDeviceImpl
IWineD3DDeviceImpl
;
typedef
struct
IWineD3DSwapChainImpl
IWineD3DSwapChainImpl
;
typedef
struct
wined3d_texture
IWineD3DBaseTextureImpl
;
typedef
struct
wined3d_texture
IWineD3DBaseTexture
;
struct
IWineD3DBaseShaderImpl
;
/* Texture format fixups */
...
...
@@ -1850,10 +1848,6 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
/*****************************************************************************
* IWineD3DBaseTexture D3D- > openGL state map lookups
*/
typedef
enum
winetexturestates
{
WINED3DTEXSTA_ADDRESSU
=
0
,
WINED3DTEXSTA_ADDRESSV
=
1
,
...
...
@@ -1922,7 +1916,7 @@ struct wined3d_texture
static
inline
struct
wined3d_texture
*
wined3d_texture_from_resource
(
struct
wined3d_resource
*
resource
)
{
return
CONTAINING_RECORD
(
resource
,
IWineD3DBaseTextureImpl
,
resource
);
return
CONTAINING_RECORD
(
resource
,
struct
wined3d_texture
,
resource
);
}
static
inline
struct
gl_texture
*
wined3d_texture_get_gl_texture
(
struct
wined3d_texture
*
texture
,
...
...
@@ -1933,20 +1927,20 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t
:
&
texture
->
baseTexture
.
texture_rgb
;
}
void
wined3d_texture_apply_state_changes
(
IWineD3DBaseTextureImpl
*
texture
,
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_set_dirty
(
IWineD3DBaseTextureImpl
*
texture
,
BOOL
dirty
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_dirty
(
struct
wined3d_texture
*
texture
,
BOOL
dirty
)
DECLSPEC_HIDDEN
;
HRESULT
cubetexture_init
(
IWineD3DBaseTextureImpl
*
texture
,
UINT
edge_length
,
UINT
levels
,
HRESULT
cubetexture_init
(
struct
wined3d_texture
*
texture
,
UINT
edge_length
,
UINT
levels
,
IWineD3DDeviceImpl
*
device
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
HRESULT
texture_init
(
IWineD3DBaseTextureImpl
*
texture
,
UINT
width
,
UINT
height
,
UINT
levels
,
HRESULT
texture_init
(
struct
wined3d_texture
*
texture
,
UINT
width
,
UINT
height
,
UINT
levels
,
IWineD3DDeviceImpl
*
device
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
HRESULT
volumetexture_init
(
IWineD3DBaseTextureImpl
*
texture
,
UINT
width
,
UINT
height
,
HRESULT
volumetexture_init
(
struct
wined3d_texture
*
texture
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
IWineD3DDeviceImpl
*
device
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
...
...
@@ -2356,7 +2350,7 @@ struct wined3d_state
INT
ps_consts_i
[
MAX_CONST_I
*
4
];
float
*
ps_consts_f
;
IWineD3DBaseTextureImpl
*
textures
[
MAX_COMBINED_SAMPLERS
];
struct
wined3d_texture
*
textures
[
MAX_COMBINED_SAMPLERS
];
DWORD
sampler_states
[
MAX_COMBINED_SAMPLERS
][
WINED3D_HIGHEST_SAMPLER_STATE
+
1
];
DWORD
texture_states
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
DWORD
lowest_disabled_stage
;
...
...
@@ -2632,7 +2626,7 @@ void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d
INT
texture_idx
,
DWORD
dst
)
DECLSPEC_HIDDEN
;
void
set_texture_matrix
(
const
float
*
smat
,
DWORD
flags
,
BOOL
calculatedCoords
,
BOOL
transformed
,
enum
wined3d_format_id
coordtype
,
BOOL
ffp_can_disable_proj
)
DECLSPEC_HIDDEN
;
void
texture_activate_dimensions
(
IWineD3DBaseTextureImpl
*
texture
,
void
texture_activate_dimensions
(
const
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
void
sampler_texdim
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
...
...
@@ -2897,7 +2891,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
const
DWORD
*
byte_code
,
const
struct
wined3d_shader_signature
*
output_signature
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
void
pixelshader_update_samplers
(
struct
wined3d_shader_reg_maps
*
reg_maps
,
IWineD3DBaseTextureImpl
*
const
*
textures
)
DECLSPEC_HIDDEN
;
struct
wined3d_texture
*
const
*
textures
)
DECLSPEC_HIDDEN
;
void
find_ps_compile_args
(
const
struct
wined3d_state
*
state
,
IWineD3DPixelShaderImpl
*
shader
,
struct
ps_compile_args
*
args
)
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