Commit 000767f9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Implement SetRawValue().

parent 3f598171
......@@ -4514,9 +4514,36 @@ static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_varia
static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
void *data, UINT offset, UINT count)
{
FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable(iface);
BOOL is_buffer;
return E_NOTIMPL;
TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
if (!iface->lpVtbl->IsValid(iface))
{
WARN("Invalid variable.\n");
return E_FAIL;
}
is_buffer = v->type->basetype == D3D10_SVT_CBUFFER || v->type->basetype == D3D10_SVT_TBUFFER;
if (v->type->type_class == D3D10_SVC_OBJECT && !is_buffer)
{
WARN("Not supported on object variables of type %s.\n",
debug_d3d10_shader_variable_type(v->type->basetype));
return D3DERR_INVALIDCALL;
}
if (!is_buffer)
{
offset += v->buffer_offset;
v = v->buffer;
}
memcpy(v->u.buffer.local_buffer + offset, data, count);
v->u.buffer.changed = TRUE;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
......@@ -4524,7 +4551,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectV
{
struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable(iface);
BOOL is_buffer;
BYTE *src;
TRACE("iface %p, data %p, offset %u, count %u.\n", iface, data, offset, count);
......@@ -4543,8 +4569,13 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectV
return D3DERR_INVALIDCALL;
}
src = is_buffer ? v->u.buffer.local_buffer : v->buffer->u.buffer.local_buffer + v->buffer_offset;
memcpy(data, src + offset, count);
if (!is_buffer)
{
offset += v->buffer_offset;
v = v->buffer;
}
memcpy(data, v->u.buffer.local_buffer + offset, count);
return S_OK;
}
......
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