Skip to content
Snippets Groups Projects
Commit c9981574 authored by Faith Ekstrand's avatar Faith Ekstrand :speech_balloon: Committed by Dylan Baker
Browse files

compiler/types: Don't place members in the previous substruct's end padding


With the following structures :

  struct StructA
  {
     uint64_t value0;
     uint8_t  value1;
  };

  struct TopStruct
  {
     struct StructA a;
     uint8_t value3;
  };

Currently offsetof(struct TopStruct, value3) = 9. While the same code
on the CPU gives offsetof(struct TopStruct, value3) = 16.

This is impacting OpenCL kernels we're trying to use to build
acceleration structures.

v2: Add comment/link to some description of the alignment/size
    computation

Cc: mesa-stable
Signed-off-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: default avatarJason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <mesa/mesa!16940>
(cherry picked from commit 13362019)
parent 47a52576
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment