1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[dxvk] Pass device to sampler constructor

This commit is contained in:
Philip Rebohle 2020-05-04 13:40:17 +02:00
parent a968f29754
commit 7b81db2c75
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 8 additions and 5 deletions

View File

@ -151,7 +151,7 @@ namespace dxvk {
Rc<DxvkSampler> DxvkDevice::createSampler(
const DxvkSamplerCreateInfo& createInfo) {
return new DxvkSampler(m_vkd, createInfo);
return new DxvkSampler(this, createInfo);
}

View File

@ -1,11 +1,12 @@
#include "dxvk_sampler.h"
#include "dxvk_device.h"
namespace dxvk {
DxvkSampler::DxvkSampler(
const Rc<vk::DeviceFn>& vkd,
DxvkDevice* device,
const DxvkSamplerCreateInfo& info)
: m_vkd(vkd) {
: m_vkd(device->vkd()) {
VkSamplerCreateInfo samplerInfo;
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
@ -30,7 +31,7 @@ namespace dxvk {
|| samplerInfo.addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
|| samplerInfo.addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)
samplerInfo.borderColor = getBorderColor(info.compareToDepth, info.borderColor);
if (m_vkd->vkCreateSampler(m_vkd->device(),
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)
throw DxvkError("DxvkSampler::DxvkSampler: Failed to create sampler");

View File

@ -3,6 +3,8 @@
#include "dxvk_resource.h"
namespace dxvk {
class DxvkDevice;
/**
* \brief Sampler properties
@ -51,7 +53,7 @@ namespace dxvk {
public:
DxvkSampler(
const Rc<vk::DeviceFn>& vkd,
DxvkDevice* device,
const DxvkSamplerCreateInfo& info);
~DxvkSampler();