vulkan: partially implement mipmaps

There is no real effect yet when rendering, however debugging the
application with renderdoc reveals that the mipmap generation is
already correct. There's probably something weird going on with the
sampling. I'll have to look into that next.
This commit is contained in:
niki
2022-08-09 00:57:07 +02:00
parent 0ebb34e037
commit fbb64a07af
5 changed files with 140 additions and 82 deletions
+10 -10
View File
@@ -19,7 +19,7 @@ public:
virtual bool loadVolatile() override;
virtual void unloadVolatile() override;
void setSamplerState(const SamplerState &s) override;
void copyFromBuffer(graphics::Buffer* source, size_t sourceoffset, int sourcewidth, size_t size, int slice, int mipmap, const Rect& rect) override;
@@ -30,25 +30,25 @@ public:
void uploadByteData(PixelFormat pixelformat, const void* data, size_t size, int level, int slice, const Rect& r) override;
void generateMipmapsInternal() override { };
void generateMipmapsInternal() override;
int getMSAA() const override { return 0; };
ptrdiff_t getHandle() const override { return (ptrdiff_t)textureImage; }
private:
void createTextureImageView();
void clear(bool white);
void clear();
VkClearColorValue getClearValue(bool white);
graphics::Graphics* gfx;
VkDevice device;
VmaAllocator allocator;
graphics::Graphics* gfx = nullptr;
VkDevice device = VK_NULL_HANDLE;
VmaAllocator allocator = VK_NULL_HANDLE;
VkImage textureImage = VK_NULL_HANDLE;
VmaAllocation textureImageAllocation;
VkImageView textureImageView;
VkSampler textureSampler;
const Slices* data;
VmaAllocation textureImageAllocation = VK_NULL_HANDLE;
VkImageView textureImageView = VK_NULL_HANDLE;
VkSampler textureSampler = VK_NULL_HANDLE;
Slices slices;
int layerCount = 0;
};
} // vulkan