blob: d4cd9e641b52fc6bc720d9d8998974d3ad60cb60 [file] [log] [blame] [view]
JensOwenf629f222014-11-01 14:05:50 -06001# Sample BIL to Intel ISA Compiler
2
3This compiler stack was brought over from the GlassyMesa driver LunarG created for Valve.
4It uses the following tools:
JensOwenb5ea3292014-11-02 11:01:19 -07005- BIL support and LunarGLASS middle end optimizer (pulled in via
Jens Owen2572d3b2014-12-18 07:58:15 -07006[update_external_sources.sh](../../../update_external_sources.sh) script)
7(mesa-utils/src/glsl)
8- [GlassyMesa's GLSLIR and supporting infrastructure](shader)
9- [GlassyMesa's DRI i965 backend](pipeline)
JensOwenf629f222014-11-01 14:05:50 -060010
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060011For vkCreateShader, we primarily used the existing standalone device independent front end which can consume GLSL or BIL, and results in a separately linked shader object.
JensOwenf629f222014-11-01 14:05:50 -060012
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060013For vkCreateGraphicsPipeline, we pulled over only the files needed to lower the shader object to ISA and supporting metadata. Much of the i965 DRI driver was removed or commented out for future use, and is still being actively bootstrapped.
JensOwenf629f222014-11-01 14:05:50 -060014
15Currently only Vertex and Fragment shaders are supported. Any shader that fits within the IO parameters you see tested in compiler_render_tests.cpp should work. Buffers with bindings, samplers with bindings, interstage IO with locations, are all working. Vertex input locations work if they are sequential and start from 0. Fragment output locations only work for location 0.
16
17We recommend using only buffers with bindings for uniforms, no global, non-block uniforms.
18
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060019Design decisions we made to get this stack working with current specified VK and BIL. We know these are active areas of discussion, and we'll update when decisions are made:
JensOwenf629f222014-11-01 14:05:50 -060020- Samplers:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060021 - GLSL sampler bindings equate to a sampler/texture pair of the same number, as set up by the VK application. i.e. the following sampler:
JensOwenf629f222014-11-01 14:05:50 -060022```
23 layout (binding = 2) uniform sampler2D surface;
24```
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060025will read from VK_SLOT_SHADER_SAMPLER entity 2 and VK_SLOT_SHADER_RESOURCE entity 2.
JensOwenf629f222014-11-01 14:05:50 -060026
27- Buffers:
28 - GLSL buffer bindings equate to the buffer bound at the same slot. i.e. the following uniform buffer:
29```
30 layout (std140, binding = 2) uniform foo { vec4 bar; } myBuffer;
31```
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060032will be read from VK_SHADER_RESOURCE entity 2.