Bug 107986

Summary: Black window when HiZ enabled
Product: Mesa Reporter: programmerjake
Component: Drivers/Vulkan/radeonAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: programmerjake
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: vktrace vulkan api trace

Description programmerjake 2018-09-18 22:46:25 UTC
Created attachment 141649 [details]
vktrace vulkan api trace

I'm building a Vulkan game, and I get a black window when I don't use RADV_DEBUG=nohiz unless the window area is less than about 250k px^2. If I resize the window to smaller than that, then it seems to work fine (except maybe for some probably unrelated sRGB/gamma issues) even if it's really tall and narrow or really wide and short.

It's possible I'm doing something wrong with the Vulkan API but I have not been able to find where I'm messing up.

I'd guess that there is a memory allocation issue when allocating more than a 256k px depth buffer.

I have a RX 580 8GB.
I'm running on Ubuntu Linux 18.04 with kernel 4.15.0-34-generic
I'm using Mesa git from oibaf's ppa using version 18.3~git1809181930.c9dbe5~oibaf~b
I have Xorg version 1:7.7+19ubuntu7.1

I've attached a vktrace using LunarG's Vulkan SDK at version 1.1.77.0

I can reproduce the problem using just the vktrace, but for those who are interested, my source code is available at https://github.com/programmerjake/hashlife3d at commit 9d43f3ba82ba5d3d721a81e61da4dfed20a2926b

I am using SDL 2.0.8 built from source as until recently, SDL's vulkan bindings were disabled in Debian's package.
Comment 1 programmerjake 2018-09-18 22:48:27 UTC
My code seems to be causing a crash in NVidia's Vulkan driver, see https://github.com/programmerjake/hashlife3d/issues/1#issuecomment-421829804
Comment 2 programmerjake 2018-09-19 00:00:15 UTC
note that the trace plays just fine using AMDVLK
Comment 3 Bas Nieuwenhuizen 2018-09-19 00:22:22 UTC
Well, can reproduce here using the provided application. I'll look into this later this week.
Comment 4 Samuel Pitoiset 2019-07-02 14:20:29 UTC
Should have been fixed by

commit 203f60ebf2f64dab3dc77ce9c098a6ae3d2aca43
Author: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Date:   Thu Jun 13 13:56:22 2019 +0200

    radv: emit framebuffer state from primary if secondary doesn't inherit it
    
    Otherwise fast color/depth clears can't work because they depend
    on the framebuffer.
    
    This fixes the following CTS (when the small hint is disabled):
    - dEQP-VK.geometry.layered.1d_array.secondary_cmd_buffer
    - dEQP-VK.geometry.layered.2d_array.secondary_cmd_buffer
    - dEQP-VK.geometry.layered.cube.secondary_cmd_buffer
    - dEQP-VK.geometry.layered.cube_array.secondary_cmd_buffer
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110810
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107986
    Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

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.