You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 24_ColorSpaceTest/main.cpp
+14-59Lines changed: 14 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -120,50 +120,28 @@ class ColorSpaceTestSampleApp final : public examples::SimpleWindowedApplication
120
120
if (!m_semaphore)
121
121
returnlogFail("Failed to Create a Semaphore!");
122
122
123
-
// create the descriptor sets layout
123
+
/*
124
+
* We'll be using a combined image sampler for this example, which lets us assign both a sampled image and a sampler to the same binding.
125
+
* In this example we provide a sampler at descriptor set creation time, via the SBinding struct below. This specifies that the sampler for this binding is immutable,
126
+
* as evidenced by the name of the field in the SBinding.
127
+
* Samplers for combined image samplers can also be mutable, which for a binding of a descriptor set is specified also at creation time by leaving the immutableSamplers
@@ -377,6 +349,13 @@ class ColorSpaceTestSampleApp final : public examples::SimpleWindowedApplication
377
349
smart_refctd_ptr<IGPUImage> gpuImg;
378
350
auto ds = m_descriptorSets[resourceIx].get();
379
351
{
352
+
/*
353
+
* Since we're using a combined image sampler with an immutable sampler, we only need to update the sampled image at the binding. Do note however that had we chosen
354
+
* to use a mutable sampler instead, we'd need to write to it at least once, via the SDescriptorInfo info.info.combinedImageSampler.sampler field
355
+
* WARNING: With an immutable sampler on a combined image sampler, trying to write to it is valid according to Vulkan spec, although the sampler is ignored and only
356
+
* the image is updated. Please note that this is NOT the case in Nabla: if you try to write to a combined image sampler, then
357
+
* info.info.combinedImageSampler.sampler MUST be nullptr
0 commit comments