KhronosGroup / KhronosGroup/glslang

HLSL: support select() intristic

Open
#3,825 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement HLSL
Dominant language
C++
Stars
3.6k
Forks
990
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Hi! We need to add "select" intristic support
```
struct PS {
float4 pos : SV_POSITION;
float4 color : COLOR0;
};

PS main(in float4 pos : SV_POSITION, in float4 color : COLOR0) : SV_Target
{
PS o;
o.pos = pos;
o.color = select(pos.zzzz <= color, float4(0.0f, 0.0f, 0.0f, 0.0f), float4(1.0f, 1.0f, 1.0f, 1.0f));
return o;
}
```

glslang.exe -D -V -e main test.vert test.vert ERROR: test.vert:10: 'select' : no matching overloaded function found ERROR: test.vert:10: 'declaration' : Expected test.vert(10): error at column 101, HLSL parsing failed. ERROR: 3 compilation errors. No code generated.

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

Start by reproducing the failure with the provided test.vert source and the glslang.exe -D -V -e main invocation. Trace how HLSL intrinsic overloads are parsed and resolved, then add select() support and verify that this shader compiles without the reported errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.