[glsl-in] Add support for gl_FragCoord / gl_FragDepth

And remove the ability to read gl_Position in fragment.
This commit is contained in:
Jasper St. Pierre
2021-07-02 10:36:47 -07:00
committed by João Capucho
parent 0b9af95793
commit 7a9fb864ad

View File

@@ -100,8 +100,27 @@ impl Program<'_> {
},
BuiltIn::Position,
true,
PrologueStage::empty(),
),
"gl_FragCoord" => add_builtin(
TypeInner::Vector {
size: VectorSize::Quad,
kind: ScalarKind::Float,
width: 4,
},
BuiltIn::Position,
false,
PrologueStage::FRAGMENT,
),
"gl_FragDepth" => add_builtin(
TypeInner::Scalar {
kind: ScalarKind::Float,
width: 4,
},
BuiltIn::FragDepth,
true,
PrologueStage::empty(),
),
"gl_VertexIndex" => add_builtin(
TypeInner::Scalar {
kind: ScalarKind::Uint,