shader: Implement PrimitiveId
This commit is contained in:
parent
183855e396
commit
b0f1255c8c
5 changed files with 10 additions and 0 deletions
|
@ -1021,6 +1021,9 @@ void EmitContext::DefineInputs(const Info& info) {
|
|||
fswzadd_lut_b =
|
||||
ConstantComposite(F32[4], f32_minus_one, f32_minus_one, f32_one, f32_minus_one);
|
||||
}
|
||||
if (info.loads_primitive_id) {
|
||||
primitive_id = DefineInput(*this, U32[1], false, spv::BuiltIn::PrimitiveId);
|
||||
}
|
||||
if (info.loads_position) {
|
||||
const bool is_fragment{stage != Stage::Fragment};
|
||||
const spv::BuiltIn built_in{is_fragment ? spv::BuiltIn::Position : spv::BuiltIn::FragCoord};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue