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

[spirv] Move KHR ray tracing to use SPIRV 1.4 #2851

Closed
alelenv opened this issue Apr 24, 2020 · 3 comments · Fixed by #2877
Closed

[spirv] Move KHR ray tracing to use SPIRV 1.4 #2851

alelenv opened this issue Apr 24, 2020 · 3 comments · Fixed by #2877
Assignees
Labels
spirv Work related to SPIR-V

Comments

@alelenv
Copy link
Contributor

alelenv commented Apr 24, 2020

As per issue : https://gitlab.khronos.org/vulkan/vulkan/issues/2096
We have decided to enforce SPIRV 1.4 for KHR_ray_tracing

  1. Need to enforce vulkan env 1.2 for raytracing stages
  2. Compute interface variables used in entry points static call tree (Currently code assumes only single entry point and adds all global variables)

cc @ehsannas
I plan to look into this

@ehsannas
Copy link
Contributor

Sounds good. Thanks for the heads up @alelenv

@ehsannas ehsannas added the spirv Work related to SPIR-V label Apr 25, 2020
@dgkoch
Copy link

dgkoch commented Apr 26, 2020

Need to enforce vulkan env 1.2 for raytracing stages

SPIR-V 1.4 can actually be used prior to Vulkan 1.2 if VK_KHR_spirv_1_4 is supported.

@alelenv
Copy link
Contributor Author

alelenv commented May 6, 2020

Getting back to this

@dgkoch : spiregg selects spirv version based of -fspv-target-env which is either vulkan1.0/1.1/1.2. So selecting 1.2 to satisfy the > 1.4 SPIRV requirement

Question for @ehsanas

For something like
void func() { = gloVar2; }
void entry1() { = gloVar1;}~~
void entry2() { func() }

We currently add gloVar1 and gloVar2 to both entry1() and entry2() but as per " The set of Interface must be equal to or a superset of the global OpVariable Result referenced by the entry point’s static call tree, within the interface’s storage classes." it is not accurate

Initially I was planning on keeping track of global variables accessed in each function (By modifying getDeclEvalInfo) and functions reachable from given function and store it in FunctionInfo

Then at time of entry point creation, walk over all reachable functions from entry and maintain a set of accessed global variables to satisfy requirement for above

However I am unsure this is the right approach and instead maybe this should be one of the legalization passes in spirv-opt

Any thoughts/suggestions?

On re-reading the spec, it doesn't say its illegal to have all variables since it is a superset. So current implementation is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spirv Work related to SPIR-V
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants