Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Effect interface #8681

Merged
merged 2 commits into from Mar 20, 2024
Merged

Update Effect interface #8681

merged 2 commits into from Mar 20, 2024

Conversation

Pessimistress
Copy link
Collaborator

For #8680

Change List

  • Add setup lifecycle method for creating GPU resources
  • Update all Effect implementations
  • Unit tests

@coveralls
Copy link

coveralls commented Mar 19, 2024

Coverage Status

coverage: 88.014% (+0.2%) from 87.847%
when pulling 4ae7d8e on x/effect-fix-1
into 1aa2402 on master.

modules/core/src/lib/deck-renderer.ts Show resolved Hide resolved
modules/core/src/effects/lighting/lighting-effect.ts Outdated Show resolved Hide resolved
modules/core/src/lib/deck-renderer.ts Show resolved Hide resolved
@@ -8,17 +9,32 @@ export type PostRenderOptions = LayersPassRenderOptions & {
inputBuffer: Framebuffer;
swapBuffer: Framebuffer;
};
export type EffectContext = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device can be obtained from deck. What is the thinking to include them separately? Easier testing?

I see in the followup that deck is needed to add/remove shader modules. If this is the sole purpose of including deck, perhaps it would be better to pass layerManager directly:

export type EffectContext = {
  device: Device;
  layerManager: LayerManager;
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Deck.device is not public.
  • It's intentional to route everything through deck, so *manager do not interact with each other directly. If we do change the implementation such as who tracks the shader modules, there will be no breaking change to the effects.

@Pessimistress Pessimistress merged commit ecd78ec into master Mar 20, 2024
4 checks passed
@Pessimistress Pessimistress deleted the x/effect-fix-1 branch March 20, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants