Skip to content
Commit 33d33185 authored by Andres Gomez's avatar Andres Gomez Committed by Dylan Baker
Browse files

glsl/linker: simplify xfb_offset vs xfb_stride overflow check



Current implementation uses a complicated calculation which relies in
an implicit conversion to check the integral part of 2 division
results.

However, the calculation actually checks that the xfb_offset is
smaller or a multiplier of the xfb_stride. For example, while this is
expected to fail, it actually succeeds:

  "

    ...

    layout(xfb_buffer = 2, xfb_stride = 12) out block3 {
      layout(xfb_offset = 0) vec3 c;
      layout(xfb_offset = 12) vec3 d; // ERROR, requires stride of 24
    };

    ...

  "

Fixes: 2fab85aa ("glsl: add xfb_stride link time validation")
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: default avatarAndres Gomez <agomez@igalia.com>
Reviewed-by: default avatarTimothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit 422882e7)
parent 068e9a8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment