diff --git a/GPU/D3D11/D3D11Util.cpp b/GPU/D3D11/D3D11Util.cpp index fe63c99653..ce0bbd0b5b 100644 --- a/GPU/D3D11/D3D11Util.cpp +++ b/GPU/D3D11/D3D11Util.cpp @@ -109,38 +109,7 @@ HRESULT CreateGeometryShaderD3D11(ID3D11Device *device, const char *code, size_t } void StockObjectsD3D11::Create(ID3D11Device *device) { - D3D11_BLEND_DESC blend_desc{}; - blend_desc.RenderTarget[0].BlendEnable = false; - blend_desc.IndependentBlendEnable = false; - for (int i = 0; i < 16; i++) { - blend_desc.RenderTarget[0].RenderTargetWriteMask = i; - ASSERT_SUCCESS(device->CreateBlendState(&blend_desc, &blendStateDisabledWithColorMask[i])); - } - - D3D11_DEPTH_STENCIL_DESC depth_desc{}; - depth_desc.DepthEnable = FALSE; - ASSERT_SUCCESS(device->CreateDepthStencilState(&depth_desc, &depthStencilDisabled)); - depth_desc.StencilEnable = TRUE; - depth_desc.StencilReadMask = 0xFF; - depth_desc.StencilWriteMask = 0xFF; - depth_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE; - depth_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_REPLACE; - depth_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_REPLACE; - depth_desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; - depth_desc.BackFace = depth_desc.FrontFace; - ASSERT_SUCCESS(device->CreateDepthStencilState(&depth_desc, &depthDisabledStencilWrite)); - - D3D11_RASTERIZER_DESC raster_desc{}; - raster_desc.FillMode = D3D11_FILL_SOLID; - raster_desc.CullMode = D3D11_CULL_NONE; - raster_desc.ScissorEnable = FALSE; - raster_desc.DepthClipEnable = TRUE; // the default! FALSE is unsupported on D3D11 level 9 - ASSERT_SUCCESS(device->CreateRasterizerState(&raster_desc, &rasterStateNoCull)); - D3D11_SAMPLER_DESC sampler_desc{}; - sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; - sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; - sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; sampler_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; for (int i = 0; i < 4; i++) @@ -149,27 +118,15 @@ void StockObjectsD3D11::Create(ID3D11Device *device) { sampler_desc.MaxLOD = FLT_MAX; sampler_desc.MipLODBias = 0.0f; sampler_desc.MaxAnisotropy = 1; - ASSERT_SUCCESS(device->CreateSamplerState(&sampler_desc, &samplerPoint2DWrap)); - sampler_desc.Filter = D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT; - ASSERT_SUCCESS(device->CreateSamplerState(&sampler_desc, &samplerLinear2DWrap)); sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; - sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; ASSERT_SUCCESS(device->CreateSamplerState(&sampler_desc, &samplerPoint2DClamp)); sampler_desc.Filter = D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT; ASSERT_SUCCESS(device->CreateSamplerState(&sampler_desc, &samplerLinear2DClamp)); } void StockObjectsD3D11::Destroy() { - for (int i = 0; i < 16; i++) { - blendStateDisabledWithColorMask[i].Reset(); - } - depthStencilDisabled.Reset(); - depthDisabledStencilWrite.Reset(); - rasterStateNoCull.Reset(); - samplerPoint2DWrap.Reset(); - samplerLinear2DWrap.Reset(); samplerPoint2DClamp.Reset(); samplerLinear2DClamp.Reset(); } diff --git a/GPU/D3D11/D3D11Util.h b/GPU/D3D11/D3D11Util.h index 99c338f6b1..f38639ff4e 100644 --- a/GPU/D3D11/D3D11Util.h +++ b/GPU/D3D11/D3D11Util.h @@ -85,12 +85,6 @@ public: void Create(ID3D11Device *device); void Destroy(); - Microsoft::WRL::ComPtr depthStencilDisabled; - Microsoft::WRL::ComPtr depthDisabledStencilWrite; - Microsoft::WRL::ComPtr blendStateDisabledWithColorMask[16]; - Microsoft::WRL::ComPtr rasterStateNoCull; - Microsoft::WRL::ComPtr samplerPoint2DWrap; - Microsoft::WRL::ComPtr samplerLinear2DWrap; Microsoft::WRL::ComPtr samplerPoint2DClamp; Microsoft::WRL::ComPtr samplerLinear2DClamp; };