@@ -51,51 +51,47 @@ pub enum ShaderType {
5151pub use builder:: { TEXTURE_SAMPLER_START_BIND_INDEX , TEXTURE_START_BIND_INDEX } ;
5252pub use types:: { Filter , Mipmap , SamplerConfig , Wrapping } ;
5353
54- /**
55- * Compiles an Adobe AGAL shader to a Naga Module.
56- *
57- * The `vertex_attributes` parameter is only used when compiling
58- * a vertex shader.
59- *
60- * The returning Module can be passed directly to `wgpu`,
61- * or compiled to a particular shader language using a `naga` backend.
62- *
63- * The shader entrypoint is always named `main`.
64- *
65- * We compile an AGAL shader as follows:
66- *
67- * # Vertex Shader
68- *
69- * * Vertex attributes - AGAL supports up to 8 vertex attributes,
70- * stored in `va0` to `va7`. You must provide the format of each attribute
71- * in the corresponding entry in the `vertex_attributes` array.
72- * Each attribute is mapped to the corresponding binding in the Naga shader
73- * - for example, va3 will have binding id 3.
74- *
75- *
76- * * Vertex output - An AGAL vertex shader has one main output (a vec4 position),
77- * and 8 varying outputs. The main output is mapped to the Naga 'Position' output,
78- * while each *used* varying register is mapped to a corresponding field in
79- * the Naga output struct. For example, if a vertex shader uses varying registers
80- * 2 and 5, then the Naga output struct type will have two members, with binding ids 2 and 5.
81- * If a shader does not write to a varying register, then it is not included in the
82- * Naga output struct type.
83- *
84- * * Program constants - An AGAL vertex shader has access to 128 program constants.
85- * These are mapped to a single Naga uniform buffer, with a binding id of 0.
86- * Each program constant is a vec4, and are stored in increasing order of register number.
87- *
88- * # Fragment Shader
89- *
90- * * Fragment input - An AGAL fragment shader can read from the 8 varying registers
91- * set by the fragment shader. Each *used* varying register is mapped to a corresponding
92- * binding in the Naga input type. For example, if a fragment shader uses varying registers
93- * 2 and 5, then the Naga input type will have two members, with binding ids 2 and 5.
94- *
95- * * Program constants - An AGAL fragment shader has access to 28 program constants.
96- * These are mapped to a single Naga uniform buffer, with a binding id of 1.
97- *
98- */
54+ /// Compiles an Adobe AGAL shader to a Naga Module.
55+ ///
56+ /// The `vertex_attributes` parameter is only used when compiling
57+ /// a vertex shader.
58+ ///
59+ /// The returning Module can be passed directly to `wgpu`,
60+ /// or compiled to a particular shader language using a `naga` backend.
61+ ///
62+ /// The shader entrypoint is always named `main`.
63+ ///
64+ /// We compile an AGAL shader as follows:
65+ ///
66+ /// # Vertex Shader
67+ ///
68+ /// * Vertex attributes - AGAL supports up to 8 vertex attributes,
69+ /// stored in `va0` to `va7`. You must provide the format of each attribute
70+ /// in the corresponding entry in the `vertex_attributes` array.
71+ /// Each attribute is mapped to the corresponding binding in the Naga shader
72+ /// - for example, va3 will have binding id 3.
73+ ///
74+ /// * Vertex output - An AGAL vertex shader has one main output (a vec4 position),
75+ /// and 8 varying outputs. The main output is mapped to the Naga 'Position' output,
76+ /// while each *used* varying register is mapped to a corresponding field in
77+ /// the Naga output struct. For example, if a vertex shader uses varying registers
78+ /// 2 and 5, then the Naga output struct type will have two members, with binding ids 2 and 5.
79+ /// If a shader does not write to a varying register, then it is not included in the
80+ /// Naga output struct type.
81+ ///
82+ /// * Program constants - An AGAL vertex shader has access to 128 program constants.
83+ /// These are mapped to a single Naga uniform buffer, with a binding id of 0.
84+ /// Each program constant is a vec4, and are stored in increasing order of register number.
85+ ///
86+ /// # Fragment Shader
87+ ///
88+ /// * Fragment input - An AGAL fragment shader can read from the 8 varying registers
89+ /// set by the fragment shader. Each *used* varying register is mapped to a corresponding
90+ /// binding in the Naga input type. For example, if a fragment shader uses varying registers
91+ /// 2 and 5, then the Naga input type will have two members, with binding ids 2 and 5.
92+ ///
93+ /// * Program constants - An AGAL fragment shader has access to 28 program constants.
94+ /// These are mapped to a single Naga uniform buffer, with a binding id of 1.
9995pub fn agal_to_naga (
10096 agal : & [ u8 ] ,
10197 vertex_attributes : & [ Option < VertexAttributeFormat > ; MAX_VERTEX_ATTRIBUTES ] ,
0 commit comments