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

Tilemap optimizations #132

Merged
merged 27 commits into from
Jun 16, 2024
Merged

Conversation

Speak2Erase
Copy link
Member

Connections
#98
#102

Description
This PR overhauls how the tilemap and its components are rendered and used.

  • The placeholder texture is now shared
  • Vertex buffers for everything except sprites have been removed
  • Instance buffers have been significantly shrunk or outright removed
  • Only resources required for rendering are stored in an Arc, so all uses of AtomicCell have been removed
  • Push constants code has been removed
  • Uncapped layer size (layer opacity is now a dynamic uniform buffer)

Testing
Open maps, move events around, hover over events to display them

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown -Z build-std=std,panic_abort
  • Run cargo build --release
  • If applicable, run trunk build --release

@Speak2Erase Speak2Erase requested a review from a team as a code owner June 15, 2024 05:11
crates/components/src/map_view.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@white-axe white-axe left a comment

Choose a reason for hiding this comment

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

I get this panic message when using the web build with WebGL in both Chromium and Firefox:

The application panicked (crashed).
Message:  wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `Tilemap Sprite Render Pipeline`
    In the provided shader, the type given for group 0 binding 2 has a size of 24. As the device does not support `DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED`, the type must have a size that is a multiple of 16 bytes.

Location: /home/h/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs:3009

Luminol version: d6d5041e

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

@Speak2Erase
Copy link
Member Author

I get this panic message when using the web build with WebGL in both Chromium and Firefox:

The application panicked (crashed).
Message:  wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `Tilemap Sprite Render Pipeline`
    In the provided shader, the type given for group 0 binding 2 has a size of 24. As the device does not support `DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED`, the type must have a size that is a multiple of 16 bytes.

Location: /home/h/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs:3009

Luminol version: d6d5041e

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Weird, I don't get this panic. Should be an easy fix though!

@white-axe white-axe linked an issue Jun 16, 2024 that may be closed by this pull request
@white-axe white-axe merged commit 15806d2 into Astrabit-ST:dev Jun 16, 2024
5 checks passed
@Speak2Erase Speak2Erase deleted the tilemap-optimizations branch June 16, 2024 19:29
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.

Viewport transformation efficiency
2 participants