diff --git a/util/test/demos/d3d11/d3d11_helpers.h b/util/test/demos/d3d11/d3d11_helpers.h index 1871a6b01..a7fcac24c 100644 --- a/util/test/demos/d3d11/d3d11_helpers.h +++ b/util/test/demos/d3d11/d3d11_helpers.h @@ -56,6 +56,8 @@ COM_SMARTPTR(ID3D11CommandList); COM_SMARTPTR(ID3D11InputLayout); +COM_SMARTPTR(ID3D11Resource); + COM_SMARTPTR(ID3D11Buffer); COM_SMARTPTR(ID3D11Query); diff --git a/util/test/demos/d3d11/d3d11_test.cpp b/util/test/demos/d3d11/d3d11_test.cpp index 872f5ee79..63eb244fa 100644 --- a/util/test/demos/d3d11/d3d11_test.cpp +++ b/util/test/demos/d3d11/d3d11_test.cpp @@ -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; diff --git a/util/test/demos/d3d11/d3d11_test.h b/util/test/demos/d3d11/d3d11_test.h index 92b6c8f4a..10b522507 100644 --- a/util/test/demos/d3d11/d3d11_test.h +++ b/util/test/demos/d3d11/d3d11_test.h @@ -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;