[Mesa-dev] [PATCH 10/19] linker: Allow geometry shader without vertex shader for separable programs

Eric Anholt eric at anholt.net
Fri Apr 11 16:29:05 PDT 2014


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/glsl/linker.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index ee07e89..e02ce87 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2161,7 +2161,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
>     /* Geometry shaders have to be linked with vertex shaders.
>      */
>     if (num_shaders[MESA_SHADER_GEOMETRY] > 0 &&
> -       num_shaders[MESA_SHADER_VERTEX] == 0) {
> +       num_shaders[MESA_SHADER_VERTEX] == 0 &&
> +       !prog->SeparateShader) {
>        linker_error(prog, "Geometry shader must be linked with "
>  		   "vertex shader\n");
>        goto done;

It looks like ARB_sso is relaxing things so that you're supposed to
check for this at draw time, but I don't see that happening.  That said,
this patch itself looks correct.

 -- Section 2.16, "Geometry Shaders" (page 153)

    Change the 4th paragraph:

    "A program object or program pipeline object that includes a
    geometry shader must also include a vertex shader. If the current
    program state has a geometry shader but no vertex shader at Begin or
    any command that implicitly calls Begin, an INVALID_OPERATION error
    will be generated."

...

Errors
...
    The INVALID_OPERATION error produced by LinkProgram if the program
    object has a geometry, tessellation control, or tessellation
    evalutations shader attached and no vertex shader attached is now
    produced at Begin time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140411/f86aecfe/attachment-0001.sig>


More information about the mesa-dev mailing list