[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] async shader compiliation




On Feb 22, 2017, at 3:06, Maksims Mihejevs <max@playcanvas.com> wrote:

Regarding #3, there was mentions before about SPIR-V, correct me if I'm wrong, but it is way-way too far to become usable based on lack of driver and hardware support of it, and near future doesn't look bright. And does it eliminates compilation step all together, or it has own compilation step, which should perform better?

The latter. SPIR-V is an intermediate language. By removing text parsing and AST building from the graphics driver it saves a little time, avoids the problem of inconsistencies across compilers and allows for non-target-specific optimizations by the off-line SPIR-V generators. The driver still has to lower the SPIR-V to the GPU instruction set which involves among other things register allocation. This work takes a far bigger portion of the time involved in a GLSL compilation than parsing the text.

Not only that, SPIR-V data is typically larger than the original GLSL text.

So SPIR-V is not necessarily a magic bullet. 

Regards

    -Mark

Attachment: signature.asc
Description: Message signed with OpenPGP