Fix T64499: edit mode display glitch on Intel HD 4x00 and Windows 7/8
There may well be more vertex shaders that need this, but I couldn't find them in my testing. Differential Revision: https://developer.blender.org/D4921
This commit is contained in:
parent
ff3a20d1bc
commit
c06bd2d184
Notes:
blender-bot
2023-12-22 20:14:11 +01:00
Referenced by issue #65385, Blender 2.8 glitch in edit mode Referenced by issue #64499, Edit Mode - Intel HD 4x00 display glitch on Windows 7/8
|
@ -48,3 +48,11 @@ uniform mat4 ModelMatrixInverse;
|
|||
#define point_world_to_ndc(p) (ViewProjectionMatrix * vec4(p, 1.0))
|
||||
#define point_world_to_object(p) ((ModelMatrixInverse * vec4(p, 1.0)).xyz)
|
||||
#define point_world_to_view(p) ((ViewMatrix * vec4(p, 1.0)).xyz)
|
||||
|
||||
/* Due to some shader compiler bug, we somewhat need to access gl_VertexID
|
||||
* to make vertex shaders work. even if it's actually dead code. */
|
||||
#ifdef GPU_INTEL
|
||||
# define GPU_INTEL_VERTEX_SHADER_WORKAROUND gl_Position.x = float(gl_VertexID);
|
||||
#else
|
||||
# define GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,8 @@ flat out int vertFlag;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
gl_Position = point_world_to_ndc(world_pos);
|
||||
vertFlag = data;
|
||||
|
|
|
@ -9,6 +9,8 @@ out vec4 finalColor;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
if ((data & VERT_SELECTED) != 0) {
|
||||
if ((data & VERT_ACTIVE) != 0) {
|
||||
finalColor = colorEditMeshActive;
|
||||
|
|
|
@ -9,6 +9,8 @@ in float rad;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 final_pos = pos;
|
||||
|
||||
float flip = (gl_InstanceID != 0) ? -1.0 : 1.0;
|
||||
|
|
|
@ -22,6 +22,8 @@ vec2 proj(vec4 pos)
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
clipCase = 0;
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
|
|
|
@ -8,6 +8,8 @@ flat out vec4 faceColor;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
gl_Position = point_world_to_ndc(world_pos);
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ out vec4 weightColor;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
gl_Position = point_world_to_ndc(world_pos);
|
||||
weightColor = vec4(weight_color.rgb, 1.0);
|
||||
|
|
|
@ -20,6 +20,8 @@ out int selectOveride;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
|
||||
#if !defined(FACE)
|
||||
|
|
|
@ -21,6 +21,8 @@ flat out vec4 v2;
|
|||
|
||||
void main()
|
||||
{
|
||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||
|
||||
vec3 n = normalize(normal_object_to_world(nor));
|
||||
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
|
|
Loading…
Reference in New Issue