glasm: Optimize EmitVertex into EMIT

This commit is contained in:
ReinUsesLisp 2021-05-20 19:22:08 -03:00 committed by ameerj
parent 79929be833
commit 679e7146a7
1 changed files with 5 additions and 1 deletions

View File

@ -73,8 +73,12 @@ void EmitEpilogue(EmitContext& ctx) {
} }
void EmitEmitVertex(EmitContext& ctx, ScalarS32 stream) { void EmitEmitVertex(EmitContext& ctx, ScalarS32 stream) {
if (stream.type == Type::U32 && stream.imm_u32) {
ctx.Add("EMIT;");
} else {
ctx.Add("EMITS {};", stream); ctx.Add("EMITS {};", stream);
} }
}
void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) { void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) {
if (!stream.IsImmediate()) { if (!stream.IsImmediate()) {