Bug 109822

Summary: Texture holes in simple vulkan examples.
Product: Mesa Reporter: Mike Mestnik <cheako+bugs_freedesktop_org>
Component: Drivers/Vulkan/radeonAssignee: mesa-dev
Status: RESOLVED NOTOURBUG QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Mike Mestnik 2019-03-03 19:30:08 UTC
System specs:
https://bugs.freedesktop.org/show_bug.cgi?id=109445

Plus zram-tools, giving a slight boost/addition to swap space.

https://github.com/cheako/cheako-vulkan/blob/v0.1/0005texture/vulkan.c

Got:
https://ibb.co/173StH6

Expected:
https://ibb.co/Ltz5vDh
Comment 1 Mike Mestnik 2019-03-03 19:30:34 UTC
All the examples with texture data are effected.
Comment 2 Mike Mestnik 2019-03-03 20:24:33 UTC
Validation layers reported Anisotropic was true but not enabled.  Also image layout is wrong.
Comment 3 Mike Mestnik 2019-03-03 21:13:48 UTC
I fixed the validation warnings and the bug remains.

Here is the corrected source.
https://github.com/cheako/cheako-vulkan/blob/16b794089cbffc63e81af66ae8fcb1cd118e607c/0005texture/vulkan.c

Changes are:
sampler_info.anisotropyEnable = VK_FALSE;

image_create_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;

Applied an image memor barrier to the first run.
        barriers[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
        barriers[0].dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
        barriers[0].oldLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
        barriers[0].newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
        barriers[0].image = texture_images[0];
        barriers[0].subresourceRange = (VkImageSubresourceRange){VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
Comment 4 Samuel Pitoiset 2019-05-06 09:47:31 UTC
Your thing doesn't build, also are you sure it's correct?

$ make
make -C lib 
make -C 0000tri 
make -C 0001uniform-buffer-object 
make -C 0002lighting 
make -C 0003index-buffer 
make -C 0004cube 
make -C 0005texture 
make -C 0006multi-model 
make -C 0007shared-ubo 
make -C 0008multi-material 
make -C 0009modify-instances-count 
make -C 0010tasks-during-render 
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/lib'
g++  -I../include  -c -o cimgui/cimgui/cimgui.o cimgui/cimgui/cimgui.cpp
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0000tri'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0000tri'
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0004cube'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0004cube'
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0001uniform-buffer-object'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0001uniform-buffer-object'
make: *** [Makefile:9: 0000tri] Error 2
make: *** Waiting for unfinished jobs....
make: *** [Makefile:9: 0004cube] Error 2
g++  -I../include  -c -o cimgui/cimgui/fontAtlas.o cimgui/cimgui/fontAtlas.cpp
make: *** [Makefile:9: 0001uniform-buffer-object] Error 2
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0002lighting'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0002lighting'
g++  -I../include  -c -o cimgui/cimgui/drawList.o cimgui/cimgui/drawList.cpp
make: *** [Makefile:9: 0002lighting] Error 2
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0003index-buffer'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0003index-buffer'
g++  -I../include  -c -o cimgui/cimgui/listClipper.o cimgui/cimgui/listClipper.cpp
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0005texture'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0005texture'
make: *** [Makefile:9: 0003index-buffer] Error 2
g++  -I../include  -c -o cimgui/imgui/imgui.o cimgui/imgui/imgui.cpp
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0006multi-model'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0006multi-model'
make: *** [Makefile:9: 0005texture] Error 2
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0007shared-ubo'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0007shared-ubo'
g++  -I../include  -c -o cimgui/imgui/imgui_draw.o cimgui/imgui/imgui_draw.cpp
make: *** [Makefile:9: 0006multi-model] Error 2
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0008multi-material'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0008multi-material'
make: *** [Makefile:9: 0007shared-ubo] Error 2
g++  -I../include  -c -o cimgui/imgui/imgui_demo.o cimgui/imgui/imgui_demo.cpp
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0009modify-instances-count'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0009modify-instances-count'
make: *** [Makefile:9: 0008multi-material] Error 2
g++  -Icimgui/imgui -I../include  -c -o cimgui/imgui/examples/vulkan_example/imgui_impl_glfw_vulkan.o cimgui/imgui/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
make: *** [Makefile:9: 0009modify-instances-count] Error 2
make[1]: *** No rule to make target 'imguicolortextedit/Makefile', needed by 'imguicolortextedit/libtexteditor.a'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Entering directory '/home/hakzsam/wip/cheako-vulkan/0010tasks-during-render'
make[1]: *** No rule to make target '../lib/vk_mem_alloc.a', needed by 'vulkan'.  Stop.
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/0010tasks-during-render'
make: *** [Makefile:9: 0010tasks-during-render] Error 2
make[1]: Leaving directory '/home/hakzsam/wip/cheako-vulkan/lib'
make: *** [Makefile:9: lib] Error 2
Comment 5 Samuel Pitoiset 2019-05-10 11:57:52 UTC
Closing, feel free to re-open if your issue still happens after fixing the build and after checking with Vulkan validation layers.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.