Skip to content

Commit

Permalink
shaderData add get shader properties ability (#1030)
Browse files Browse the repository at this point in the history
* feat:  shaderData add getProperties ability
  • Loading branch information
GuoLei1990 authored Sep 14, 2022
1 parent f34d3ac commit 0dcf39e
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 90 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/shader/Shader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class Shader {
"GL_OES_standard_derivatives",
"GL_EXT_draw_buffers"
];
/** @internal */
static _propertyIdMap: Record<number, ShaderProperty> = Object.create(null);

private static _shaderMap: Record<string, Shader> = Object.create(null);
private static _propertyNameMap: Record<string, ShaderProperty> = Object.create(null);
Expand Down Expand Up @@ -105,6 +107,7 @@ export class Shader {
} else {
const property = new ShaderProperty(name);
propertyNameMap[name] = property;
Shader._propertyIdMap[property._uniqueId] = property;
return property;
}
}
Expand Down
Loading

0 comments on commit 0dcf39e

Please sign in to comment.