[Mesa-dev] GLSL support for ARB_shader_stencil_export

Ian Romanick idr at freedesktop.org
Thu Oct 7 11:56:33 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Airlie wrote:
> http://cgit.freedesktop.org/~airlied/mesa/commit/?h=gallium-stencil-export&id=136bffc4e5c10ff4f2f4c240f552e8bff0b783e5
> 
> is my initial patch, but I know its wrong, so I'm wondering how to I
> add per-extension builtin-variables, or any example of this that
> exists already.

GL_ARB_draw_buffers adds a variable.  The right way to do this is to add
a function like generate_ARB_draw_buffers_variables (in ir_variable.cpp)
and call it from initialize_fs_variables if
ARB_shader_stencil_export_enable is set.  We did that for
GL_ARB_draw_buffers previous to 9c4b1f2b.

In glsl_parser_extras.cpp, the GL_ARB_shader_stencil_export code should
also set the 'unsupported' flag if the extension isn't supported by the
driver.  This should look like the code for
GL_ARB_fragment_coord_conventions or GL_EXT_texture_array.  Some of the
extensions don't that because they're always enabled (e.g.,
GL_ARB_texture_rectangle).  Otherwise shaders can say '#extension
GL_ARB_shader_stencil_export: require' on *any* driver, and compilation
will succeed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyuF90ACgkQX1gOwKyEAw9+ygCfZleh6qfZeBK6fngMkqJMkUEd
msYAn05nsD82XzlLczreaPs32HRm9Vht
=0i+z
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list