KhronosGroup / KhronosGroup/glslang

Feature request: HLSL invariant position output library/command-line option

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

Description

As far as I'm aware, HLSL does not have the equivalent of Invariant in SPIR-V. The HLSL precise keyword will produce SPIR-V with NoContraction, but there is no way to produce something that is Invariant. This can be necessary for multi-pass algorithms.

I would propose either:
1. Add a command-line + library option to enable invariant output on SV_Position
or
2. Add an additional modifier to HLSL 'invariant' that can be used just like 'precise', but produces Invariant instead of NoContraction

I guess another alternative would be to have the command-line/library flag treat precise as invariant.

Contributor guide

Open the contributing guide

Research direction

The request concerns HLSL handling, SV_Position output, SPIR-V invariant behavior, and command-line or library options, but it names no files or tests. Start by locating the HLSL compiler entry points and option handling, then determine which proposed behavior is accepted; done means the selected invariant-output approach works for the relevant multi-pass use case and is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.