KhronosGroup / KhronosGroup/glslang

SPIR-V validation error when using dFdx/dFdy on float16_t type

Open
#4,143 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Sample code:
```glsl
#version 450
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require

layout(location = 0) in float input_var;
layout(location = 0) out float output_var;

void main()
{
float16_t input_var_float16 = float16_t(input_var);
float16_t input_var_ddx = dFdx(input_var_float16);
output_var = float(input_var_ddx);
}
```

Validation error printed through `--spirv-val`:
```
error: SPIRV-Tools Validation Errors
error: Result type component width must be 32 bits
%16 = OpDPdx %half %15
```

This operation doesn't seem to be supported by the SPIR-V spec.

Contributor guide

Open the contributing guide

Research direction

Reproduce the sample GLSL program and inspect the SPIR-V output produced when running --spirv-val. Check the SPIR-V specification and validation behavior for dFdx/dFdy with float16_t; done means the unsupported or incorrect behavior has a documented, agreed resolution and the validation result is consistent with it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.