mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 00:59:12 +01:00
[glsl-in] Add support for gl_FragCoord / gl_FragDepth
And remove the ability to read gl_Position in fragment.
This commit is contained in:
1 parent
0b9af95793
commit
7a9fb864ad
1 file changed
+19
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user