Skip to content

Commit

Permalink
Move Examples to Subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald committed Jan 20, 2025
1 parent 87b3ca2 commit 8593af5
Show file tree
Hide file tree
Showing 141 changed files with 34 additions and 32 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ members = [

# default members
"benches",
"examples",
"examples/features",
# "examples/standalone/*",
"lock-analyzer",
"naga-cli",
"naga",
Expand All @@ -24,7 +25,8 @@ members = [
exclude = []
default-members = [
"benches",
"examples",
"examples/features",
# "examples/standalone/*",
"lock-analyzer",
"naga-cli",
"naga",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ pub fn main() {
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "boids",
// Generated on 1080ti on Vk/Windows
image_path: "/examples/src/boids/screenshot.png",
image_path: "/examples/features/src/boids/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl crate::framework::Example for Example {
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None,
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!(
"../../../wgpu-hal/examples/halmark/shader.wgsl"
"../../../../wgpu-hal/examples/halmark/shader.wgsl"
))),
});

Expand Down Expand Up @@ -238,7 +238,7 @@ impl crate::framework::Example for Example {
});

let texture = {
let img_data = include_bytes!("../../../logo.png");
let img_data = include_bytes!("../../../../logo.png");
let decoder = png::Decoder::new(std::io::Cursor::new(img_data));
let mut reader = decoder.read_info().unwrap();
let mut buf = vec![0; reader.output_buffer_size()];
Expand Down Expand Up @@ -440,7 +440,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "bunnymark",
image_path: "/examples/src/bunnymark/screenshot.png",
image_path: "/examples/features/src/bunnymark/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "conservative-raster",
image_path: "/examples/src/conservative_raster/screenshot.png",
image_path: "/examples/features/src/conservative_raster/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub fn main() {
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "cube",
// Generated on 1080ti on Vk/Windows
image_path: "/examples/src/cube/screenshot.png",
image_path: "/examples/features/src/cube/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand All @@ -399,7 +399,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
static TEST_LINES: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "cube-lines",
// Generated on 1080ti on Vk/Windows
image_path: "/examples/src/cube/screenshot-lines.png",
image_path: "/examples/features/src/cube/screenshot-lines.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::POLYGON_MODE_LINE,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl<E: Example + wgpu::WasmNotSendSync> From<ExampleTestParams<E>>
let bytes = dst_buffer_slice.get_mapped_range().to_vec();

wgpu_test::image::compare_image_output(
dbg!(env!("CARGO_MANIFEST_DIR").to_string() + "/../" + params.image_path),
dbg!(env!("CARGO_MANIFEST_DIR").to_string() + "/../../" + params.image_path),
&ctx.adapter_info,
params.width,
params.height,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "mipmap",
image_path: "/examples/src/mipmap/screenshot.png",
image_path: "/examples/features/src/mipmap/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand All @@ -521,7 +521,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
#[wgpu_test::gpu_test]
static TEST_QUERY: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "mipmap-query",
image_path: "/examples/src/mipmap/screenshot_query.png",
image_path: "/examples/features/src/mipmap/screenshot_query.png",
width: 1024,
height: 768,
optional_features: QUERY_FEATURES,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "msaa-line",
image_path: "/examples/src/msaa_line/screenshot.png",
image_path: "/examples/features/src/msaa_line/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES,
Expand Down
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: EXAMPLE_NAME,
image_path: "/examples/src/multiple_render_targets/screenshot.png",
image_path: "/examples/features/src/multiple_render_targets/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "ray_cube_compute",
image_path: "/examples/src/ray_cube_compute/screenshot.png",
image_path: "/examples/features/src/ray_cube_compute/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "ray_cube_fragment",
image_path: "/examples/src/ray_cube_fragment/screenshot.png",
image_path: "/examples/features/src/ray_cube_fragment/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "ray_scene",
image_path: "/examples/src/ray_scene/screenshot.png",
image_path: "/examples/features/src/ray_scene/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "ray_cube_shadows",
image_path: "/examples/src/ray_shadows/screenshot.png",
image_path: "/examples/features/src/ray_shadows/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "ray_traced_triangle",
image_path: "/examples/src/ray_traced_triangle/screenshot.png",
image_path: "/examples/features/src/ray_traced_triangle/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "shadow",
image_path: "/examples/src/shadow/screenshot.png",
image_path: "/examples/features/src/shadow/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "skybox",
image_path: "/examples/src/skybox/screenshot.png",
image_path: "/examples/features/src/skybox/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand All @@ -489,7 +489,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
#[wgpu_test::gpu_test]
static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "skybox-bc7",
image_path: "/examples/src/skybox/screenshot_bc7.png",
image_path: "/examples/features/src/skybox/screenshot_bc7.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_BC,
Expand All @@ -502,7 +502,7 @@ static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::Example
#[wgpu_test::gpu_test]
static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "skybox-etc2",
image_path: "/examples/src/skybox/screenshot_etc2.png",
image_path: "/examples/features/src/skybox/screenshot_etc2.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_ETC2,
Expand All @@ -515,7 +515,7 @@ static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::Exampl
#[wgpu_test::gpu_test]
static TEST_ASTC: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "skybox-astc",
image_path: "/examples/src/skybox/screenshot_astc.png",
image_path: "/examples/features/src/skybox/screenshot_astc.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub fn main() {
static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "srgb-blend-srg",
// Generated on WARP/Windows
image_path: "/examples/src/srgb_blend/screenshot-srgb.png",
image_path: "/examples/features/src/srgb_blend/screenshot-srgb.png",
width: 192,
height: 192,
optional_features: wgpu::Features::default(),
Expand All @@ -239,7 +239,7 @@ static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::Exampl
static TEST_LINEAR: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "srgb-blend-linear",
// Generated on WARP/Windows
image_path: "/examples/src/srgb_blend/screenshot-linear.png",
image_path: "/examples/features/src/srgb_blend/screenshot-linear.png",
width: 192,
height: 192,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "stencil-triangles",
image_path: "/examples/src/stencil_triangles/screenshot.png",
image_path: "/examples/features/src/stencil_triangles/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "texture-arrays",
image_path: "/examples/src/texture_arrays/screenshot.png",
image_path: "/examples/features/src/texture_arrays/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::empty(),
Expand All @@ -424,7 +424,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
#[wgpu_test::gpu_test]
static TEST_UNIFORM: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "texture-arrays-uniform",
image_path: "/examples/src/texture_arrays/screenshot.png",
image_path: "/examples/features/src/texture_arrays/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::empty(),
Expand All @@ -438,7 +438,7 @@ static TEST_UNIFORM: crate::framework::ExampleTestParams = crate::framework::Exa
static TEST_NON_UNIFORM: crate::framework::ExampleTestParams =
crate::framework::ExampleTestParams {
name: "texture-arrays-non-uniform",
image_path: "/examples/src/texture_arrays/screenshot.png",
image_path: "/examples/features/src/texture_arrays/screenshot.png",
width: 1024,
height: 768,
optional_features:
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ pub fn main() {
#[wgpu_test::gpu_test]
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
name: "water",
image_path: "/examples/src/water/screenshot.png",
image_path: "/examples/features/src/water/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion xtask/src/run_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub(crate) fn run_wasm(shell: Shell, mut args: Arguments) -> anyhow::Result<()>
.context("Failed to run wasm-bindgen")?;

let static_files = shell
.read_dir("examples/static")
.read_dir("examples/features/web-static")
.context("Failed to enumerate static files")?;

for file in static_files {
Expand Down

0 comments on commit 8593af5

Please sign in to comment.