From 6d75178870579ce363439d817cd9908ba3b5ecaf Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 28 Jan 2018 22:05:08 +0100 Subject: [PATCH] [d3d11] Remove default sampler This is handled in the backend now. --- src/d3d11/d3d11_context.cpp | 27 +-------------------------- src/d3d11/d3d11_context.h | 3 --- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 15889f1c..122d35c0 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -32,10 +32,6 @@ namespace dxvk { m_defaultDepthStencilState = static_cast(defaultDepthStencilState.ptr()); m_defaultRasterizerState = static_cast (defaultRasterizerState.ptr()); - // Create a default sampler that we're going to bind - // when the application binds null to a sampler slot. - m_defaultSampler = CreateDefaultSampler(); - EmitCs([ dev = m_device, bsState = m_defaultBlendState, @@ -1994,7 +1990,7 @@ namespace dxvk { cSlotId = slotId + i, cSampler = sampler != nullptr ? sampler->GetDXVKSampler() - : m_defaultSampler + : nullptr ] (DxvkContext* ctx) { ctx->bindResourceSampler(cSlotId, cSampler); }); @@ -2191,27 +2187,6 @@ namespace dxvk { } - Rc D3D11DeviceContext::CreateDefaultSampler() { - DxvkSamplerCreateInfo info; - info.minFilter = VK_FILTER_LINEAR; - info.magFilter = VK_FILTER_LINEAR; - info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; - info.mipmapLodBias = 0.0f; - info.mipmapLodMin = -256.0f; - info.mipmapLodMax = 256.0f; - info.useAnisotropy = VK_FALSE; - info.maxAnisotropy = 1.0f; - info.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - info.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - info.compareToDepth = VK_FALSE; - info.compareOp = VK_COMPARE_OP_NEVER; - info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; - info.usePixelCoord = VK_FALSE; - return m_device->createSampler(info); - } - - DxvkDataSlice D3D11DeviceContext::AllocUpdateBufferSlice(size_t Size) { constexpr size_t UpdateBufferSize = 4 * 1024 * 1024; diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index a8fa0726..fd33887c 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -519,7 +519,6 @@ namespace dxvk { Rc m_device; Rc m_csChunk; - Rc m_defaultSampler; Rc m_updateBuffer; Com m_defaultBlendState; @@ -564,8 +563,6 @@ namespace dxvk { void ApplyViewportState(); - Rc CreateDefaultSampler(); - DxvkDataSlice AllocUpdateBufferSlice(size_t Size); template