[Mesa-dev] [PATCH 07/23] mesa: glGetProgramResourceLocationIndex
Ilia Mirkin
imirkin at alum.mit.edu
Tue Mar 17 07:20:50 PDT 2015
On Tue, Mar 17, 2015 at 5:13 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
>
>
> On 03/16/2015 08:08 PM, Ilia Mirkin wrote:
>>
>> On Fri, Mar 13, 2015 at 4:37 AM, Tapani Pälli <tapani.palli at intel.com>
>> wrote:
>>> +/**
>>> + * Returns output index for dual source blending.
>>> + */
>>> GLint GLAPIENTRY
>>> _mesa_GetProgramResourceLocationIndex(GLuint program, GLenum
>>> programInterface,
>>> const GLchar *name)
>>> {
>>> - return -1;
>>> + GET_CURRENT_CONTEXT(ctx);
>>> + struct gl_shader_program *shProg =
>>> + lookup_linked_program(program,
>>> "glGetProgramResourceLocationIndex");
>>> +
>>> + if (!shProg || invalid_array_element_syntax(name))
>>> + return -1;
>>> +
>>> + /* From the GL_ARB_program_interface_query spec:
>>> + *
>>> + * "For GetProgramResourceLocationIndex, <programInterface> must be
>>> + * PROGRAM_OUTPUT."
>>> + */
>>
>>
>> And presumably it must be a program with a fragment shader (which
>> might not be there for a no-rast or compute pipeline).
>
>
> spec says that -1 is returned:
>
> "If <program> has been successfully linked but contains no fragment shader,
> no error will be generated but -1 will be returned."
>
> this is what happens with the implementation.
Can you explain how the current implementation takes care of that?
More information about the mesa-dev
mailing list