Skip to content
Snippets Groups Projects
Commit ce0385f7 authored by Alexander Rose's avatar Alexander Rose
Browse files

formating

parent 44902223
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ namespace SortedRanges {
export function max<T extends number = number>(ranges: SortedRanges<T>) { return ranges[ranges.length - 1] }
export function size<T extends number = number>(ranges: SortedRanges<T>) {
let size = 0
for(let i = 0, il = ranges.length; i < il; i += 2) {
for (let i = 0, il = ranges.length; i < il; i += 2) {
size += ranges[i + 1] - ranges[i] + 1
}
return size
......
/**
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
// from http://burtleburtle.net/bob/hash/integer.html
......
......@@ -117,7 +117,7 @@ export type ProgramCache = ReferenceCache<Program, ProgramProps, Context>
export function createProgramCache(): ProgramCache {
return createReferenceCache(
(props: ProgramProps) => {
const array = [props.shaderCode.id]
const array = [ props.shaderCode.id ]
Object.keys(props.defineValues).forEach(k => {
const v = props.defineValues[k].ref.value
array.push(hashString(k), typeof v === 'boolean' ? v ? 1 : 0 : hashString(v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment