Merge pull request #2036 from ShchchowAMD/fix_atomic_uint_offset_check

atomic counter offset should align to 4 (compute shader)
This commit is contained in:
John Kessenich 2019-12-29 19:49:16 -07:00 committed by GitHub
commit c674299ddb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 66 deletions

View file

@ -6035,6 +6035,10 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol)
offset = qualifier.layoutOffset;
else
offset = atomicUintOffsets[qualifier.layoutBinding];
if (offset % 4 != 0)
error(loc, "atomic counters offset should align based on 4:", "offset", "%d", offset);
symbol.getWritableType().getQualifier().layoutOffset = offset;
// Check for overlap