d3d10: Implement ID3D10EffectVariable::AsVector().

This commit is contained in:
Henri Verbeet 2009-09-09 18:12:42 +02:00 committed by Alexandre Julliard
parent fbbbdc09a5
commit 58fcb06c07
1 changed files with 308 additions and 2 deletions

View File

@ -48,6 +48,7 @@ static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
/* null objects - needed for invalid calls */
@ -58,6 +59,8 @@ static struct d3d10_effect_local_buffer null_local_buffer =
static struct d3d10_effect_variable null_variable = {&d3d10_effect_variable_vtbl, NULL, NULL, 0, 0, 0, NULL};
static struct d3d10_effect_variable null_scalar_variable =
{(ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl, NULL, NULL, 0, 0, 0, NULL};
static struct d3d10_effect_variable null_vector_variable =
{(ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl, NULL, NULL, 0, 0, 0, NULL};
static inline void read_dword(const char **ptr, DWORD *d)
{
@ -600,6 +603,10 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *
v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
break;
case D3D10_SVC_VECTOR:
v->vtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
break;
default:
FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
v->vtbl = &d3d10_effect_variable_vtbl;
@ -1556,9 +1563,14 @@ static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variab
static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
ID3D10EffectVariable *iface)
{
FIXME("iface %p stub!\n", iface);
struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
return NULL;
TRACE("iface %p\n", iface);
if (This->vtbl == (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
return (ID3D10EffectVectorVariable *)This;
return (ID3D10EffectVectorVariable *)&null_vector_variable;
}
static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
@ -2254,6 +2266,300 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
d3d10_effect_scalar_variable_GetBoolArray,
};
/* ID3D10EffectVariable methods */
static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
{
TRACE("iface %p\n", iface);
return (struct d3d10_effect_variable *)iface != &null_vector_variable;
}
static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
D3D10_EFFECT_VARIABLE_DESC *desc)
{
return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
ID3D10EffectVectorVariable *iface, UINT index)
{
return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
ID3D10EffectVectorVariable *iface, LPCSTR name)
{
return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
ID3D10EffectVectorVariable *iface, UINT index)
{
return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
ID3D10EffectVectorVariable *iface, LPCSTR name)
{
return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
ID3D10EffectVectorVariable *iface, LPCSTR semantic)
{
return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
}
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
ID3D10EffectVectorVariable *iface, UINT index)
{
return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
}
static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
}
static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
ID3D10EffectVectorVariable *iface)
{
return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
void *data, UINT offset, UINT count)
{
return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
void *data, UINT offset, UINT count)
{
return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
}
/* ID3D10EffectVectorVariable methods */
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
BOOL *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
int *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
float *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
BOOL *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
int *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
float *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
BOOL *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
int *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
float *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
BOOL *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
int *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
float *values, UINT offset, UINT count)
{
FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
return E_NOTIMPL;
}
static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
{
/* ID3D10EffectVariable methods */
d3d10_effect_vector_variable_IsValid,
d3d10_effect_vector_variable_GetType,
d3d10_effect_vector_variable_GetDesc,
d3d10_effect_vector_variable_GetAnnotationByIndex,
d3d10_effect_vector_variable_GetAnnotationByName,
d3d10_effect_vector_variable_GetMemberByIndex,
d3d10_effect_vector_variable_GetMemberByName,
d3d10_effect_vector_variable_GetMemberBySemantic,
d3d10_effect_vector_variable_GetElement,
d3d10_effect_vector_variable_GetParentConstantBuffer,
d3d10_effect_vector_variable_AsScalar,
d3d10_effect_vector_variable_AsVector,
d3d10_effect_vector_variable_AsMatrix,
d3d10_effect_vector_variable_AsString,
d3d10_effect_vector_variable_AsShaderResource,
d3d10_effect_vector_variable_AsRenderTargetView,
d3d10_effect_vector_variable_AsDepthStencilView,
d3d10_effect_vector_variable_AsConstantBuffer,
d3d10_effect_vector_variable_AsShader,
d3d10_effect_vector_variable_AsBlend,
d3d10_effect_vector_variable_AsDepthStencil,
d3d10_effect_vector_variable_AsRasterizer,
d3d10_effect_vector_variable_AsSampler,
d3d10_effect_vector_variable_SetRawValue,
d3d10_effect_vector_variable_GetRawValue,
/* ID3D10EffectVectorVariable methods */
d3d10_effect_vector_variable_SetBoolVector,
d3d10_effect_vector_variable_SetIntVector,
d3d10_effect_vector_variable_SetFloatVector,
d3d10_effect_vector_variable_GetBoolVector,
d3d10_effect_vector_variable_GetIntVector,
d3d10_effect_vector_variable_GetFloatVector,
d3d10_effect_vector_variable_SetBoolVectorArray,
d3d10_effect_vector_variable_SetIntVectorArray,
d3d10_effect_vector_variable_SetFloatVectorArray,
d3d10_effect_vector_variable_GetBoolVectorArray,
d3d10_effect_vector_variable_GetIntVectorArray,
d3d10_effect_vector_variable_GetFloatVectorArray,
};
static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
{
FIXME("iface %p stub!\n", iface);