Support ID2D1Effect::GetValueSize for constant buffer, add unit test

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-16 14:05:25 +02:00
1 親 ecb28e2382
コミット ea2b314267
2ファイル変更
+48 -2

検索条件に一致するファイルはありません

+12 -2
ファイルの表示
@@ -69,13 +69,23 @@ unsafe partial struct PixelShaderEffect
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
private static int GetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
{
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
// This is a call likely from ID2D1Effect::GetValueSize, to query the property size
if (data is null &&
dataSize == 0 &&
actualSize is not null)
{
*actualSize = (uint)@this->constantBufferSize;
return S.S_FALSE;
}
if (data is null)
{
return E.E_POINTER;
}
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
if (dataSize < @this->constantBufferSize)
{
return E.E_NOT_SUFFICIENT_BUFFER;