[Mesa-dev] [PATCH v2] glsl/linker: Allow unused in blocks which are not declated on previous stage
Vadym Shovkoplias
vadym.shovkoplias at globallogic.com
Mon Aug 27 09:12:31 UTC 2018
Hi Timothy, Alejandro, Marek,
Thanks for review! Can we merge the patch now ?
On Mon, Aug 27, 2018 at 6:08 AM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:
> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
>
>
> On 24/08/18 18:25, Alejandro Piñeiro wrote:
>
>> CCing Timothy just in case he still thinks that the original comment
>> should remain as it is. In any case, it looks to me, so:
>>
>> Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
>>
>>
>> On 23/08/18 12:12, vadym.shovkoplias wrote:
>>
>>> From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
>>>
>>> "Only the input variables that are actually read need to be written
>>> by the previous stage; it is allowed to have superfluous
>>> declarations of input variables."
>>>
>>> Fixes:
>>> * interstage-multiple-shader-objects.shader_test
>>>
>>> v2:
>>> Update comment in ir.h since the usage of "used" field
>>> has been extended.
>>>
>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101247
>>> Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias at globallogic.com>
>>> ---
>>> src/compiler/glsl/ir.h | 4 ++--
>>> src/compiler/glsl/link_interface_blocks.cpp | 8 +++++++-
>>> 2 files changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
>>> index 67b38f48ef..d05d1998a5 100644
>>> --- a/src/compiler/glsl/ir.h
>>> +++ b/src/compiler/glsl/ir.h
>>> @@ -667,8 +667,8 @@ public:
>>> * variable has been used. For example, it is an error to
>>> redeclare a
>>> * variable as invariant after it has been used.
>>> *
>>> - * This is only maintained in the ast_to_hir.cpp path, not in
>>> - * Mesa's fixed function or ARB program paths.
>>> + * This is maintained in the ast_to_hir.cpp path and during
>>> linking,
>>> + * but not in Mesa's fixed function or ARB program paths.
>>> */
>>> unsigned used:1;
>>> diff --git a/src/compiler/glsl/link_interface_blocks.cpp
>>> b/src/compiler/glsl/link_interface_blocks.cpp
>>> index e5eca9460e..801fbcd5d9 100644
>>> --- a/src/compiler/glsl/link_interface_blocks.cpp
>>> +++ b/src/compiler/glsl/link_interface_blocks.cpp
>>> @@ -417,9 +417,15 @@ validate_interstage_inout_blocks(struct
>>> gl_shader_program *prog,
>>> * write to any of the pre-defined outputs (e.g. if the vertex
>>> shader
>>> * does not write to gl_Position, etc), which is allowed and
>>> results in
>>> * undefined behavior.
>>> + *
>>> + * From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
>>> + *
>>> + * "Only the input variables that are actually read need to be
>>> written
>>> + * by the previous stage; it is allowed to have superfluous
>>> + * declarations of input variables."
>>> */
>>> if (producer_def == NULL &&
>>> - !is_builtin_gl_in_block(var, consumer->Stage)) {
>>> + !is_builtin_gl_in_block(var, consumer->Stage) &&
>>> var->data.used) {
>>> linker_error(prog, "Input block `%s' is not an output of "
>>> "the previous stage\n",
>>> var->get_interface_type()->name);
>>> return;
>>>
>>
>> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
--
Vadym Shovkoplias | Senior Software Engineer
GlobalLogic
P +380.57.766.7667 M +3.8050.931.7304 S vadym.shovkoplias
www.globallogic.com
<http://www.globallogic.com/>
http://www.globallogic.com/email_disclaimer.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180827/53d2ea7c/attachment-0001.html>
More information about the mesa-dev
mailing list