Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printf: Don't do work when there is no printf instruction #9256

Conversation

spencer-lunarg
Copy link
Contributor

@spencer-lunarg spencer-lunarg commented Jan 17, 2025

Found using VK_LAYER_PRINTF_ONLY_PRESET slows down things way too much by default. With this change, find that when an app uses no printf in their shader (because assuming only 1 of there many pipelines will even have it) you regain near "normal" FPS again

note - VK_LAYER_PRINTF_ONLY_PRESET turns off everything but DebugPrintf just like vkconfig does

@spencer-lunarg spencer-lunarg requested a review from a team as a code owner January 17, 2025 17:37
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 349236.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18755 running.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18755 failed.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 349488.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 349517.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18761 running.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18761 passed.

Copy link
Contributor

@arno-lunarg arno-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is convoluted, a lot changes in different spots to simply express "don't try to setup instrumentation validation resources when bound pipeline has not been instrumented".
It shows that we still have problems with the architecture : /

layers/gpuav/instrumentation/gpuav_shader_instrumentor.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@arno-lunarg arno-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just go if (!last_bound.pipeline_state.instrumentation_data.was_instrumented) return; in <Pre, Post>CallSetupShaderInstrumentationResources?

@spencer-lunarg
Copy link
Contributor Author

It shows that we still have problems with the architecture : /

Honestly I don't know what to change?

  1. We need to instrument at PreCallRecordPipeline
  2. We need to save the state at PostCallRecordPipeline
  3. We need to refer to the data at Draw time to know if it is to skip or not

So we have 2 spots (between 1-and-2 and 2-and-3) to hold this state, not sure how else to get around it

@spencer-lunarg spencer-lunarg force-pushed the spencer-lunarg-debug-printf-needs-to-chill-when-not-used branch from 2ad9098 to 4c5844b Compare January 20, 2025 15:26
@spencer-lunarg spencer-lunarg merged commit cb3a540 into KhronosGroup:main Jan 20, 2025
20 checks passed
@spencer-lunarg spencer-lunarg deleted the spencer-lunarg-debug-printf-needs-to-chill-when-not-used branch January 20, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants