mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Add D3D11 test helper for setting rasterizer state
This commit is contained in:
@@ -56,6 +56,8 @@ COM_SMARTPTR(ID3D11CommandList);
|
||||
|
||||
COM_SMARTPTR(ID3D11InputLayout);
|
||||
|
||||
COM_SMARTPTR(ID3D11Resource);
|
||||
|
||||
COM_SMARTPTR(ID3D11Buffer);
|
||||
|
||||
COM_SMARTPTR(ID3D11Query);
|
||||
|
||||
@@ -394,6 +394,44 @@ void D3D11GraphicsTest::RSSetViewport(D3D11_VIEWPORT view)
|
||||
ctx->RSSetViewports(1, &view);
|
||||
}
|
||||
|
||||
D3D11_RASTERIZER_DESC D3D11GraphicsTest::GetRasterState()
|
||||
{
|
||||
ID3D11RasterizerState *state = NULL;
|
||||
ctx->RSGetState(&state);
|
||||
|
||||
D3D11_RASTERIZER_DESC ret;
|
||||
|
||||
if(state)
|
||||
{
|
||||
state->GetDesc(&ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.FillMode = D3D11_FILL_SOLID;
|
||||
ret.CullMode = D3D11_CULL_BACK;
|
||||
ret.FrontCounterClockwise = FALSE;
|
||||
ret.DepthBias = 0;
|
||||
ret.DepthBiasClamp = 0.0f;
|
||||
ret.SlopeScaledDepthBias = 0.0f;
|
||||
ret.DepthClipEnable = TRUE;
|
||||
ret.ScissorEnable = FALSE;
|
||||
ret.MultisampleEnable = FALSE;
|
||||
ret.AntialiasedLineEnable = FALSE;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void D3D11GraphicsTest::SetRasterState(const D3D11_RASTERIZER_DESC &desc)
|
||||
{
|
||||
ID3D11RasterizerState *state = NULL;
|
||||
ctx->RSGetState(&state);
|
||||
|
||||
rastState = NULL;
|
||||
dev->CreateRasterizerState(&desc, &rastState);
|
||||
|
||||
ctx->RSSetState(rastState);
|
||||
}
|
||||
|
||||
D3D11_DEPTH_STENCIL_DESC D3D11GraphicsTest::GetDepthState()
|
||||
{
|
||||
ID3D11DepthStencilState *state = NULL;
|
||||
|
||||
@@ -141,6 +141,8 @@ struct D3D11GraphicsTest : public GraphicsTest
|
||||
|
||||
void ClearRenderTargetView(ID3D11RenderTargetView *rt, Vec4f col);
|
||||
|
||||
D3D11_RASTERIZER_DESC GetRasterState();
|
||||
void SetRasterState(const D3D11_RASTERIZER_DESC &desc);
|
||||
void RSSetViewport(D3D11_VIEWPORT view);
|
||||
|
||||
D3D11_DEPTH_STENCIL_DESC GetDepthState();
|
||||
@@ -161,6 +163,7 @@ struct D3D11GraphicsTest : public GraphicsTest
|
||||
D3D11_FEATURE_DATA_D3D11_OPTIONS1 opts1;
|
||||
|
||||
ID3D11DepthStencilStatePtr depthState;
|
||||
ID3D11RasterizerStatePtr rastState;
|
||||
|
||||
GraphicsWindow *mainWindow = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user