Implemented KRSampler::getSampler
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
|
||||
KRSampler::KRSampler(KRContext& context, const SamplerInfo& info)
|
||||
: KRContextObject(context)
|
||||
, m_sampler(VK_NULL_HANDLE)
|
||||
{
|
||||
// TODO - Implement stub function
|
||||
}
|
||||
@@ -44,7 +43,14 @@ KRSampler::~KRSampler()
|
||||
// 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);
|
||||
virtual ~KRSampler();
|
||||
|
||||
VkSampler& getSampler();
|
||||
VkSampler getSampler(KrDeviceHandle &handle);
|
||||
|
||||
private:
|
||||
|
||||
VkSampler m_sampler;
|
||||
typedef std::vector<std::pair<KrDeviceHandle, VkSampler>> SamplerSet;
|
||||
SamplerSet m_samplers;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user