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

Determine correct behaviour for derivative in compute shaders #5443

Open
s-perron opened this issue Oct 16, 2023 · 2 comments
Open

Determine correct behaviour for derivative in compute shaders #5443

s-perron opened this issue Oct 16, 2023 · 2 comments

Comments

@s-perron
Copy link
Collaborator

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.

Here is a test that checks for the incorrect behaviour.

TEST_F(ValidateDerivatives, NoExecutionModeGLCompute) {
const std::string spirv = R"(
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%float = OpTypeFloat 32
%float4 = OpTypeVector %float 4
%undef = OpUndef %float4
%void_fn = OpTypeFunction %void
%main = OpFunction %void None %void_fn
%entry = OpLabel
%derivative = OpDPdy %float4 %undef
OpReturn
OpFunctionEnd
)";

If the validator behaviour is wrong, then the changes in #5430 will have to be updated as well.

@s-perron s-perron added the bug label Oct 16, 2023
@s-perron
Copy link
Collaborator Author

FYI: @dgkoch @jmacnak-nv.

@s-perron
Copy link
Collaborator Author

This issue was being discussed in the PR where it was first observed: #5430 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Optimizer
Awaiting triage
Validator
  
Awaiting triage
Development

No branches or pull requests

3 participants
@dgkoch @s-perron and others