blob: a96134a418c41fb36bd87dae5e2826aa87b70f97 [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
11For xglCreateShader, we primarily used the existing standalone device independent front end which can consume GLSL or BIL, and results in a separately linked shader object.
12
Courtney Goeltzenleuchter6be96bb2014-11-02 18:50:52 -070013For xglCreateGraphicsPipeline, 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
19Design decisions we made to get this stack working with current specified XGL and BIL. We know these are active areas of discussion, and we'll update when decisions are made:
20- Samplers:
21 - GLSL sampler bindings equate to a sampler/texture pair of the same number, as set up by the XGL application. i.e. the following sampler:
22```
23 layout (binding = 2) uniform sampler2D surface;
24```
25will read from XGL_SLOT_SHADER_SAMPLER entity 2 and XGL_SLOT_SHADER_RESOURCE entity 2.
26
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```
32will be read from XGL_SHADER_RESOURCE entity 2.