Implement SetViewport and SetScissor

d3d11
Caleb Cornett 2023-10-12 08:18:53 -05:00 committed by cosmonaut
parent 740fb56aa1
commit d7290c5e2b
1 changed files with 30 additions and 2 deletions

View File

@ -1369,7 +1369,22 @@ static void D3D11_SetViewport(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_Viewport *viewport Refresh_Viewport *viewport
) { ) {
NOT_IMPLEMENTED D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*) commandBuffer;
D3D11_VIEWPORT vp =
{
viewport->x,
viewport->y,
viewport->w,
viewport->h,
viewport->minDepth,
viewport->maxDepth
};
ID3D11DeviceContext_RSSetViewports(
d3d11CommandBuffer->context,
1,
&vp
);
} }
static void D3D11_SetScissor( static void D3D11_SetScissor(
@ -1377,7 +1392,20 @@ static void D3D11_SetScissor(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_Rect *scissor Refresh_Rect *scissor
) { ) {
NOT_IMPLEMENTED D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*)commandBuffer;
D3D11_RECT rect =
{
scissor->x,
scissor->y,
scissor->x + scissor->w,
scissor->y + scissor->h
};
ID3D11DeviceContext_RSSetScissorRects(
d3d11CommandBuffer->context,
1,
&rect
);
} }
static void D3D11_BindVertexBuffers( static void D3D11_BindVertexBuffers(