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

Ian Romanick idr at freedesktop.org
Fri Apr 18 13:28:33 PDT 2014


On 04/11/2014 04:29 PM, Eric Anholt wrote:
> 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.

You are correct.  Good catch.  I'll need to add that check and a piglit
test.

>  -- 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: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140418/589748e7/attachment.sig>


More information about the mesa-dev mailing list