Add validation for constant buffer initialization and unit test

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-15 15:01:20 +02:00
1 親 b866572173
コミット ec057ce7e4
3ファイル変更
+44 -2

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

@@ -200,7 +200,6 @@ partial struct PixelShaderEffect
opaqueInputs[i] = inputOpaqueSubRects[i].ToRectangle();
}
// TODO: shouldn't there be a check for the buffer being null?
ReadOnlySpan<byte> buffer = new(@this->constantBuffer, @this->constantBufferSize);
Rectangle output;
@@ -159,6 +159,13 @@ internal unsafe partial struct PixelShaderEffect
{
int hresult = S.S_OK;
// Validate the constant buffer
if (@this->constantBufferSize > 0 &&
@this->constantBuffer is null)
{
return E.E_NOT_VALID_STATE;
}
// First, set the constant buffer, if available
if (@this->constantBuffer is not null)
{