Vulkan: Create image views with right amount of mip levels.

This commit is contained in:
Hans-Kristian Arntzen 2016-07-31 14:01:39 +02:00
parent 4e8e79eabd
commit 0eca956789
2 changed files with 3 additions and 3 deletions

View File

@ -267,7 +267,7 @@ void vulkan_sync_texture_to_cpu(vk_t *vk, const struct vk_texture *tex)
static unsigned vulkan_num_miplevels(unsigned width, unsigned height)
{
unsigned size = width > height ? width : height;
unsigned size = MAX(width, height);
unsigned levels = 0;
while (size)
{
@ -488,7 +488,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk,
view.components.a = VK_COMPONENT_SWIZZLE_A;
}
view.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
view.subresourceRange.levelCount = 1;
view.subresourceRange.levelCount = info.mipLevels;
view.subresourceRange.layerCount = 1;
vkCreateImageView(device, &view, NULL, &tex.view);

View File

@ -241,7 +241,7 @@ static void vulkan_raster_font_flush(vulkan_raster_t *font)
const struct vk_draw_triangles call = {
font->vk->pipelines.font,
&font->texture,
font->vk->samplers.nearest,
font->vk->samplers.mipmap_linear,
&font->vk->mvp,
sizeof(font->vk->mvp),
&font->range,