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

d3dx9: Avoid an extra indirection in is_const_tab_input_dirty().

parent 847f772f
......@@ -339,14 +339,19 @@ static inline ULONG64 next_update_version(ULONG64 *version_counter)
return ++*version_counter;
}
static inline BOOL is_param_dirty(struct d3dx_parameter *param, ULONG64 update_version)
static inline BOOL is_top_level_param_dirty(struct d3dx_top_level_parameter *param, ULONG64 update_version)
{
struct d3dx_shared_data *shared_data;
if ((shared_data = param->top_level_param->shared_data))
if ((shared_data = param->shared_data))
return update_version < shared_data->update_version;
else
return update_version < param->top_level_param->update_version;
return update_version < param->update_version;
}
static inline BOOL is_param_dirty(struct d3dx_parameter *param, ULONG64 update_version)
{
return is_top_level_param_dirty(param->top_level_param, update_version);
}
struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base,
......
......@@ -941,6 +941,12 @@ static HRESULT get_constants_desc(unsigned int *byte_code, struct d3dx_const_tab
goto cleanup;
}
}
if (!is_top_level_parameter(inputs_param[index]))
{
WARN("Expected top level parameter '%s'.\n", debugstr_a(cdesc[index].Name));
hr = E_FAIL;
goto cleanup;
}
for (j = 0; j < skip_constants_count; ++j)
{
......@@ -1618,7 +1624,8 @@ static BOOL is_const_tab_input_dirty(struct d3dx_const_tab *ctab, ULONG64 update
update_version = ctab->update_version;
for (i = 0; i < ctab->input_count; ++i)
{
if (is_param_dirty(ctab->inputs_param[i], update_version))
if (is_top_level_param_dirty(top_level_parameter_from_parameter(ctab->inputs_param[i]),
update_version))
return TRUE;
}
return FALSE;
......
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