forked from ShuriZma/suyu
1
0
Fork 0

glasm: Implement some graphics instructions on GLASM

This commit is contained in:
ReinUsesLisp 2021-05-15 18:15:50 -03:00 committed by ameerj
parent 31d402ee74
commit 1f3446b47e
2 changed files with 5 additions and 6 deletions

View File

@ -54,7 +54,7 @@ void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
if (IR::IsGeneric(attr)) { if (IR::IsGeneric(attr)) {
const u32 index{IR::GenericAttributeIndex(attr)}; const u32 index{IR::GenericAttributeIndex(attr)};
const u32 element{IR::GenericAttributeElement(attr)}; const u32 element{IR::GenericAttributeElement(attr)};
ctx.Add("MOV.F {}.x,in_attr{}.{};", inst, index, "xyzw"[element]); ctx.Add("MOV.F {}.x,in_attr{}[0].{};", inst, index, "xyzw"[element]);
return; return;
} }
throw NotImplementedException("Get attribute {}", attr); throw NotImplementedException("Get attribute {}", attr);
@ -66,7 +66,7 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value,
const char swizzle{"xyzw"[element]}; const char swizzle{"xyzw"[element]};
if (IR::IsGeneric(attr)) { if (IR::IsGeneric(attr)) {
const u32 index{IR::GenericAttributeIndex(attr)}; const u32 index{IR::GenericAttributeIndex(attr)};
ctx.Add("MOV.F out_attr{}.{},{};", index, swizzle, value); ctx.Add("MOV.F out_attr{}[0].{},{};", index, swizzle, value);
return; return;
} }
switch (attr) { switch (attr) {
@ -100,9 +100,8 @@ void EmitSetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch
throw NotImplementedException("GLASM instruction"); throw NotImplementedException("GLASM instruction");
} }
void EmitSetFragColor([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] u32 index, void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, ScalarF32 value) {
[[maybe_unused]] u32 component, [[maybe_unused]] ScalarF32 value) { ctx.Add("MOV.F frag_color{}.{},{};", index, "xyzw"[component], value);
throw NotImplementedException("GLASM instruction");
} }
void EmitSetSampleMask([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { void EmitSetSampleMask([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {

View File

@ -49,7 +49,7 @@ void EmitJoin(EmitContext& ctx) {
} }
void EmitDemoteToHelperInvocation(EmitContext& ctx) { void EmitDemoteToHelperInvocation(EmitContext& ctx) {
NotImplemented(); ctx.Add("KIL TR.x;");
} }
void EmitBarrier(EmitContext& ctx) { void EmitBarrier(EmitContext& ctx) {