MacOS/AMD glLinkProgram warnings (not errors) #58749

Closed
opened 2018-12-04 22:44:20 +01:00 by Niels · 3 comments

Hi. There seems to be a lot of issues with MacOS AMD drivers.

When running Blender 2.8 with apitrace a lot of the same warnings appear when glLinkProgram is done, but no glErrors are generated.

6013 @0 glLinkProgram(program = 55)
WARNING: Output of vertex shader 'uvcoordsvar' not read by fragment shader 

I think the problem is closely related to this:

GLSL shader not working on AMD/ATI, but works on NVIDIA

This is probably happening because you are specifying 3 input values for the shader (in_Position, in_Color and in_TextureCoord) but your vertex data does not always contain all 3. When the vertex attributes do not match this format exactly, you're getting into undefined behavior territory and each implementation can do what it wants.

Program #55 is the first one generating this warning.

** VERTEX SHADER: common_fullscreen_vert.glsl
//
in vec2 pos;
in vec2 uvs;
out vec4 uvcoordsvar;

void main()
{
	uvcoordsvar = vec4(uvs, 0.0, 0.0);
	gl_Position = vec4(pos, 1.0, 1.0);
}

** FRAGMENT SHADER: workbench_ghost_resolve_frag.glsl
//
uniform sampler2D depthBuffer;

void main(void)
{
	float depth = texelFetch(depthBuffer, ivec2(gl_FragCoord.xy), 0).r;

	/* background, discard */
	if (depth >= 1.0) {
		discard;
	}

	gl_FragDepth = depth;
}

Some more in sequence (if not mentioned, no warning):

#55:
	vs: common_fullscreen_vert.glsl
	fs: workbench_ghost_resolve_frag.glsl
#66:
	vs: common_fullscreen_vert.glsl
	fs: workbench_effect_taa_frag.glsl	
#98:
	vs: common_globals_lib.glsl + common_fullscreen_vert.glsl
	fs: common_globals_lib.glsl + object_outline_detect_frag.glsl
#101: 
	vs: common_globals_lib.glsl + common_fullscreen_vert.glsl
	fs: common_globals_lib.glsl + object_outline_detect_frag.glsl
#104:
	vs: common_fullscreen_vert.glsl
	fs: object_outline_expand_frag.glsl
#149:
	vs: common_fullscreen_vert.glsl
	fs: gpencil_zdepth_mix_frag.glsl	
#152:
	vs: common_fullscreen_vert.glsl
	fs: gpencil_simple_mix_frag.glsl

and a lot more...

Program #66 is related to #55987. (AMD Radeon Pro/R9/RX)

My guess would be that (only?) Apple's AMD glCompileShader removes unused variables, while all other implementations keeps them.

I have little knowledge of GLSL, but if someone has any ideas on how to fix this I could try them out.

Hi. There seems to be a lot of issues with MacOS AMD drivers. When running Blender 2.8 with `apitrace` a lot of the same warnings appear when `glLinkProgram` is done, but no glErrors are generated. ``` 6013 @0 glLinkProgram(program = 55) WARNING: Output of vertex shader 'uvcoordsvar' not read by fragment shader ``` I think the problem is closely related to this: > [GLSL shader not working on AMD/ATI, but works on NVIDIA](https://stackoverflow.com/a/26070648) > > This is probably happening because you are specifying 3 input values for the shader (in_Position, in_Color and in_TextureCoord) but your vertex data does not always contain all 3. When the vertex attributes do not match this format exactly, you're getting into undefined behavior territory and each implementation can do what it wants. Program #55 is the first one generating this warning. ``` ** VERTEX SHADER: common_fullscreen_vert.glsl // in vec2 pos; in vec2 uvs; out vec4 uvcoordsvar; void main() { uvcoordsvar = vec4(uvs, 0.0, 0.0); gl_Position = vec4(pos, 1.0, 1.0); } ** FRAGMENT SHADER: workbench_ghost_resolve_frag.glsl // uniform sampler2D depthBuffer; void main(void) { float depth = texelFetch(depthBuffer, ivec2(gl_FragCoord.xy), 0).r; /* background, discard */ if (depth >= 1.0) { discard; } gl_FragDepth = depth; } ``` Some more in sequence (if not mentioned, no warning): ``` #55: vs: common_fullscreen_vert.glsl fs: workbench_ghost_resolve_frag.glsl #66: vs: common_fullscreen_vert.glsl fs: workbench_effect_taa_frag.glsl #98: vs: common_globals_lib.glsl + common_fullscreen_vert.glsl fs: common_globals_lib.glsl + object_outline_detect_frag.glsl #101: vs: common_globals_lib.glsl + common_fullscreen_vert.glsl fs: common_globals_lib.glsl + object_outline_detect_frag.glsl #104: vs: common_fullscreen_vert.glsl fs: object_outline_expand_frag.glsl #149: vs: common_fullscreen_vert.glsl fs: gpencil_zdepth_mix_frag.glsl #152: vs: common_fullscreen_vert.glsl fs: gpencil_simple_mix_frag.glsl and a lot more... ``` Program #66 is related to `#55987`. (`AMD Radeon Pro/R9/RX`) My guess would be that (only?) Apple's AMD glCompileShader removes unused variables, while all other implementations keeps them. I have little knowledge of GLSL, but if someone has any ideas on how to fix this I could try them out.
Author

Added subscriber: @nielspl-2

Added subscriber: @nielspl-2
Clément Foucault was assigned by Jacques Lucke 2018-12-05 13:03:32 +01:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

This is not an error only a warning. As long as shader interface (in and out variables) matches the compilation / linking is ok.
We had to make sure the interface matches for eevee in the past so that's why there is many related warning.

This is not an error only a warning. As long as shader interface (in and out variables) matches the compilation / linking is ok. We had to make sure the interface matches for eevee in the past so that's why there is many related warning.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#58749
No description provided.