From 260e6fd46b6684a7f52a02073ce567003fc52045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 4 Feb 2022 19:34:43 +0100 Subject: Workbench: Fix unreported heavily quantized mesh due to driver issue Detected on `amdgpu-pro` libGL implementation. The workaround is to not use explicit location for vertex attributes. This is not a real problem as we don't rely on them for now. --- source/blender/gpu/opengl/gl_shader.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index e031047f844..f0a4b5b7f58 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -432,7 +432,9 @@ std::string GLShader::vertex_interface_declare(const ShaderCreateInfo &info) con ss << "\n/* Inputs. */\n"; for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) { - if (GLContext::explicit_location_support) { + if (GLContext::explicit_location_support && + /* Fix issue with amdgpu-pro + workbench_prepass_mesh_vert.glsl being quantized. */ + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) == false) { ss << "layout(location = " << attr.index << ") "; } ss << "in " << to_string(attr.type) << " " << attr.name << ";\n"; -- cgit v1.2.3