summaryrefslogtreecommitdiffstats
path: root/examples/integration_wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-02-24 20:52:10 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-24 20:52:10 +0100
commit368cadd25a8b57ee5c41e45d1abe8d1dfb194c69 (patch)
tree191cb7cc7807a5fe513b3d485b2fda21d3bf0bde /examples/integration_wgpu
parent573d27eb52bbfacf1b06983b4282f00eb5265bdc (diff)
parent8059c40142d601588e01c152ce1bb72a1295dde8 (diff)
downloadiced-368cadd25a8b57ee5c41e45d1abe8d1dfb194c69.tar.gz
iced-368cadd25a8b57ee5c41e45d1abe8d1dfb194c69.tar.bz2
iced-368cadd25a8b57ee5c41e45d1abe8d1dfb194c69.zip
Merge pull request #1697 from iced-rs/text-glyphon
Text shaping, font fallback, and `iced_wgpu` overhaul
Diffstat (limited to '')
-rw-r--r--examples/integration/.gitignore (renamed from examples/integration_wgpu/.gitignore)0
-rw-r--r--examples/integration/Cargo.toml (renamed from examples/integration_wgpu/Cargo.toml)2
-rw-r--r--examples/integration/README.md (renamed from examples/integration_wgpu/README.md)0
-rw-r--r--examples/integration/index.html (renamed from examples/integration_wgpu/index.html)4
-rw-r--r--examples/integration/src/controls.rs (renamed from examples/integration_wgpu/src/controls.rs)0
-rw-r--r--examples/integration/src/main.rs (renamed from examples/integration_wgpu/src/main.rs)19
-rw-r--r--examples/integration/src/scene.rs (renamed from examples/integration_wgpu/src/scene.rs)0
-rw-r--r--examples/integration/src/shader/frag.wgsl (renamed from examples/integration_wgpu/src/shader/frag.wgsl)0
-rw-r--r--examples/integration/src/shader/vert.wgsl (renamed from examples/integration_wgpu/src/shader/vert.wgsl)0
9 files changed, 11 insertions, 14 deletions
diff --git a/examples/integration_wgpu/.gitignore b/examples/integration/.gitignore
index e188dc28..e188dc28 100644
--- a/examples/integration_wgpu/.gitignore
+++ b/examples/integration/.gitignore
diff --git a/examples/integration_wgpu/Cargo.toml b/examples/integration/Cargo.toml
index eaa1df7e..200306aa 100644
--- a/examples/integration_wgpu/Cargo.toml
+++ b/examples/integration/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "integration_wgpu"
+name = "integration"
version = "0.1.0"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2021"
diff --git a/examples/integration_wgpu/README.md b/examples/integration/README.md
index ece9ba1e..ece9ba1e 100644
--- a/examples/integration_wgpu/README.md
+++ b/examples/integration/README.md
diff --git a/examples/integration_wgpu/index.html b/examples/integration/index.html
index 461e67a4..920bc4a0 100644
--- a/examples/integration_wgpu/index.html
+++ b/examples/integration/index.html
@@ -8,8 +8,8 @@
<h1>integration_wgpu</h1>
<canvas id="iced_canvas"></canvas>
<script type="module">
- import init from "./integration_wgpu.js";
- init('./integration_wgpu_bg.wasm');
+ import init from "./integration.js";
+ init('./integration_bg.wasm');
</script>
<style>
body {
diff --git a/examples/integration_wgpu/src/controls.rs b/examples/integration/src/controls.rs
index 533cb6e2..533cb6e2 100644
--- a/examples/integration_wgpu/src/controls.rs
+++ b/examples/integration/src/controls.rs
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration/src/main.rs
index 2a56b6fa..a7a90ced 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -125,17 +125,18 @@ pub fn main() {
let mut resized = false;
- // Initialize staging belt
- let mut staging_belt = wgpu::util::StagingBelt::new(5 * 1024);
-
// Initialize scene and GUI controls
let scene = Scene::new(&device, format);
let controls = Controls::new();
// Initialize iced
let mut debug = Debug::new();
- let mut renderer =
- Renderer::new(Backend::new(&device, Settings::default(), format));
+ let mut renderer = Renderer::new(Backend::new(
+ &device,
+ &queue,
+ Settings::default(),
+ format,
+ ));
let mut state = program::State::new(
controls,
@@ -247,8 +248,9 @@ pub fn main() {
renderer.with_primitives(|backend, primitive| {
backend.present(
&device,
- &mut staging_belt,
+ &queue,
&mut encoder,
+ None,
&view,
primitive,
&viewport,
@@ -257,7 +259,6 @@ pub fn main() {
});
// Then we submit the work
- staging_belt.finish();
queue.submit(Some(encoder.finish()));
frame.present();
@@ -267,10 +268,6 @@ pub fn main() {
state.mouse_interaction(),
),
);
-
- // And recall staging buffers
- staging_belt.recall();
-
}
Err(error) => match error {
wgpu::SurfaceError::OutOfMemory => {
diff --git a/examples/integration_wgpu/src/scene.rs b/examples/integration/src/scene.rs
index 3e41fbda..3e41fbda 100644
--- a/examples/integration_wgpu/src/scene.rs
+++ b/examples/integration/src/scene.rs
diff --git a/examples/integration_wgpu/src/shader/frag.wgsl b/examples/integration/src/shader/frag.wgsl
index cf27bb56..cf27bb56 100644
--- a/examples/integration_wgpu/src/shader/frag.wgsl
+++ b/examples/integration/src/shader/frag.wgsl
diff --git a/examples/integration_wgpu/src/shader/vert.wgsl b/examples/integration/src/shader/vert.wgsl
index e353e6ba..e353e6ba 100644
--- a/examples/integration_wgpu/src/shader/vert.wgsl
+++ b/examples/integration/src/shader/vert.wgsl