KhronosGroup / KhronosGroup/Vulkan-Samples

the shader in the sample mobile_nerf_rayquery probably produce underfined behaviour

Open
#1,566 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
5.4k
Forks
835
Avg merge
2h 16m
Merged PRs (30d)
1

Description

texture() compiles to OpImageSampleImplicitLod, which needs screen-space derivatives of the UV. Derivatives in a fragment shader are computed by differencing across the 2×2 quad, so they're only meaningful when all four invocations in the quad execute the instruction with comparable values.

Vulkan spec, "Derivative Operations": derivative operations (and implicit-LOD image ops, which are defined in terms of them) have undefined results unless invoked in quad-uniform control flow.

if (rayQueryGetIntersectionTypeEXT(...) != ...NoneEXT) is per-pixel: one pixel of a quad can hit while its neighbor misses. So texture sampling is inside non-quad-uniform control flow.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the shader used by the mobile_nerf_rayquery sample and inspect the texture() call guarded by rayQueryGetIntersectionTypeEXT(...). Confirm that the sample no longer performs an implicit-LOD texture sample in non-quad-uniform control flow; the issue does not name a test or validation command.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.