devwaker / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Strict checking of "#extension EXT_draw_buffers" doesn't match native driver behavior #435

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Is ANGLE's strict requirement for the "#extension EXT_draw_buffers" directive 
required by the spec, or could ANGLE's implementation be relaxed so writing 
multiple color outputs works even if the directive is omitted?

Empirically, ANGLE seems stricter than NVIDIA drivers here, which arguably 
makes life harder for those developing webgl shaders.

===

Background: In chromium, when trying to implement a shader that used multiple 
render targets, we wound up with a fragment shader that was accepted on native 
Linux OpenGL drivers but corrupted when used on Angle DX11's implementation of 
EXT_DRAW_BUFFERS. The Chromium bug for that was 
https://code.google.com/p/chromium/issues/detail?id=249907

The fix (in Chromium) was to add a directive to the fragment shader as below:

#extension EXT_draw_buffers : enable

The shaders were developed on Linux, where the NVIDIA drivers worked without 
the directive; but those same shaders failed when used with ANGLE, resulting in 
illegal HLSL. 

Original issue reported on code.google.com by nick@chromium.org on 14 Jun 2013 at 10:24

GoogleCodeExporter commented 9 years ago
The requirement comes from the spec: "To use the GL_EXT_draw_buffers extension 
in a shader it must be enabled using the #extension directive."

This language appears not only in EXT_draw_buffers (still in draft, but a 
previous version which includes the language is viewable here: 
https://angleproject.googlecode.com/svn/trunk/extensions/EXT_draw_buffers.txt), 
but also in NV_draw_buffers 
(http://www.khronos.org/registry/gles/extensions/NV/NV_draw_buffers.txt), on 
which EXT_draw_buffers is partially based, so it's odd that the Nvidia drivers 
wouldn't impose the restriction.

Original comment by shannonw...@chromium.org on 14 Jun 2013 at 11:12

GoogleCodeExporter commented 9 years ago

Original comment by shannonw...@chromium.org on 24 Jun 2013 at 8:01