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
08545dc7
Commit
08545dc7
authored
Jan 08, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DSAMPLERSTATETYPE typedef.
parent
f1e2c5df
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
130 additions
and
131 deletions
+130
-131
device.c
dlls/d3d8/device.c
+10
-10
device.c
dlls/ddraw/device.c
+22
-22
device.c
dlls/wined3d/device.c
+9
-9
state.c
dlls/wined3d/state.c
+2
-2
stateblock.c
dlls/wined3d/stateblock.c
+26
-26
texture.c
dlls/wined3d/texture.c
+27
-27
utils.c
dlls/wined3d/utils.c
+14
-14
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d.h
include/wine/wined3d.h
+19
-20
No files found.
dlls/d3d8/device.c
View file @
08545dc7
...
...
@@ -1746,19 +1746,19 @@ tss_lookup[] =
{
FALSE
,
WINED3DTSS_BUMPENVMAT11
},
/* 10, D3DTSS_BUMPENVMAT11 */
{
FALSE
,
WINED3DTSS_TEXCOORDINDEX
},
/* 11, D3DTSS_TEXCOORDINDEX */
{
FALSE
,
WINED3DTSS_FORCE_DWORD
},
/* 12, unused */
{
TRUE
,
WINED3D
SAMP_ADDRESSU
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3D
SAMP_ADDRESSV
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3D
SAMP_BORDERCOLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3D
SAMP_MAGFILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3D
SAMP_MINFILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3D
SAMP_MIPFILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3D
SAMP_MIPMAPLODBIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3D
SAMP_MAXMIPLEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3D
SAMP_MAXANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_U
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_V
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3D
_SAMP_BORDER_COLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3D
_SAMP_MAG_FILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3D
_SAMP_MIN_FILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3D
_SAMP_MIP_FILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3D
_SAMP_MIPMAP_LOD_BIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3D
_SAMP_MAX_MIP_LEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3D
_SAMP_MAX_ANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
FALSE
,
WINED3DTSS_BUMPENVLSCALE
},
/* 22, D3DTSS_BUMPENVLSCALE */
{
FALSE
,
WINED3DTSS_BUMPENVLOFFSET
},
/* 23, D3DTSS_BUMPENVLOFFSET */
{
FALSE
,
WINED3DTSS_TEXTURETRANSFORMFLAGS
},
/* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
{
TRUE
,
WINED3D
SAMP_ADDRESSW
},
/* 25, D3DTSS_ADDRESSW */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_W
},
/* 25, D3DTSS_ADDRESSW */
{
FALSE
,
WINED3DTSS_COLORARG0
},
/* 26, D3DTSS_COLORARG0 */
{
FALSE
,
WINED3DTSS_ALPHAARG0
},
/* 27, D3DTSS_ALPHAARG0 */
{
FALSE
,
WINED3DTSS_RESULTARG
},
/* 28, D3DTSS_RESULTARG */
...
...
dlls/ddraw/device.c
View file @
08545dc7
...
...
@@ -2356,7 +2356,7 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
{
WINED3DTEXTUREFILTERTYPE
tex_mag
;
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MAG
FILTER
,
&
tex_mag
);
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
_SAMP_MAG_
FILTER
,
&
tex_mag
);
switch
(
tex_mag
)
{
...
...
@@ -2379,14 +2379,14 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
WINED3DTEXTUREFILTERTYPE
tex_mip
;
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MIN
FILTER
,
&
tex_min
);
0
,
WINED3D
_SAMP_MIN_
FILTER
,
&
tex_min
);
if
(
FAILED
(
hr
))
{
wined3d_mutex_unlock
();
return
hr
;
}
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MIP
FILTER
,
&
tex_mip
);
0
,
WINED3D
_SAMP_MIP_
FILTER
,
&
tex_mip
);
switch
(
tex_min
)
{
...
...
@@ -2437,11 +2437,11 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
case
D3DRENDERSTATE_TEXTUREADDRESS
:
case
D3DRENDERSTATE_TEXTUREADDRESSU
:
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_ADDRESS
U
,
Value
);
0
,
WINED3D
_SAMP_ADDRESS_
U
,
Value
);
break
;
case
D3DRENDERSTATE_TEXTUREADDRESSV
:
hr
=
wined3d_device_get_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_ADDRESS
V
,
Value
);
0
,
WINED3D
_SAMP_ADDRESS_
V
,
Value
);
break
;
case
D3DRENDERSTATE_BORDERCOLOR
:
...
...
@@ -2688,7 +2688,7 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
break
;
}
hr
=
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MAG
FILTER
,
tex_mag
);
hr
=
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
_SAMP_MAG_
FILTER
,
tex_mag
);
break
;
}
...
...
@@ -2732,23 +2732,23 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
}
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MIP
FILTER
,
tex_mip
);
0
,
WINED3D
_SAMP_MIP_
FILTER
,
tex_mip
);
hr
=
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_MIN
FILTER
,
tex_min
);
0
,
WINED3D
_SAMP_MIN_
FILTER
,
tex_min
);
break
;
}
case
D3DRENDERSTATE_TEXTUREADDRESS
:
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_ADDRESS
V
,
Value
);
0
,
WINED3D
_SAMP_ADDRESS_
V
,
Value
);
/* Drop through */
case
D3DRENDERSTATE_TEXTUREADDRESSU
:
hr
=
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_ADDRESS
U
,
Value
);
0
,
WINED3D
_SAMP_ADDRESS_
U
,
Value
);
break
;
case
D3DRENDERSTATE_TEXTUREADDRESSV
:
hr
=
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
0
,
WINED3D
SAMP_ADDRESS
V
,
Value
);
0
,
WINED3D
_SAMP_ADDRESS_
V
,
Value
);
break
;
case
D3DRENDERSTATE_BORDERCOLOR
:
...
...
@@ -4794,16 +4794,16 @@ tss_lookup[] =
{
FALSE
,
WINED3DTSS_BUMPENVMAT10
},
/* 9, D3DTSS_BUMPENVMAT10 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT11
},
/* 10, D3DTSS_BUMPENVMAT11 */
{
FALSE
,
WINED3DTSS_TEXCOORDINDEX
},
/* 11, D3DTSS_TEXCOORDINDEX */
{
TRUE
,
WINED3D
SAMP_ADDRESSU
},
/* 12, D3DTSS_ADDRESS */
{
TRUE
,
WINED3D
SAMP_ADDRESSU
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3D
SAMP_ADDRESSV
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3D
SAMP_BORDERCOLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3D
SAMP_MAGFILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3D
SAMP_MINFILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3D
SAMP_MIPFILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3D
SAMP_MIPMAPLODBIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3D
SAMP_MAXMIPLEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3D
SAMP_MAXANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_U
},
/* 12, D3DTSS_ADDRESS */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_U
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3D
_SAMP_ADDRESS_V
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3D
_SAMP_BORDER_COLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3D
_SAMP_MAG_FILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3D
_SAMP_MIN_FILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3D
_SAMP_MIP_FILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3D
_SAMP_MIPMAP_LOD_BIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3D
_SAMP_MAX_MIP_LEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3D
_SAMP_MAX_ANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
FALSE
,
WINED3DTSS_BUMPENVLSCALE
},
/* 22, D3DTSS_BUMPENVLSCALE */
{
FALSE
,
WINED3DTSS_BUMPENVLOFFSET
},
/* 23, D3DTSS_BUMPENVLOFFSET */
{
FALSE
,
WINED3DTSS_TEXTURETRANSFORMFLAGS
},
/* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
...
...
@@ -5025,7 +5025,7 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
}
case
D3DTSS_ADDRESS
:
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
Stage
,
WINED3D
SAMP_ADDRESS
V
,
State
);
wined3d_device_set_sampler_state
(
This
->
wined3d_device
,
Stage
,
WINED3D
_SAMP_ADDRESS_
V
,
State
);
break
;
default:
...
...
dlls/wined3d/device.c
View file @
08545dc7
...
...
@@ -465,7 +465,7 @@ static void device_preload_texture(const struct wined3d_state *state, unsigned i
enum
WINED3DSRGB
srgb
;
if
(
!
(
texture
=
state
->
textures
[
idx
]))
return
;
srgb
=
state
->
sampler_states
[
idx
][
WINED3D
SAMP_SRGB
TEXTURE
]
?
SRGB_SRGB
:
SRGB_RGB
;
srgb
=
state
->
sampler_states
[
idx
][
WINED3D
_SAMP_SRGB_
TEXTURE
]
?
SRGB_SRGB
:
SRGB_RGB
;
texture
->
texture_ops
->
texture_preload
(
texture
,
srgb
);
}
...
...
@@ -2455,7 +2455,7 @@ HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *devic
}
HRESULT
CDECL
wined3d_device_set_sampler_state
(
struct
wined3d_device
*
device
,
UINT
sampler_idx
,
WINED3DSAMPLERSTATETYPE
state
,
DWORD
value
)
UINT
sampler_idx
,
enum
wined3d_sampler_state
state
,
DWORD
value
)
{
DWORD
old_value
;
...
...
@@ -2495,7 +2495,7 @@ HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
}
HRESULT
CDECL
wined3d_device_get_sampler_state
(
const
struct
wined3d_device
*
device
,
UINT
sampler_idx
,
WINED3DSAMPLERSTATETYPE
state
,
DWORD
*
value
)
UINT
sampler_idx
,
enum
wined3d_sampler_state
state
,
DWORD
*
value
)
{
TRACE
(
"device %p, sampler_idx %u, state %s, value %p.
\n
"
,
device
,
sampler_idx
,
debug_d3dsamplerstate
(
state
),
value
);
...
...
@@ -4465,12 +4465,12 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
{
if
(
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIN
FILTER
]
==
WINED3DTEXF_NONE
)
if
(
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIN_
FILTER
]
==
WINED3DTEXF_NONE
)
{
WARN
(
"Sampler state %u has minfilter D3DTEXF_NONE, returning D3DERR_UNSUPPORTEDTEXTUREFILTER
\n
"
,
i
);
return
WINED3DERR_UNSUPPORTEDTEXTUREFILTER
;
}
if
(
state
->
sampler_states
[
i
][
WINED3D
SAMP_MAG
FILTER
]
==
WINED3DTEXF_NONE
)
if
(
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MAG_
FILTER
]
==
WINED3DTEXF_NONE
)
{
WARN
(
"Sampler state %u has magfilter D3DTEXF_NONE, returning D3DERR_UNSUPPORTEDTEXTUREFILTER
\n
"
,
i
);
return
WINED3DERR_UNSUPPORTEDTEXTUREFILTER
;
...
...
@@ -4479,18 +4479,18 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
texture
=
state
->
textures
[
i
];
if
(
!
texture
||
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
if
(
state
->
sampler_states
[
i
][
WINED3D
SAMP_MAG
FILTER
]
!=
WINED3DTEXF_POINT
)
if
(
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MAG_
FILTER
]
!=
WINED3DTEXF_POINT
)
{
WARN
(
"Non-filterable texture and mag filter enabled on samper %u, returning E_FAIL
\n
"
,
i
);
return
E_FAIL
;
}
if
(
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIN
FILTER
]
!=
WINED3DTEXF_POINT
)
if
(
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIN_
FILTER
]
!=
WINED3DTEXF_POINT
)
{
WARN
(
"Non-filterable texture and min filter enabled on samper %u, returning E_FAIL
\n
"
,
i
);
return
E_FAIL
;
}
if
(
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIP
FILTER
]
!=
WINED3DTEXF_NONE
&&
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIP
FILTER
]
!=
WINED3DTEXF_POINT
)
if
(
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIP_
FILTER
]
!=
WINED3DTEXF_NONE
&&
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIP_
FILTER
]
!=
WINED3DTEXF_POINT
)
{
WARN
(
"Non-filterable texture and mip filter enabled on samper %u, returning E_FAIL
\n
"
,
i
);
return
E_FAIL
;
...
...
dlls/wined3d/state.c
View file @
08545dc7
...
...
@@ -3615,14 +3615,14 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
if
(
state
->
textures
[
sampler
])
{
struct
wined3d_texture
*
texture
=
state
->
textures
[
sampler
];
BOOL
srgb
=
state
->
sampler_states
[
sampler
][
WINED3D
SAMP_SRGB
TEXTURE
];
BOOL
srgb
=
state
->
sampler_states
[
sampler
][
WINED3D
_SAMP_SRGB_
TEXTURE
];
texture
->
texture_ops
->
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
])
{
tmpvalue
.
d
=
state
->
sampler_states
[
sampler
][
WINED3D
SAMP_MIPMAPLOD
BIAS
];
tmpvalue
.
d
=
state
->
sampler_states
[
sampler
][
WINED3D
_SAMP_MIPMAP_LOD_
BIAS
];
glTexEnvf
(
GL_TEXTURE_FILTER_CONTROL_EXT
,
GL_TEXTURE_LOD_BIAS_EXT
,
tmpvalue
.
f
);
...
...
dlls/wined3d/stateblock.c
View file @
08545dc7
...
...
@@ -114,18 +114,18 @@ static const DWORD pixel_states_texture[] =
static
const
DWORD
pixel_states_sampler
[]
=
{
WINED3D
SAMP_ADDRESS
U
,
WINED3D
SAMP_ADDRESS
V
,
WINED3D
SAMP_ADDRESS
W
,
WINED3D
SAMP_BORDER
COLOR
,
WINED3D
SAMP_MAG
FILTER
,
WINED3D
SAMP_MIN
FILTER
,
WINED3D
SAMP_MIP
FILTER
,
WINED3D
SAMP_MIPMAPLOD
BIAS
,
WINED3D
SAMP_MAXMIP
LEVEL
,
WINED3D
SAMP_MAX
ANISOTROPY
,
WINED3D
SAMP_SRGB
TEXTURE
,
WINED3D
SAMP_ELEMENT
INDEX
,
WINED3D
_SAMP_ADDRESS_
U
,
WINED3D
_SAMP_ADDRESS_
V
,
WINED3D
_SAMP_ADDRESS_
W
,
WINED3D
_SAMP_BORDER_
COLOR
,
WINED3D
_SAMP_MAG_
FILTER
,
WINED3D
_SAMP_MIN_
FILTER
,
WINED3D
_SAMP_MIP_
FILTER
,
WINED3D
_SAMP_MIPMAP_LOD_
BIAS
,
WINED3D
_SAMP_MAX_MIP_
LEVEL
,
WINED3D
_SAMP_MAX_
ANISOTROPY
,
WINED3D
_SAMP_SRGB_
TEXTURE
,
WINED3D
_SAMP_ELEMENT_
INDEX
,
};
static
const
DWORD
vertex_states_render
[]
=
...
...
@@ -185,7 +185,7 @@ static const DWORD vertex_states_texture[] =
static
const
DWORD
vertex_states_sampler
[]
=
{
WINED3D
SAMP_DMAP
OFFSET
,
WINED3D
_SAMP_DMAP_
OFFSET
,
};
/* Allocates the correct amount of space for pixel and vertex shader constants,
...
...
@@ -1278,21 +1278,21 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
{
TRACE
(
"Setting up default samplers states for sampler %u.
\n
"
,
i
);
state
->
sampler_states
[
i
][
WINED3D
SAMP_ADDRESS
U
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_ADDRESS
V
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_ADDRESS
W
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_BORDER
COLOR
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MAG
FILTER
]
=
WINED3DTEXF_POINT
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIN
FILTER
]
=
WINED3DTEXF_POINT
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIP
FILTER
]
=
WINED3DTEXF_NONE
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MIPMAPLOD
BIAS
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MAXMIP
LEVEL
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_MAX
ANISOTROPY
]
=
1
;
state
->
sampler_states
[
i
][
WINED3D
SAMP_SRGB
TEXTURE
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_ADDRESS_
U
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_ADDRESS_
V
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_ADDRESS_
W
]
=
WINED3DTADDRESS_WRAP
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_BORDER_
COLOR
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MAG_
FILTER
]
=
WINED3DTEXF_POINT
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIN_
FILTER
]
=
WINED3DTEXF_POINT
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIP_
FILTER
]
=
WINED3DTEXF_NONE
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MIPMAP_LOD_
BIAS
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MAX_MIP_
LEVEL
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_MAX_
ANISOTROPY
]
=
1
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_SRGB_
TEXTURE
]
=
0
;
/* TODO: Indicates which element of a multielement texture to use. */
state
->
sampler_states
[
i
][
WINED3D
SAMP_ELEMENT
INDEX
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_ELEMENT_
INDEX
]
=
0
;
/* TODO: Vertex offset in the presampled displacement map. */
state
->
sampler_states
[
i
][
WINED3D
SAMP_DMAP
OFFSET
]
=
0
;
state
->
sampler_states
[
i
][
WINED3D
_SAMP_DMAP_
OFFSET
]
=
0
;
}
for
(
i
=
0
;
i
<
gl_info
->
limits
.
textures
;
++
i
)
...
...
dlls/wined3d/texture.c
View file @
08545dc7
...
...
@@ -277,32 +277,32 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
/* This function relies on the correct texture being bound and loaded. */
if
(
sampler_states
[
WINED3D
SAMP_ADDRESS
U
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
])
if
(
sampler_states
[
WINED3D
_SAMP_ADDRESS_
U
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
])
{
state
=
sampler_states
[
WINED3D
SAMP_ADDRESS
U
];
state
=
sampler_states
[
WINED3D
_SAMP_ADDRESS_
U
];
apply_wrap
(
gl_info
,
target
,
state
,
GL_TEXTURE_WRAP_S
,
cond_np2
);
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSU
]
=
state
;
}
if
(
sampler_states
[
WINED3D
SAMP_ADDRESS
V
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
])
if
(
sampler_states
[
WINED3D
_SAMP_ADDRESS_
V
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
])
{
state
=
sampler_states
[
WINED3D
SAMP_ADDRESS
V
];
state
=
sampler_states
[
WINED3D
_SAMP_ADDRESS_
V
];
apply_wrap
(
gl_info
,
target
,
state
,
GL_TEXTURE_WRAP_T
,
cond_np2
);
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSV
]
=
state
;
}
if
(
sampler_states
[
WINED3D
SAMP_ADDRESS
W
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSW
])
if
(
sampler_states
[
WINED3D
_SAMP_ADDRESS_
W
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSW
])
{
state
=
sampler_states
[
WINED3D
SAMP_ADDRESS
W
];
state
=
sampler_states
[
WINED3D
_SAMP_ADDRESS_
W
];
apply_wrap
(
gl_info
,
target
,
state
,
GL_TEXTURE_WRAP_R
,
cond_np2
);
gl_tex
->
states
[
WINED3DTEXSTA_ADDRESSW
]
=
state
;
}
if
(
sampler_states
[
WINED3D
SAMP_BORDER
COLOR
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_BORDERCOLOR
])
if
(
sampler_states
[
WINED3D
_SAMP_BORDER_
COLOR
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_BORDERCOLOR
])
{
float
col
[
4
];
state
=
sampler_states
[
WINED3D
SAMP_BORDER
COLOR
];
state
=
sampler_states
[
WINED3D
_SAMP_BORDER_
COLOR
];
D3DCOLORTOGLFLOAT4
(
state
,
col
);
TRACE
(
"Setting border color for %#x to %#x.
\n
"
,
target
,
state
);
glTexParameterfv
(
target
,
GL_TEXTURE_BORDER_COLOR
,
&
col
[
0
]);
...
...
@@ -310,11 +310,11 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
gl_tex
->
states
[
WINED3DTEXSTA_BORDERCOLOR
]
=
state
;
}
if
(
sampler_states
[
WINED3D
SAMP_MAG
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
])
if
(
sampler_states
[
WINED3D
_SAMP_MAG_
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
])
{
GLint
gl_value
;
state
=
sampler_states
[
WINED3D
SAMP_MAG
FILTER
];
state
=
sampler_states
[
WINED3D
_SAMP_MAG_
FILTER
];
if
(
state
>
WINED3DTEXF_ANISOTROPIC
)
FIXME
(
"Unrecognized or unsupported MAGFILTER* value %d.
\n
"
,
state
);
...
...
@@ -326,30 +326,30 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
gl_tex
->
states
[
WINED3DTEXSTA_MAGFILTER
]
=
state
;
}
if
((
sampler_states
[
WINED3D
SAMP_MIN
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
||
sampler_states
[
WINED3D
SAMP_MIP
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
||
sampler_states
[
WINED3D
SAMP_MAXMIP
LEVEL
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]))
if
((
sampler_states
[
WINED3D
_SAMP_MIN_
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
||
sampler_states
[
WINED3D
_SAMP_MIP_
FILTER
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
||
sampler_states
[
WINED3D
_SAMP_MAX_MIP_
LEVEL
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]))
{
GLint
gl_value
;
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
=
sampler_states
[
WINED3D
SAMP_MIP
FILTER
];
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
=
sampler_states
[
WINED3D
SAMP_MIN
FILTER
];
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
=
sampler_states
[
WINED3D
SAMP_MAXMIP
LEVEL
];
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
=
sampler_states
[
WINED3D
_SAMP_MIP_
FILTER
];
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
=
sampler_states
[
WINED3D
_SAMP_MIN_
FILTER
];
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
=
sampler_states
[
WINED3D
_SAMP_MAX_MIP_
LEVEL
];
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
]
>
WINED3DTEXF_ANISOTROPIC
||
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
>
WINED3DTEXF_ANISOTROPIC
)
{
FIXME
(
"Unrecognized or unsupported
D3DSAMP_MINFILTER value %#x D3DSAMP_MIP
FILTER value %#x.
\n
"
,
FIXME
(
"Unrecognized or unsupported
MIN_FILTER value %#x MIP_
FILTER value %#x.
\n
"
,
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
],
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]);
}
gl_value
=
wined3d_gl_min_mip_filter
(
texture
->
min_mip_lookup
,
min
(
max
(
sampler_states
[
WINED3D
SAMP_MIN
FILTER
],
WINED3DTEXF_POINT
),
WINED3DTEXF_LINEAR
),
min
(
max
(
sampler_states
[
WINED3D
SAMP_MIP
FILTER
],
WINED3DTEXF_NONE
),
WINED3DTEXF_LINEAR
));
min
(
max
(
sampler_states
[
WINED3D
_SAMP_MIN_
FILTER
],
WINED3DTEXF_POINT
),
WINED3DTEXF_LINEAR
),
min
(
max
(
sampler_states
[
WINED3D
_SAMP_MIP_
FILTER
],
WINED3DTEXF_NONE
),
WINED3DTEXF_LINEAR
));
TRACE
(
"ValueMIN=%#x, ValueMIP=%#x, setting MINFILTER to %#x.
\n
"
,
sampler_states
[
WINED3D
SAMP_MIN
FILTER
],
sampler_states
[
WINED3D
SAMP_MIP
FILTER
],
gl_value
);
sampler_states
[
WINED3D
_SAMP_MIN_
FILTER
],
sampler_states
[
WINED3D
_SAMP_MIP_
FILTER
],
gl_value
);
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
gl_value
);
checkGLcall
(
"glTexParameter GL_TEXTURE_MIN_FILTER, ..."
);
...
...
@@ -365,9 +365,9 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
else
gl_value
=
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
];
/* Note that WINED3D
SAMP_MAXMIP
LEVEL specifies the largest mipmap
/* Note that WINED3D
_SAMP_MAX_MIP_
LEVEL specifies the largest mipmap
* (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest
* mimap used (default 1000). So WINED3D
SAMP_MAXMIP
LEVEL
* mimap used (default 1000). So WINED3D
_SAMP_MAX_MIP_
LEVEL
* corresponds to GL_TEXTURE_BASE_LEVEL. */
glTexParameteri
(
target
,
GL_TEXTURE_BASE_LEVEL
,
gl_value
);
}
...
...
@@ -379,7 +379,7 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
||
cond_np2
)
aniso
=
1
;
else
aniso
=
sampler_states
[
WINED3D
SAMP_MAX
ANISOTROPY
];
aniso
=
sampler_states
[
WINED3D
_SAMP_MAX_
ANISOTROPY
];
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MAXANISOTROPY
]
!=
aniso
)
{
...
...
@@ -396,12 +396,12 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
}
/* These should always be the same unless EXT_texture_sRGB_decode is supported. */
if
(
sampler_states
[
WINED3D
SAMP_SRGB
TEXTURE
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
])
if
(
sampler_states
[
WINED3D
_SAMP_SRGB_
TEXTURE
]
!=
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
])
{
glTexParameteri
(
target
,
GL_TEXTURE_SRGB_DECODE_EXT
,
sampler_states
[
WINED3D
SAMP_SRGB
TEXTURE
]
?
GL_DECODE_EXT
:
GL_SKIP_DECODE_EXT
);
sampler_states
[
WINED3D
_SAMP_SRGB_
TEXTURE
]
?
GL_DECODE_EXT
:
GL_SKIP_DECODE_EXT
);
checkGLcall
(
"glTexParameteri(GL_TEXTURE_SRGB_DECODE_EXT)"
);
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
]
=
sampler_states
[
WINED3D
SAMP_SRGB
TEXTURE
];
gl_tex
->
states
[
WINED3DTEXSTA_SRGBTEXTURE
]
=
sampler_states
[
WINED3D
_SAMP_SRGB_
TEXTURE
];
}
if
(
!
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SHADOW
)
...
...
dlls/wined3d/utils.c
View file @
08545dc7
...
...
@@ -2154,24 +2154,24 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
}
}
const
char
*
debug_d3dsamplerstate
(
DWORD
state
)
const
char
*
debug_d3dsamplerstate
(
enum
wined3d_sampler_state
state
)
{
switch
(
state
)
{
#define D3DSTATE_TO_STR(u) case u: return #u
D3DSTATE_TO_STR
(
WINED3D
SAMP_BORDER
COLOR
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_ADDRESS
U
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_ADDRESS
V
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_ADDRESS
W
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MAG
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MIN
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MIP
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MIPMAPLOD
BIAS
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MAXMIP
LEVEL
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_MAX
ANISOTROPY
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_SRGB
TEXTURE
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_ELEMENT
INDEX
);
D3DSTATE_TO_STR
(
WINED3D
SAMP_DMAP
OFFSET
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_BORDER_
COLOR
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_ADDRESS_
U
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_ADDRESS_
V
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_ADDRESS_
W
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MAG_
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MIN_
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MIP_
FILTER
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MIPMAP_LOD_
BIAS
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MAX_MIP_
LEVEL
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_MAX_
ANISOTROPY
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_SRGB_
TEXTURE
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_ELEMENT_
INDEX
);
D3DSTATE_TO_STR
(
WINED3D
_SAMP_DMAP_
OFFSET
);
#undef D3DSTATE_TO_STR
default:
FIXME
(
"Unrecognized %u sampler state!
\n
"
,
state
);
...
...
dlls/wined3d/wined3d_private.h
View file @
08545dc7
...
...
@@ -2501,7 +2501,7 @@ const char *debug_d3ddeclmethod(WINED3DDECLMETHOD method) DECLSPEC_HIDDEN;
const
char
*
debug_d3ddeclusage
(
BYTE
usage
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dprimitivetype
(
enum
wined3d_primitive_type
primitive_type
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3drenderstate
(
enum
wined3d_render_state
state
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dsamplerstate
(
DWORD
state
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dsamplerstate
(
enum
wined3d_sampler_state
state
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dstate
(
DWORD
state
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dtexturefiltertype
(
WINED3DTEXTUREFILTERTYPE
filter_type
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dtexturestate
(
DWORD
state
)
DECLSPEC_HIDDEN
;
...
...
include/wine/wined3d.h
View file @
08545dc7
...
...
@@ -509,24 +509,23 @@ enum wined3d_swap_effect
WINED3D_SWAP_EFFECT_COPY_VSYNC
=
4
,
};
typedef
enum
_WINED3DSAMPLERSTATETYPE
{
WINED3DSAMP_ADDRESSU
=
1
,
WINED3DSAMP_ADDRESSV
=
2
,
WINED3DSAMP_ADDRESSW
=
3
,
WINED3DSAMP_BORDERCOLOR
=
4
,
WINED3DSAMP_MAGFILTER
=
5
,
WINED3DSAMP_MINFILTER
=
6
,
WINED3DSAMP_MIPFILTER
=
7
,
WINED3DSAMP_MIPMAPLODBIAS
=
8
,
WINED3DSAMP_MAXMIPLEVEL
=
9
,
WINED3DSAMP_MAXANISOTROPY
=
10
,
WINED3DSAMP_SRGBTEXTURE
=
11
,
WINED3DSAMP_ELEMENTINDEX
=
12
,
WINED3DSAMP_DMAPOFFSET
=
13
,
WINED3DSAMP_FORCE_DWORD
=
0x7fffffff
,
}
WINED3DSAMPLERSTATETYPE
;
#define WINED3D_HIGHEST_SAMPLER_STATE WINED3DSAMP_DMAPOFFSET
enum
wined3d_sampler_state
{
WINED3D_SAMP_ADDRESS_U
=
1
,
WINED3D_SAMP_ADDRESS_V
=
2
,
WINED3D_SAMP_ADDRESS_W
=
3
,
WINED3D_SAMP_BORDER_COLOR
=
4
,
WINED3D_SAMP_MAG_FILTER
=
5
,
WINED3D_SAMP_MIN_FILTER
=
6
,
WINED3D_SAMP_MIP_FILTER
=
7
,
WINED3D_SAMP_MIPMAP_LOD_BIAS
=
8
,
WINED3D_SAMP_MAX_MIP_LEVEL
=
9
,
WINED3D_SAMP_MAX_ANISOTROPY
=
10
,
WINED3D_SAMP_SRGB_TEXTURE
=
11
,
WINED3D_SAMP_ELEMENT_INDEX
=
12
,
WINED3D_SAMP_DMAP_OFFSET
=
13
,
};
#define WINED3D_HIGHEST_SAMPLER_STATE WINED3D_SAMP_DMAP_OFFSET
typedef
enum
_WINED3DMULTISAMPLE_TYPE
{
...
...
@@ -2136,7 +2135,7 @@ HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *dev
HRESULT
__cdecl
wined3d_device_get_render_target
(
const
struct
wined3d_device
*
device
,
UINT
render_target_idx
,
struct
wined3d_surface
**
render_target
);
HRESULT
__cdecl
wined3d_device_get_sampler_state
(
const
struct
wined3d_device
*
device
,
UINT
sampler_idx
,
WINED3DSAMPLERSTATETYPE
state
,
DWORD
*
value
);
UINT
sampler_idx
,
enum
wined3d_sampler_state
state
,
DWORD
*
value
);
HRESULT
__cdecl
wined3d_device_get_scissor_rect
(
const
struct
wined3d_device
*
device
,
RECT
*
rect
);
BOOL
__cdecl
wined3d_device_get_software_vertex_processing
(
const
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_get_stream_source
(
const
struct
wined3d_device
*
device
,
...
...
@@ -2215,7 +2214,7 @@ HRESULT __cdecl wined3d_device_set_render_state(struct wined3d_device *device,
HRESULT
__cdecl
wined3d_device_set_render_target
(
struct
wined3d_device
*
device
,
UINT
render_target_idx
,
struct
wined3d_surface
*
render_target
,
BOOL
set_viewport
);
HRESULT
__cdecl
wined3d_device_set_sampler_state
(
struct
wined3d_device
*
device
,
UINT
sampler_idx
,
WINED3DSAMPLERSTATETYPE
state
,
DWORD
value
);
UINT
sampler_idx
,
enum
wined3d_sampler_state
state
,
DWORD
value
);
HRESULT
__cdecl
wined3d_device_set_scissor_rect
(
struct
wined3d_device
*
device
,
const
RECT
*
rect
);
HRESULT
__cdecl
wined3d_device_set_software_vertex_processing
(
struct
wined3d_device
*
device
,
BOOL
software
);
HRESULT
__cdecl
wined3d_device_set_stream_source
(
struct
wined3d_device
*
device
,
...
...
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