Implemented KRSampler::getSampler
This commit is contained in:
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
KRSampler::KRSampler(KRContext& context, const SamplerInfo& info)
|
KRSampler::KRSampler(KRContext& context, const SamplerInfo& info)
|
||||||
: KRContextObject(context)
|
: KRContextObject(context)
|
||||||
, m_sampler(VK_NULL_HANDLE)
|
|
||||||
{
|
{
|
||||||
// TODO - Implement stub function
|
// TODO - Implement stub function
|
||||||
}
|
}
|
||||||
@@ -44,7 +43,14 @@ KRSampler::~KRSampler()
|
|||||||
// TODO - Implement stub function
|
// TODO - Implement stub function
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSampler& KRSampler::getSampler()
|
VkSampler KRSampler::getSampler(KrDeviceHandle& handle)
|
||||||
{
|
{
|
||||||
return m_sampler;
|
for (std::pair<KrDeviceHandle, VkSampler> sampler : m_samplers) {
|
||||||
|
if (sampler.first == handle) {
|
||||||
|
return sampler.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO - Handle device context loss
|
||||||
|
assert(false);
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ public:
|
|||||||
KRSampler(KRContext& context, const SamplerInfo& info);
|
KRSampler(KRContext& context, const SamplerInfo& info);
|
||||||
virtual ~KRSampler();
|
virtual ~KRSampler();
|
||||||
|
|
||||||
VkSampler& getSampler();
|
VkSampler getSampler(KrDeviceHandle &handle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
typedef std::vector<std::pair<KrDeviceHandle, VkSampler>> SamplerSet;
|
||||||
VkSampler m_sampler;
|
SamplerSet m_samplers;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user