diff --git a/include/vsg/vk/Descriptor.h b/include/vsg/vk/Descriptor.h index b68475db64..b22df69904 100644 --- a/include/vsg/vk/Descriptor.h +++ b/include/vsg/vk/Descriptor.h @@ -83,7 +83,7 @@ namespace vsg }; /// transfer Data to graphics memory, returning ImageData configuration. - extern VSG_DECLSPEC vsg::ImageData transferImageData(Device* device, CommandPool* commandPool, VkQueue graphicsQueue, const Data* data); + extern VSG_DECLSPEC vsg::ImageData transferImageData(Device* device, CommandPool* commandPool, VkQueue graphicsQueue, const Data* data, Sampler* sampler = nullptr); using ImageDataList = std::vector; diff --git a/src/vsg/vk/Descriptor.cpp b/src/vsg/vk/Descriptor.cpp index 8d475e7102..3bddb64ad4 100644 --- a/src/vsg/vk/Descriptor.cpp +++ b/src/vsg/vk/Descriptor.cpp @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI using namespace vsg; -ImageData vsg::transferImageData(Device* device, CommandPool* commandPool, VkQueue graphicsQueue, const Data* data) +ImageData vsg::transferImageData(Device* device, CommandPool* commandPool, VkQueue graphicsQueue, const Data* data, Sampler* sampler) { if (!data) { @@ -107,7 +107,7 @@ ImageData vsg::transferImageData(Device* device, CommandPool* commandPool, VkQue imageStagingBuffer = 0; imageStagingMemory = 0; - ref_ptr textureSampler = Sampler::create(device); + ref_ptr textureSampler = sampler != nullptr ? Sampler::Result(sampler) : Sampler::create(device); ref_ptr textureImageView = ImageView::create(device, textureImage, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_ASPECT_COLOR_BIT); return ImageData(textureSampler, textureImageView, VK_IMAGE_LAYOUT_UNDEFINED);