[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #9 from Allan Sandfeld Jensen  ---
The problem is the check in linker.cpp (link_fs_inout_layout_qualifiers):

   if (linked_shader->Stage != MESA_SHADER_FRAGMENT ||
   (prog->data->Version < 150 &&
!prog->ARB_fragment_coord_conventions_enable))
  return;

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #8 from Allan Sandfeld Jensen  ---
That would fix the parsing in compatibility shaders. It doesn't make it work.

I found after digging into mesa code that I needed:

#extension GL_ARB_fragment_coord_conventions : enable

Otherwise the layout qualifiers are only passed, but not passed on. I am not
sure if that is a bug, but there was nothing in the spec that suggested you
need to manually activate that extension as well to get it the layout qualifier
to work.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

Kenneth Graunke  changed:

   What|Removed |Added

 Resolution|--- |NOTABUG
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Kenneth Graunke  ---
layout qualifier parsing in legacy shaders should be fixed with:

commit 183ce5e629ee973d72a3e8b3361aa2de196cc203
Author: Kenneth Graunke 
Date:   Mon Feb 19 09:35:46 2018 -0800

glsl: Parse 'layout' as a token with advanced blending or bindless

Both KHR_blend_equation_advanced and ARB_bindless_texture provide
layout qualifiers, and are exposed in compatibility contexts.  We
need to parse the layout qualifier as a token in order for those
to work, but forgot to extend this check.

ARB_shader_image_load_store would need a similar treatment, but we
don't expose that in legacy OpenGL contexts.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105161
Reviewed-by: Iago Toral Quiroga 

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #6 from Allan Sandfeld Jensen  ---
Right. I think NVidia can get away with it because this requirement is new in
the KHR version, they also implement the original NV version which doesnt have
it (and like is OpenGL norm, they share the same GL defines).

Anyway since you are actually using the declaration and it has significant
impact in compile time of the shader, I withdraw my complaint and suggestion.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

Kenneth Graunke  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|mesa-dev@lists.freedesktop. |kenn...@whitecape.org
   |org |

--- Comment #5 from Kenneth Graunke  ---
Yep, the error is correct and required by the spec.  That's a bug in the NVIDIA
drivers, and it would be good to have a VK-GL-CTS test to enforce it.

The fact that layout qualifiers don't parse correctly in legacy shading
language versions is our bug.  I'll send a patch shortly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #4 from Ilia Mirkin  ---
Specifically, the ext spec says,

"""
A draw-time error will be generated in the OpenGL API if an application
attempts to render using an advanced blending equation without having a
matching layout qualifier specified in the active fragment shader.
"""

So pretty sure mesa is in the right here, and NVIDIA is buggy. (And as an
aside, the mesa implementation relies on the options being supplied properly,
since code is inserted conditionally into the shader. I'm guessing NVIDIA just
has a global library and doesn't care.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #3 from Ilia Mirkin  ---
The specification is available at

https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_blend_equation_advanced.txt

If you find the NVIDIA drivers doing something different than what's written
there, feel free to report the bug to them.

If you find mesa drivers doing something different, please do let us know.

If either implementation has a bug, it would also make sense to request a
VK-GL-CTS test that enforces the correct behavior
(https://github.com/KhronosGroup/VK-GL-CTS/issues).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #2 from Allan Sandfeld Jensen  ---
Note. I have been unable to get it to work at all in compatibility-mode desktop
OpenGL. The following code only works in core mode: 

#ifdef GL_KHR_blend_equation_advanced
#extension GL_KHR_blend_equation_advanced : require
layout(blend_support_all_equations) out;
#endif

because layout is not identified in basic OpenGL 2.0, and while

#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_explicit_attrib_location : enable
#extension GL_KHR_blend_equation_advanced : require
layout(blend_support_all_equations) out;
#endif

parses, it doesn't actually change anything. Mesa still reports: 
Mesa: User error: GL_INVALID_OPERATION in fragment shader does not allow
advanced blending mode (GL_MULTIPLY)

With NVidia drivers, I don't need any changes to fragment shaders.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

--- Comment #1 from Allan Sandfeld Jensen  ---
I traced the issue to this commit:

commit acf57fcf7ff7e60c3550da7b6dda7ad8b69195bd
Author: Kenneth Graunke 
Date:   Sat Aug 20 12:51:03 2016 -0700

mesa: Add draw time validation for advanced blending modes.

v2: Add null checks (requested by Curro).

Signed-off-by: Kenneth Graunke 
Reviewed-by: Francisco Jerez 

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105161] Validation of KHR_blend_equation_advanced stricter than NVidia

2018-02-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105161

Bug ID: 105161
   Summary: Validation of KHR_blend_equation_advanced stricter
than NVidia
   Product: Mesa
   Version: 17.3
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: k...@carewolf.com
QA Contact: mesa-dev@lists.freedesktop.org

I noticed your drivers are advertising support for blend_advanced and
blend_advanced_coherent, but couldn't understand why it still didn't work. I
traced it down to you enforcing that fragment shaders needs to enable which
advanced blend equation they work with, something the NVidia driver does not.

I think it would be in your best interest to only warn on that and not abort
the operation. If you can't do it correctly without that hint, that is of
course acceptable, it is there for a reason, but it seems you are only doing
the validation for the sake of strictness, and that is hurting your drivers
compatibility.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev