renderer_vulkan: ignore viewport stores on non-supporting drivers
This commit is contained in:
parent
d0d6abbc21
commit
a41e57d968
5 changed files with 11 additions and 1 deletions
|
@ -407,7 +407,7 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
|
|||
}
|
||||
ctx.AddCapability(spv::Capability::DemoteToHelperInvocation);
|
||||
}
|
||||
if (info.stores[IR::Attribute::ViewportIndex]) {
|
||||
if (info.stores[IR::Attribute::ViewportIndex] && profile.support_multi_viewport) {
|
||||
ctx.AddCapability(spv::Capability::MultiViewport);
|
||||
}
|
||||
if (info.stores[IR::Attribute::ViewportMask] && profile.support_viewport_mask) {
|
||||
|
|
|
@ -84,6 +84,10 @@ std::optional<OutAttr> OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) {
|
|||
}
|
||||
return std::nullopt;
|
||||
case IR::Attribute::ViewportIndex:
|
||||
if (!ctx.profile.support_multi_viewport) {
|
||||
LOG_WARNING(Shader, "Ignoring viewport index store on non-supporting driver");
|
||||
return std::nullopt;
|
||||
}
|
||||
if (ctx.profile.support_viewport_index_layer_non_geometry ||
|
||||
ctx.stage == Shader::Stage::Geometry) {
|
||||
return OutAttr{ctx.viewport_index, ctx.U32[1]};
|
||||
|
|
|
@ -43,6 +43,7 @@ struct Profile {
|
|||
bool support_gl_sparse_textures{};
|
||||
bool support_gl_derivative_control{};
|
||||
bool support_scaled_attributes{};
|
||||
bool support_multi_viewport{};
|
||||
|
||||
bool warp_size_potentially_larger_than_guest{};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue