diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 21:34:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 21:34:48 +0300 |
commit | 260e6fd46b6684a7f52a02073ce567003fc52045 (patch) | |
tree | e3de8baeb767f7556aa92b38ff0cecbfa04553ff /source/blender/gpu/opengl/gl_shader.cc | |
parent | 0446c9c87564ce233a8cb58a69c9ffa4a6f78969 (diff) |
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.
Diffstat (limited to 'source/blender/gpu/opengl/gl_shader.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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"; |