refactor: Deprecating cache layout for now
This commit is contained in:
@@ -271,6 +271,43 @@ impl AttributesLayout
|
||||
|
||||
hash
|
||||
}
|
||||
|
||||
///
|
||||
/// Produces a wgsl declaration describing this layout :
|
||||
///
|
||||
/// ```wgsl
|
||||
///
|
||||
/// const ATTRIBUTE_COUNT: u32 = /* attribute count */;
|
||||
/// const ATTRIBUTE_WORD_COUNTS: array<u32, ...> = {
|
||||
/// /* word count for attribute 0 */,
|
||||
/// /* word count for attribute 1 */,
|
||||
/// ...
|
||||
/// };
|
||||
///
|
||||
///
|
||||
/// ```
|
||||
pub fn wgsl_layout_decl(&self) -> String
|
||||
{
|
||||
let mut decl = String::new();
|
||||
|
||||
decl += &format!("const ATTRIBUTE_COUNT: u32 = {};", self.attributes.len());
|
||||
|
||||
// Word counts
|
||||
decl += &format!(
|
||||
"const ATTRIBUTE_WORD_COUNTS: array<u32, {}> = array<u32, {}>(",
|
||||
self.attributes.len(),
|
||||
self.attributes.len()
|
||||
);
|
||||
|
||||
for attribute in self.attributes.iter()
|
||||
{
|
||||
decl += &format!(" {},", attribute.word_count);
|
||||
}
|
||||
|
||||
decl += ");";
|
||||
|
||||
decl
|
||||
}
|
||||
}
|
||||
|
||||
fn fnv1a(hash: &mut u64, bytes: &[u8])
|
||||
|
||||
Reference in New Issue
Block a user