mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-15 15:20:06 +00:00
glsl: Conditionally use GL_EXT_shader_image_load_formatted
Fix for SULD.D
This commit is contained in:
parent
fb839061fb
commit
fc0db612ab
@ -206,6 +206,20 @@ void SetupOutPerVertex(EmitContext& ctx, std::string& header) {
|
|||||||
header += "out int gl_ViewportIndex;";
|
header += "out int gl_ViewportIndex;";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UsesTyplessImage(const Info& info) {
|
||||||
|
for (const auto& desc : info.image_buffer_descriptors) {
|
||||||
|
if (desc.format == ImageFormat::Typeless) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const auto& desc : info.image_descriptors) {
|
||||||
|
if (desc.format == ImageFormat::Typeless) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_,
|
EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_,
|
||||||
@ -281,8 +295,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
|
|||||||
|
|
||||||
void EmitContext::SetupExtensions(std::string&) {
|
void EmitContext::SetupExtensions(std::string&) {
|
||||||
// TODO: track this usage
|
// TODO: track this usage
|
||||||
header += "#extension GL_ARB_sparse_texture2 : enable\n"
|
header += "#extension GL_ARB_sparse_texture2 : enable\n";
|
||||||
"#extension GL_EXT_shader_image_load_formatted : enable\n";
|
|
||||||
if (profile.support_gl_texture_shadow_lod) {
|
if (profile.support_gl_texture_shadow_lod) {
|
||||||
header += "#extension GL_EXT_texture_shadow_lod : enable\n";
|
header += "#extension GL_EXT_texture_shadow_lod : enable\n";
|
||||||
}
|
}
|
||||||
@ -318,6 +331,9 @@ void EmitContext::SetupExtensions(std::string&) {
|
|||||||
stage != Stage::Geometry) {
|
stage != Stage::Geometry) {
|
||||||
header += "#extension GL_ARB_shader_viewport_layer_array : enable\n";
|
header += "#extension GL_ARB_shader_viewport_layer_array : enable\n";
|
||||||
}
|
}
|
||||||
|
if (UsesTyplessImage(info)) {
|
||||||
|
header += "#extension GL_EXT_shader_image_load_formatted : enable\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitContext::DefineConstantBuffers(Bindings& bindings) {
|
void EmitContext::DefineConstantBuffers(Bindings& bindings) {
|
||||||
|
Loading…
Reference in New Issue
Block a user