[Mesa-dev] [PATCH 15/23] glsl/ast: Generalize some sampler variable restrictions to all opaque types.

Paul Berry stereotype441 at gmail.com
Wed Dec 11 13:32:39 PST 2013


On 26 November 2013 00:02, Francisco Jerez <currojerez at riseup.net> wrote:

> No opaque types may be statically initialized in the shader, all
> opaque variables must be declared uniform or be part of an "in"
> function parameter declaration, no opaque types may be used as the
> return type of a function.
> ---
>  src/glsl/ast_to_hir.cpp | 45 ++++++++++++++++++++++++++-------------------
>  1 file changed, 26 insertions(+), 19 deletions(-)
>

I found two other places that need to be changed to use contains_opaque()
instead of contains_sampler():

- ast_process_structure_or_interface_block() contains a call to
contains_sampler() to make sure that samplers aren't used in interface
blocks.  GLSL 4.40 4.3.9 "Interface Blocks" says that opaque types are not
allowed inside interface blocks.

- ir_dereference::is_lvalue() contains a call to contains_sampler() to make
sure that types containing samplers aren't considered L-values.  GLSL 4.40
4.1.7 "Opaque Types" says that opaque variables cannot be treated as
L-values.

With those additional changes, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131211/58dd6b34/attachment.html>


More information about the mesa-dev mailing list