KhronosGroup / KhronosGroup/SPIRV-Tools

Determine correct behaviour for derivative in compute shaders

Open
#5,443 2 comments 0 reactions 1 assignee Claimed by @dgkoch View on GitHub
bug component:optimization component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

The validator does not allow derivative instructions in compute shader unless the entry point has either the DerivativeGroupQuadsNV or DerivativeGroupLinearNV execution mode. However, the specification for the extension says:

> If neither derivative group mode was specified, the derivatives return zero.

See [it here](https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_compute_shader_derivatives.html#:~:text=If%20neither%20derivative%20group%20mode%20was%20specified%2C%20the%20derivatives%20return%20zero.).

Here is a test that checks for the incorrect behaviour.

https://github.com/KhronosGroup/SPIRV-Tools/blob/661f429b11e4392139a6c0630ceb3e3182cdb0f4/test/val/val_derivatives_test.cpp#L163-L178

If the validator behaviour is wrong, then the changes in https://github.com/KhronosGroup/SPIRV-Tools/pull/5430 will have to be updated as well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.