d3d10/effect: Partially implement updates through value expressions.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-11-30 20:09:29 +03:00 committed by Alexandre Julliard
parent 148f996c2f
commit 7448ecae49
2 changed files with 29 additions and 6 deletions

View file

@ -800,6 +800,7 @@ static void d3d10_effect_update_dependent_props(struct d3d10_effect_prop_depende
struct d3d10_effect_prop_dependency *d; struct d3d10_effect_prop_dependency *d;
unsigned int i, j, count, variable_idx; unsigned int i, j, count, variable_idx;
struct d3d10_effect_variable *v; struct d3d10_effect_variable *v;
struct d3d10_reg_table *table;
unsigned int *dst_index; unsigned int *dst_index;
uint32_t value; uint32_t value;
HRESULT hr; HRESULT hr;
@ -864,6 +865,34 @@ static void d3d10_effect_update_dependent_props(struct d3d10_effect_prop_depende
} }
break; break;
case D3D10_EOO_VALUE_EXPRESSION:
if ((property_info->container_type != D3D10_C_PASS)
|| ((property_info->type != D3D10_SVT_UINT) && (property_info->type != D3D10_SVT_FLOAT)))
{
FIXME("Unimplemented for property %s.\n", property_info->name);
return;
}
if (FAILED(hr = d3d10_effect_preshader_eval(&d->value_expr.value)))
{
WARN("Failed to evaluate value expression, hr %#lx.\n", hr);
return;
}
table = &d->value_expr.value.reg_tables[D3D10_REG_TABLE_RESULT];
if (property_info->size != table->count)
{
WARN("Unexpected value expression output size %u, property size %u.\n",
table->count, property_info->size);
return;
}
memcpy(dst, table->f, property_info->size * sizeof(float));
break;
default: default:
FIXME("Unsupported property update for %u.\n", d->operation); FIXME("Unsupported property update for %u.\n", d->operation);
} }

View file

@ -8314,13 +8314,10 @@ static void test_effect_value_expression(void)
ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
ok(!blend_state, "Unexpected blend state %p.\n", blend_state); ok(!blend_state, "Unexpected blend state %p.\n", blend_state);
todo_wine
{
ok(blend_factor[0] == 1.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); ok(blend_factor[0] == 1.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
ok(blend_factor[1] == 1.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); ok(blend_factor[1] == 1.0f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
ok(blend_factor[2] == 0.1f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); ok(blend_factor[2] == 0.1f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
ok(blend_factor[3] == -3.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(blend_factor[3] == -3.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]);
}
ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
pass = t->lpVtbl->GetPassByName(t, "p4"); pass = t->lpVtbl->GetPassByName(t, "p4");
@ -8331,13 +8328,10 @@ static void test_effect_value_expression(void)
ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask); ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
ok(!blend_state, "Unexpected blend state %p.\n", blend_state); ok(!blend_state, "Unexpected blend state %p.\n", blend_state);
todo_wine
{
ok(blend_factor[0] == 2.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]); ok(blend_factor[0] == 2.0f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
ok(blend_factor[1] == 1.1f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]); ok(blend_factor[1] == 1.1f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
ok(blend_factor[2] == 1.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]); ok(blend_factor[2] == 1.0f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
ok(blend_factor[3] == 1.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]); ok(blend_factor[3] == 1.0f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]);
}
ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask); ok(!sample_mask, "Got unexpected sample_mask %#x.\n", sample_mask);
effect->lpVtbl->Release(effect); effect->lpVtbl->Release(effect);