Closed SRSaunders closed 2 months ago
Doesn't work for me. The sample now seems to be completely broken in any case :(
VK_API_VERSION_1_0
: Good framerate, but no output of vertex positions visibleVK_API_VERSION_1_1
: Unusable framerate (less than 1 fps), but output of vertex positions visibleTested with SDK 1.3.290.
Pinging @spencer-lunarg
https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/8323 should have fixed this, I'll pull down this change and test on the various things today to see what is going on
https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/8323 is not included in SDK 1.3.290, and will only fix the performance issue in future SDKs when it is included.
@SaschaWillems that is why I asked if you wanted me to put in a workaround in _shaderdebugprintf for previous SDKs. You answered no, so that is why this PR reverts to API 1.1 for all previous and current SDKs, and is the reason for the performance issue with SDKs <= 290. My workaround was to use Vulkan API 1.2 for previous SDKs <= 290, and API 1.1 for SDKs > 290. This would avoid performance issues for SDKs that don't have the above fix.
Please advise if you want this workaround added here.
Note that API 1.0 was always the wrong choice, since it should never have worked, and only worked for SDKs < 290 by chance. Even though 290 does not include the performance fix, it adds a check for debugPrintfEXT to be at least API 1.1. So that is why my workaround proposes using API 1.2 for SDKs up to and including 290, and API 1.1 for all future SDKs.
Perhaps it would be easier if I just add the workaround in an additional commit here, and you both can review.
This fixes the shader_debugprintf sample to work correctly with Vulkan SDKs >= 1.3.290 where the Validation Layer requires Vulkan API 1.1 to enable the debugPrintfEXTfeature
I guess this mislead me then?
Tbh. I'm a bit out of the loop and I'm having a hard time answering to requests like this ad hoc.
Can't we simply revert back to the initial state of the sample (when I wrote it)?
I guess this mislead me then?
Well, I guess I should have said >290 (and not >= 290). Sorry about that - my bad.
Can't we simply revert back to the initial state of the sample (when I wrote it)?
That won't help. Your original unmodified sample used Vulkan API 1.1 which will exhibit the same VVL performance issues as you are seeing now. You can blame me for moving back to API 1.0. I should have moved to API 1.2 at least until the VVL fix was made by @spencer-lunarg.
I am sorry if I have been commenting too frequently or asking too many questions given your other commitments. Perhaps you did not have time to appreciate the details of what I was asking.
I think it would be best for me to push the workaround that will fix this once and for all.
@SaschaWillems and @spencer-lunarg: Commit https://github.com/KhronosGroup/Vulkan-Samples/pull/1133/commits/c209e6b86f4a31342eac9a2fa017d54ed64efd08 should fix perf issues for sample _shaderdebugprintf.
In my testing this fixes performance and vertex visibility when using SDK 1.3.290 (and earlier). If you see otherwise, please let me know including the test conditions (e.g. SDK version, platform, etc.) that cause it.
I feel kinda dumb, but this only works for me when NOT using the debug printf setting via vkconfig. If I use that preset, I don't see any vertex position output. It's very much possible that I'm doing something wrong. but I'm not sure what. I'm not sure why the code has an if clause for the layer setting extension at all.
I'm kinda torn on whether we want to add temporary workarounds for bugs in the SDK.
Can't we simply wait for the fixed SDK to be released?
So I am still trying to grasp the conversation (and background here)
From my 1000-foot pole view, I would just have this requires Vulkan 1.2 (since there is enough 1.2 devices in the wild now) and when the next SDK comes out, just bump it down to 1.1
From my 1000-foot pole view, I would just have this requires Vulkan 1.2 (since there is enough 1.2 devices in the wild now) and when the next SDK comes out, just bump it down to 1.1
That’s effectively what this PR does. It just automates it at runtime so that you don’t have to go back later to change the code when a new SDK comes out, or worry about cases when running against a non-current SDK.
However if you are not happy with a runtime-based approach and instead prefer a static fix using API 1.2, please let me know and I can make the change.
Description
This fixes the _shaderdebugprintf sample to work correctly with Vulkan SDKs >= 1.3.290 where the Validation Layer requires Vulkan API >= 1.1 to enable the
debugPrintfEXT
feature. Earlier SDKs with older Validation Layers did not enforce this and could run with Vulkan API 1.0. This change also respects the upcoming Validation Layer performance fix for issue 7562 which caused slowdowns on SDKs <= 1.3.290 when using thedebugPrintfEXT
feature with the correct APi 1.1 version. VVL fix 8323 will be available in Vulkan SDKs > 1.3.290 and thus Vulkan API 1.1 can be used by this sample for these future SDKs without performance problems.UPDATE: This PR also contains a workaround for SDKs not yet containing the VVL performance fix above. For SDKs <= 1.3.290, this sample will now use Vulkan API 1.2 which does not exhibit the performance problem, and also satisfies the
debugPrintfEXT
layer feature which requires Vulkan API level >= 1.1 to function.Tested on macOS Ventura using: a) Vulkan SDKs 1.3.283 and 1.3.290 with their stock Validation Layers, and b) using a private build of the most recent Validation Layer containing the fix above.
Fixes #1132
General Checklist:
Please ensure the following points are checked:
[x] This PR describes the scope and expected impact of the changes I am making
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batch
command line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: