skia2/src/sksl
Ben Wagner d9fcb236a4 Attempt to fix PixelC GLSL compilation error.
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4436
CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot,Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot

Change-Id: Id8ad69b5128653ba16dd99418334be75eb3485c5
Reviewed-on: https://skia-review.googlesource.com/4436
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2016-11-04 21:15:23 +00:00
..
ast Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
ir Reduced skslc memory consumption 2016-10-28 09:02:46 -07:00
GLSL.std.450.h
lex.sksl.c Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
README added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
sksl_frag.include Attempt to fix PixelC GLSL compilation error. 2016-11-04 21:15:23 +00:00
sksl_vert.include Turn on -Wnewline-eof. 2016-09-27 15:49:37 +00:00
sksl.flex Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
sksl.include Reduced skslc memory consumption 2016-10-28 09:02:46 -07:00
SkSLCFGGenerator.cpp added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLCFGGenerator.h added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLCodeGenerator.h Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
SkSLCompiler.cpp Turn on -Wrange-loop-analysis. 2016-10-26 15:57:09 +00:00
SkSLCompiler.h added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLContext.h Reduced skslc memory consumption 2016-10-28 09:02:46 -07:00
SkSLErrorReporter.h
SkSLGLSLCodeGenerator.cpp re-re-land of skslc now automatically turns on derivatives support 2016-10-20 09:54:00 -07:00
SkSLGLSLCodeGenerator.h re-re-land of skslc now automatically turns on derivatives support 2016-10-20 09:54:00 -07:00
SkSLIRGenerator.cpp fixed skslc's handling of ivec(vec) 2016-11-01 17:46:51 +00:00
SkSLIRGenerator.h added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLMain.cpp re-re-land of skslc now automatically turns on derivatives support 2016-10-20 09:54:00 -07:00
SkSLParser.cpp Reduced skslc memory consumption 2016-10-28 09:02:46 -07:00
SkSLParser.h Added skslc parse recursion limit 2016-10-27 10:54:02 -07:00
SkSLPosition.h
SkSLSPIRVCodeGenerator.cpp added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLSPIRVCodeGenerator.h added basic dataflow analysis to skslc 2016-10-13 13:25:34 -07:00
SkSLToken.h Reduced skslc memory consumption 2016-10-28 09:02:46 -07:00
SkSLUtil.cpp Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
SkSLUtil.h Turned on SkSL->GLSL compiler 2016-10-12 06:39:56 -07:00
spirv.h

Overview
========

SkSL ("Skia Shading Language") is a variant of GLSL which is used as Skia's 
internal shading language. SkSL is, at its heart, a single standardized version
of GLSL which avoids all of the various version and dialect differences found
in GLSL "in the wild", but it does bring a few of its own changes to the table.

Skia uses the SkSL compiler to convert SkSL code to GLSL, GLSL ES, or SPIR-V
before handing it over to the graphics driver.

Differences from GLSL
=====================

SkSL is based on GLSL 4.5. For the most part, write SkSL exactly as you would
desktop GLSL, and the SkSL compiler will take care of version and dialect
differences (for instance, you always use "in" and "out", and skslc will handle
translating them to "varying" and "attribute" as appropriate). Be aware of the 
following differences between SkSL and GLSL:

* no #version statement is required, and will be ignored if present
* the output color is sk_FragColor (do not declare it)
* lowp, mediump, and highp are always permitted (but will only be respected if 
  you run on a GLES device)
* you do not need to include ".0" to make a number a float (meaning that
  "vec2(x, y) * 4" is perfectly legal in SkSL, unlike GLSL where it would often
  have to be expressed "vec2(x, y) * 4.0". There is no performance penalty for 
  this, as the number is converted to a float at compile time)
* type suffixes on numbers (1.0f, 0xFFu) are both unnecessary and unsupported
* some built-in functions and one or two rarely-used language features are not
  yet supported (sorry!)

SkSL is still under development, and is expected to diverge further from GLSL
over time.