Proper way to update Uniform or Push constant in AMD?

I made 2 code, based on basic examples
in first code - I do in loop
vkCmdUpdateBuffer to update uniform for draw
vkCmdDraw to draw
everything work in Nvidia driver, but AMD it does not

in second - I draw offscreen and bind this offscreen to other shader(in other comand bufer)
I do draw first offscreen_cmd with its own push_constants, end its _cmd
and vkUpdateDescriptorSets to bind offscreen FBO and second framebuffer_cmd with its own push_cnstants
everything work in Nvidia, but AMD does not

in AMD I have black screen in both examples, no crashes, just black screen, if I remove all updates of uniform(first code) and push_constants(second code) it start work in AMD

I miss something? how can I fix it?
AMD Vega drivers latest

thanks

That is not possible. vkCmdUpdateBuffer cannot be called within a renderpass instance, while vkCmdDraw must be called within a renderpass instance. So unless this loop also begins/ends a renderpass instance, you can’t do that. And your validation layers should have complained (you should always develop with at least some validation layers on).

okey thanks, il rework that code
I understand that onlymy code problem, because examples that update uniforms/push constants are work… just can not understand what I missing
anyway will rework code again

okey I found my error for second code (first was fixed by rewriting bad parts)

Error is:
in Nvidia if you do not initialize (VkPushConstantRange) push constants for layout
and just send them by vkCmdPushConstants … everything will work (wow)
(I miss initialization in one of FBO creation code…)
and everything will work!!! no errors no anything, it just work

in AMD that program crash (debug output does not help me, or I do something wrong with it)

so fixed, maybe this help someone else

Vulkan doesn’t give you errors. Vulkan validation layers give you errors. You should always use validation layers when developing Vulkan applications. It should have diagnosed this problem.

thanks, I understand that
for small code that I use now, much faster to make to debug using just that code, or rewriting it, it help me learning basics

setup some huge debug system, that may not even work on my sytem (like RenderDoc, that always crash even when I launch it on basic SaschaWillems demo apps)… and debug debug system or/and drivers that very broken(as always)… I waste on it in OpenGL too much time senging my bugreports… unpayed work its just waste of time, I do not like it…
so my point is-I do not know if Vulkan validation layer work at all, even if they work I do not know how helpful they are…

im not using AAA hardware, im use very cheap 4yo Nvidia and AMD Vega 8 integrated card(that has absolutely horrible drivers in Linux(ofc I test it on WIn also))… no one care about this low tier hardware, bugs are ignored, so “creating apps to make them just work as fast as I can” that what I do

Much faster? Judging by your posts, it took you 4 days at least to fix this. The validation layers would have caught the problem before you even tried it on AMD, let alone had to ask someone for help on it.

Validation layers are not part of the Vulkan implementation. They’re not part of the drivers; they’re as independent of the Vulkan implementation as your code is independent of the Vulkan implementation. It does not matter how out of date you feel the underlying implementation is; the validation layers are always current.

Writing Vulkan code without validation layers is like writing C++ without using a debugger. Yeah, you can do it, but it’s not a good idea. Especially when you’re just starting out.

il try Vulkan validation layers for sure, in next projects
thanks for info

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.