Commit Graph

3 Commits

Author SHA1 Message Date
John Stiles
fdbd50a8dc Simplify SkSL::String by removing unused parts.
- reset, findLastOf: these were entirely unused
- find: already existed in C++11's std::string, can just be inherited
- defaulted constructors: in C++11, these can be inherited directly from
  std::string via 'using'

Change-Id: I1772ef04e49ab905aaada2ec38c1abeb9a8e26bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311039
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-17 14:21:09 +00:00
John Stiles
57a996b4c5 Disallow empty interface blocks in SkSL.
The GLSL grammar appears to require at least one member-declaration in the member-list:
https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#interface-blocks

Change-Id: Ic67469272b3d59e7b8764333899f204e95584778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284418
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-21 20:36:54 +00:00
John Stiles
0ebc69c9ef Fix modulo-by-zero crash during SPIR-V conversion.
Array-stride calculation did not check for zero-sized objects before
performing a modulo. This would lead to undefined behavior (crash)
while attempting to build the AST.

Change-Id: I84b4662978955d49a3ca28f6bb577d15c87cccb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284354
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-18 13:41:40 +00:00