[Mesa-dev] [PATCH 00/34] Preliminary front-end support for geometry shaders.

Paul Berry stereotype441 at gmail.com
Sun Jul 28 23:03:26 PDT 2013


This patch series implements preliminary front-end support for
geometry shaders in Mesa.  It is based on work done by myself, Bryan
Cain, Eric Anholt, and Fabian Bieler over the last several months.
For the patches that aren't mine, I've preserved the original
authorship information, and added notes in the commit messages to
indicate what I've changed.

It's a long series (34 patches), so here are some highlights if you're
just skimming:

Patch 05 adds ctx->Const.GeometryShaders150.  This acts like
ctx->Extensions.ARB_geometry_shader4, except that it represents the
variant of geometry shaders defined by GLSL 1.50, rather than the
variant defined by ARB_geometry_shader4.  This will allow back-ends to
choose whether to support one or the other or both.  This is important
because the two variants place different requirements on the back-end
(ARB_geometry_shader4 requires interactions with compatibility-only
features to work properly, and GLSL 1.50 requires support for a larger
number of varyings in GS-FS linkage).  Also, since front-end support
for GLSL 1.50 style geometry shaders is going to get finished before
front-end support for ARB_geometry_shader4, we'll need a way for
back-ends to enable just the GLSL 1.50 support that works.

Patches 06, 08, and 23-26 concern gallium support.  These patches are
mostly unchanged from Bryan Cain's original geometry shader series
(which was designed with gallium in mind).  So far I've done all my
testing using the Intel back-end.

Patch 11 adds most of the new language features to the parser, IR, and
linker.  Language features that are unique to GLSL 1.50 are postponed
until later in the series.

Patch 19 really only concerns ARB_geometry_shader4, however it's
clearly correct, so it seems silly not to include it as part of the
series.

Patches 28-31 implement features of geometry shaders that are unique
to GLSL 1.50, namely the use of "layout()" qualifiers to specify the
geometry shader input/output types and maximum number of output
vertices, and the use of interface blocks to support geometry shader
inputs.  Note that the built-in gl_in[] interface block doesn't work
properly yet.

Patch 34 introduces a warning message which is printed if the user
ever tries to create a geometry shader; it informs the user that
geomtry shader support is currently experimental.  Currently this code
is unreachable, since no back-ends enable geometry shader support yet.
However I'd like it to be in there just so that nobody gets the wrong
idea and tries to turn on geometry shaders before we have the rest of
the front end code written and properly tested.

The following things are known not to work:

- The gl_in interface block
- The gl_ClipDistance input
- Transform feedback of geometry shader outputs
- Constants that are new in GLSL 1.50 (e.g. gl_MaxGeometryInputComponents)

In addition, many features are not yet tested thoroughly enough.

This branch needs to be applied atop the series "glsl: Clean up linker
error checking.", which went out to mesa-dev on Saturday.  You can see
the entire series in its proper context in branch "gs-phase-1" of
https://github.com/stereotype441/mesa.git.  I have additional
unfinished patches in branch "gs" of the same repo, which implement
preliminary back-end geometry shader support for i965/gen7 (Ivy
Bridge).  Branch "gs" currently passes all 2030/2038 GLSL 1.50 piglit
tests (including some which have not yet landed).  Note that branch
"gs" is highly volatile.


[PATCH 01/34] glsl/linker: Make update_array_sizes apply to just uniforms.
[PATCH 02/34] glsl: Add EXT_texture_array support for geometry shaders.
[PATCH 03/34] glsl: Enable various extensions for geometry shaders.
[PATCH 04/34] main: Fix geometry shader error messages (missing right paren)
[PATCH 05/34] main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.
[PATCH 06/34] draw/gs: fix allocation of buffer for GS output vertices
[PATCH 07/34] mesa: account for geometry shader texture fetches in update_texture_state
[PATCH 08/34] mesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().
[PATCH 09/34] glsl: add ir_emitvertex and ir_endprim instruction types
[PATCH 10/34] glsl: add builtins for geometry shaders.
[PATCH 11/34] glsl: support compilation of geometry shaders
[PATCH 12/34] mesa: Refactor copying of linked program data.
[PATCH 13/34] mesa: Copy linked program data for GS.
[PATCH 14/34] glsl: Require geometry shader inputs to be arrays.
[PATCH 15/34] glsl/linker: Properly error check VS-GS linkage.
[PATCH 16/34] glsl/linker: Properly pack GS input varyings.
[PATCH 17/34] glsl: Modify varying packing to use a temporary exec_list.
[PATCH 18/34] glsl: Properly pack GS output varyings
[PATCH 19/34] mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.
[PATCH 20/34] mesa: Validate the drawing primitive against the geometry shader input primitive type.
[PATCH 21/34] glsl/linker: Fail to link geometry shader without vertex shader.
[PATCH 22/34] main: Fix delete_shader_cb() for geometry shaders
[PATCH 23/34] st/mesa, glsl_to_tgsi: add support for geometry shaders
[PATCH 24/34] gallivm: Fix indirect input fetches for gs.
[PATCH 25/34] gallium/draw: Pass primitive ID as integer to the shader.
[PATCH 26/34] mesa/st: Allow geometry shaders without gl_Position export.
[PATCH 27/34] glsl: Make sure that we don't put too many bitfields in ast_type_qualifier.
[PATCH 28/34] glsl: Parse the GLSL 1.50 GS layout qualifiers.
[PATCH 29/34] glsl: Export the compiler's GS layout qualifiers to the gl_shader.
[PATCH 30/34] glsl: Cross-validate GS layout qualifiers while intrastage linking.
[PATCH 31/34] glsl: Permit non-ubo input interface arrays to use non-const indexing.
[PATCH 32/34] glsl: Allow geometry shader input instance arrays to be unsized.
[PATCH 33/34] glsl: Implement rules for geometry shader input sizes.
[PATCH 34/34] main: Warn that geometry shader support is experimental.


More information about the mesa-dev mailing list