mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-15 19:52:53 +00:00
glasm: Implement clip distance stores
This commit is contained in:
parent
a5d978e91e
commit
394b96a2fe
|
@ -86,6 +86,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
|
||||||
if (info.stores_tess_level_inner) {
|
if (info.stores_tess_level_inner) {
|
||||||
Add("OUTPUT result_patch_tessinner[]={{result.patch.tessinner[0..1]}};");
|
Add("OUTPUT result_patch_tessinner[]={{result.patch.tessinner[0..1]}};");
|
||||||
}
|
}
|
||||||
|
if (info.stores_clip_distance) {
|
||||||
|
Add("OUTPUT result_clip[]={{result.clip[0..7]}};");
|
||||||
|
}
|
||||||
for (size_t index = 0; index < info.uses_patches.size(); ++index) {
|
for (size_t index = 0; index < info.uses_patches.size(); ++index) {
|
||||||
if (!info.uses_patches[index]) {
|
if (!info.uses_patches[index]) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -121,6 +121,18 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value,
|
||||||
case IR::Attribute::PositionW:
|
case IR::Attribute::PositionW:
|
||||||
ctx.Add("MOV.F result.position.{},{};", swizzle, value);
|
ctx.Add("MOV.F result.position.{},{};", swizzle, value);
|
||||||
break;
|
break;
|
||||||
|
case IR::Attribute::ClipDistance0:
|
||||||
|
case IR::Attribute::ClipDistance1:
|
||||||
|
case IR::Attribute::ClipDistance2:
|
||||||
|
case IR::Attribute::ClipDistance3:
|
||||||
|
case IR::Attribute::ClipDistance4:
|
||||||
|
case IR::Attribute::ClipDistance5:
|
||||||
|
case IR::Attribute::ClipDistance6:
|
||||||
|
case IR::Attribute::ClipDistance7: {
|
||||||
|
const u32 index{static_cast<u32>(attr) - static_cast<u32>(IR::Attribute::ClipDistance0)};
|
||||||
|
ctx.Add("MOV.F result.clip[{}].x,{};", index, value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case IR::Attribute::ViewportIndex:
|
case IR::Attribute::ViewportIndex:
|
||||||
if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) {
|
if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) {
|
||||||
ctx.Add("MOV.F result.viewport.x,{};", value);
|
ctx.Add("MOV.F result.viewport.x,{};", value);
|
||||||
|
|
Loading…
Reference in a new issue