vulkan: Handle generating mipmaps for 1x1 images
Testcase included.
This commit is contained in:
@@ -245,7 +245,9 @@ gsk_gpu_render_pass_end_op_vk_command (GskGpuOp *op,
|
||||
|
||||
vkCmdEndRenderPass (state->vk_command_buffer);
|
||||
|
||||
if (gsk_gpu_image_get_flags (self->target) & GSK_GPU_IMAGE_CAN_MIPMAP)
|
||||
if ((gsk_gpu_image_get_flags (self->target) & GSK_GPU_IMAGE_CAN_MIPMAP) &&
|
||||
(gsk_gpu_image_get_width (self->target) > 1 ||
|
||||
gsk_gpu_image_get_height (self->target) > 1))
|
||||
{
|
||||
vkCmdPipelineBarrier (state->vk_command_buffer,
|
||||
gsk_vulkan_image_get_vk_pipeline_stage (GSK_VULKAN_IMAGE (self->target)),
|
||||
|
||||
@@ -71,7 +71,7 @@ static inline guint
|
||||
gsk_vulkan_mipmap_levels (gsize width,
|
||||
gsize height)
|
||||
{
|
||||
return g_bit_nth_msf (MAX (width, height) - 1, -1) + 1;
|
||||
return g_bit_nth_msf (MAX (MAX (width, height) - 1, 1), -1) + 1;
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
7
testsuite/gsk/compare/mipmap-with-1x1.node
Normal file
7
testsuite/gsk/compare/mipmap-with-1x1.node
Normal file
@@ -0,0 +1,7 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 10 10;
|
||||
filter: trilinear;
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4z8DwHwAFAAH/q842\
|
||||
iQAAAABJRU5ErkJggg==\
|
||||
");
|
||||
}
|
||||
BIN
testsuite/gsk/compare/mipmap-with-1x1.png
Normal file
BIN
testsuite/gsk/compare/mipmap-with-1x1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 B |
@@ -104,6 +104,7 @@ compare_render_tests = [
|
||||
'mask-modes-with-alpha',
|
||||
'mask-texture-color-alpha',
|
||||
'mipmap-generation-later',
|
||||
'mipmap-with-1x1',
|
||||
'nested-rounded-clips',
|
||||
'offscreen-forced-downscale',
|
||||
'offscreen-fractional-translate-nogl',
|
||||
|
||||
Reference in New Issue
Block a user