X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=external%2Fvulkancts%2Fmodules%2Fvulkan%2Ftexture%2FvktTextureTestUtil.hpp;h=7b1fc927a281450b39f58c2ca18e4720a8574dee;hb=a598fe87ca4c1e4e1b743c12750fde3c835c604b;hp=4f1af618dfee4ba179fb9233a0e2eb5cffd15bd9;hpb=9fb2b68d64539d1067ea74afabb1f6a9b7ee734a;p=platform%2Fupstream%2FVK-GL-CTS.git diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp index 4f1af61..7b1fc92 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp @@ -133,26 +133,43 @@ public: TYPE_LAST }; - TextureBinding (Context& context); - TextureBinding (Context& context, const TestTextureSp& textureData, const Type type); - vk::VkImage getImage (void) { return *m_textureImage; } - vk::VkImageView getImageView (void) { return *m_textureImageView; } - Type getType (void) { return m_type; } - const pipeline::TestTexture& getTestTexture (void) { return *m_textureData; } - void updateTextureViewMipLevels (deUint32 baseLevel, deUint32 maxLevel); -private: - TextureBinding (const TextureBinding&); // not allowed! - TextureBinding& operator= (const TextureBinding&); // not allowed! + enum ImageBackingMode + { + IMAGE_BACKING_MODE_REGULAR = 0, + IMAGE_BACKING_MODE_SPARSE, - void updateTextureData (const TestTextureSp& textureData, const Type type); + IMAGE_BACKING_MODE_LAST + }; + TextureBinding (Context& context); + TextureBinding (Context& context, const TestTextureSp& textureData, const Type type, + const ImageBackingMode backingMode = IMAGE_BACKING_MODE_REGULAR); + vk::VkImage getImage (void) { return *m_textureImage; } + vk::VkImageView getImageView (void) { return *m_textureImageView; } + Type getType (void) { return m_type; } + const pipeline::TestTexture& getTestTexture (void) { return *m_textureData; } + void updateTextureViewMipLevels (deUint32 baseLevel, deUint32 maxLevel); - Context& m_context; - Type m_type; - TestTextureSp m_textureData; - vk::Move m_textureImage; - de::MovePtr m_textureImageMemory; - vk::Move m_textureImageView; +private: + TextureBinding (const TextureBinding&); // not allowed! + TextureBinding& operator= (const TextureBinding&); // not allowed! + + void updateTextureData (const TestTextureSp& textureData, const Type type); + vk::Allocator* createAllocator (void) const; + vk::Move createDevice (void) const; + + Context& m_context; + const deUint32 m_queueFamilyIndex; + Type m_type; + ImageBackingMode m_backingMode; + TestTextureSp m_textureData; + vk::Move m_textureImage; + de::MovePtr m_textureImageMemory; + vk::Move m_textureImageView; + vk::Unique m_device; + vk::DeviceDriver m_deviceInterface; + const de::UniquePtr m_allocator; + std::vector > m_allocations; }; typedef de::SharedPtr TextureBindingSp; @@ -173,16 +190,20 @@ public: const float maxAnisotropy); void clearImage (vk::VkImage image); - void add2DTexture (const TestTexture2DSp& texture); + void add2DTexture (const TestTexture2DSp& texture, + TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture2D& get2DTexture (int textureIndex) const; - void addCubeTexture (const TestTextureCubeSp& texture); + void addCubeTexture (const TestTextureCubeSp& texture, + TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTextureCube& getCubeTexture (int textureIndex) const; - void add2DArrayTexture (const TestTexture2DArraySp& texture); + void add2DArrayTexture (const TestTexture2DArraySp& texture, + TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture2DArray& get2DArrayTexture (int textureIndex) const; - void add3DTexture (const TestTexture3DSp& texture); + void add3DTexture (const TestTexture3DSp& texture, + TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture3D& get3DTexture (int textureIndex) const; void setViewport (float viewportX, float viewportY, float viewportW, float viewportH);