+ for(const PipelineState::BoundTexture &t: self.textures)
+ if(t.used && (t.binding>>20)==index)
+ {
+ image_ptr->sampler = handle_cast<::VkSampler>(t.sampler->handle);
+ image_ptr->imageView = handle_cast<::VkImageView>(t.texture->view_handle);
+ image_ptr->imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+
+ write_ptr->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+ write_ptr->dstBinding = t.binding&0xFFFFF;
+ write_ptr->descriptorCount = 1;
+ write_ptr->descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+ write_ptr->pImageInfo = image_ptr;
+
+ ++image_ptr;
+ ++write_ptr;
+ }
+
+ return n_writes;