Skip to content

Commit

Permalink
Merge pull request vsg-dev#38 from tomhog/master
Browse files Browse the repository at this point in the history
Added external sampler to transferImageData function
  • Loading branch information
vsg-dev authored Feb 13, 2019
2 parents c3b5102 + ef78210 commit 97e1f68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/vsg/vk/Descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImageData>;

Expand Down
4 changes: 2 additions & 2 deletions src/vsg/vk/Descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -107,7 +107,7 @@ ImageData vsg::transferImageData(Device* device, CommandPool* commandPool, VkQue
imageStagingBuffer = 0;
imageStagingMemory = 0;

ref_ptr<Sampler> textureSampler = Sampler::create(device);
ref_ptr<Sampler> textureSampler = sampler != nullptr ? Sampler::Result(sampler) : Sampler::create(device);
ref_ptr<ImageView> textureImageView = ImageView::create(device, textureImage, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_ASPECT_COLOR_BIT);

return ImageData(textureSampler, textureImageView, VK_IMAGE_LAYOUT_UNDEFINED);
Expand Down

0 comments on commit 97e1f68

Please sign in to comment.