glasm: Implement SetAttribute ViewportMask
This commit is contained in:
parent
9bd0531384
commit
3a2dd1b483
|
@ -286,7 +286,8 @@ void SetupOptions(const IR::Program& program, const Profile& profile,
|
||||||
if (info.uses_sparse_residency) {
|
if (info.uses_sparse_residency) {
|
||||||
header += "OPTION EXT_sparse_texture2;";
|
header += "OPTION EXT_sparse_texture2;";
|
||||||
}
|
}
|
||||||
if ((info.stores_viewport_index || info.stores_layer) && stage != Stage::Geometry) {
|
if (((info.stores_viewport_index || info.stores_layer) && stage != Stage::Geometry) ||
|
||||||
|
info.stores_viewport_mask) {
|
||||||
if (profile.support_viewport_index_layer_non_geometry) {
|
if (profile.support_viewport_index_layer_non_geometry) {
|
||||||
header += "OPTION NV_viewport_array2;";
|
header += "OPTION NV_viewport_array2;";
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,14 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value,
|
||||||
"Viewport stored outside of geometry shader not supported by device");
|
"Viewport stored outside of geometry shader not supported by device");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case IR::Attribute::ViewportMask:
|
||||||
|
// NV_viewport_array2 is required to access result.viewportmask, regardless of shader stage.
|
||||||
|
if (ctx.profile.support_viewport_index_layer_non_geometry) {
|
||||||
|
ctx.Add("MOV.F result.viewportmask[0].x,{};", value);
|
||||||
|
} else {
|
||||||
|
LOG_WARNING(Shader_GLASM, "Device does not support storing to ViewportMask");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case IR::Attribute::PointSize:
|
case IR::Attribute::PointSize:
|
||||||
ctx.Add("MOV.F result.pointsize.x,{};", value);
|
ctx.Add("MOV.F result.pointsize.x,{};", value);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue