Commit dca016d7 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

d3dx9: Add is_param_type_sampler() helper function.

parent 4786f53e
......@@ -108,6 +108,13 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN;
void set_number(void *outdata, D3DXPARAMETER_TYPE outtype,
const void *indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN;
static inline BOOL is_param_type_sampler(D3DXPARAMETER_TYPE type)
{
return type == D3DXPT_SAMPLER
|| type == D3DXPT_SAMPLER1D || type == D3DXPT_SAMPLER2D
|| type == D3DXPT_SAMPLER3D || type == D3DXPT_SAMPLERCUBE;
}
struct d3dx_parameter;
enum pres_reg_tables
......
......@@ -1326,9 +1326,7 @@ static HRESULT d3dx9_base_effect_set_value(struct d3dx9_base_effect *base,
}
/* samplers don't touch data */
if (param->class == D3DXPC_OBJECT && (param->type == D3DXPT_SAMPLER
|| param->type == D3DXPT_SAMPLER1D || param->type == D3DXPT_SAMPLER2D
|| param->type == D3DXPT_SAMPLER3D || param->type == D3DXPT_SAMPLERCUBE))
if (param->class == D3DXPC_OBJECT && is_param_type_sampler(param->type))
{
TRACE("Sampler: returning E_FAIL\n");
return E_FAIL;
......@@ -1391,9 +1389,7 @@ static HRESULT d3dx9_base_effect_get_value(struct d3dx9_base_effect *base,
}
/* samplers don't touch data */
if (param->class == D3DXPC_OBJECT && (param->type == D3DXPT_SAMPLER
|| param->type == D3DXPT_SAMPLER1D || param->type == D3DXPT_SAMPLER2D
|| param->type == D3DXPT_SAMPLER3D || param->type == D3DXPT_SAMPLERCUBE))
if (param->class == D3DXPC_OBJECT && is_param_type_sampler(param->type))
{
TRACE("Sampler: returning E_FAIL\n");
return E_FAIL;
......@@ -2743,9 +2739,7 @@ static HRESULT d3dx_set_shader_constants(struct ID3DXEffectImpl *effect, struct
ret = D3D_OK;
for (i = 0; i < parameters_count; ++i)
{
if (params[i] && params[i]->class == D3DXPC_OBJECT && (params[i]->type == D3DXPT_SAMPLER
|| params[i]->type == D3DXPT_SAMPLER1D || params[i]->type == D3DXPT_SAMPLER2D
|| params[i]->type == D3DXPT_SAMPLER3D || params[i]->type == D3DXPT_SAMPLERCUBE))
if (params[i] && params[i]->class == D3DXPC_OBJECT && is_param_type_sampler(params[i]->type))
{
struct d3dx_sampler *sampler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment