Skip to content

Commit

Permalink
Bump naga dep to 89bed99.
Browse files Browse the repository at this point in the history
  • Loading branch information
nical committed Jun 13, 2022
1 parent d9678cd commit 17d7122
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ thiserror = "1"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"
features = ["span", "validate", "wgsl-in"]

Expand Down
4 changes: 2 additions & 2 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ android-properties = "0.2"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"

# DEV dependencies

[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"
features = ["wgsl-in"]

Expand Down
29 changes: 19 additions & 10 deletions wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,23 @@ impl super::Device {
.position(|ep| ep.name.as_str() == stage.entry_point)
.ok_or(crate::PipelineError::EntryPoint(naga_stage))?;

// TODO: expose these parameters.
use naga::proc::BoundsCheckPolicy;
let policies = naga::proc::BoundsCheckPolicies {
index: BoundsCheckPolicy::Unchecked,
buffer: BoundsCheckPolicy::Unchecked,
image: BoundsCheckPolicy::Unchecked,
binding_array: BoundsCheckPolicy::Unchecked,
};

let mut output = String::new();
let mut writer = glsl::Writer::new(
&mut output,
&shader.module,
&shader.info,
&context.layout.naga_options,
&pipeline_options,
policies,
)
.map_err(|e| {
let msg = format!("{}", e);
Expand Down Expand Up @@ -528,7 +538,7 @@ impl crate::Device<super::Api> for super::Device {
depth: 1,
};

let (inner, is_cubemap) = if render_usage.contains(desc.usage)
let inner = if render_usage.contains(desc.usage)
&& desc.dimension == wgt::TextureDimension::D2
&& desc.size.depth_or_array_layers == 1
{
Expand Down Expand Up @@ -559,10 +569,10 @@ impl crate::Device<super::Api> for super::Device {
}

gl.bind_renderbuffer(glow::RENDERBUFFER, None);
(super::TextureInner::Renderbuffer { raw }, false)
super::TextureInner::Renderbuffer { raw }
} else {
let raw = gl.create_texture().unwrap();
let (target, is_3d, is_cubemap) = match desc.dimension {
let (target, is_3d) = match desc.dimension {
wgt::TextureDimension::D1 | wgt::TextureDimension::D2 => {
if desc.size.depth_or_array_layers > 1 {
//HACK: detect a cube map
Expand All @@ -575,17 +585,17 @@ impl crate::Device<super::Api> for super::Device {
None
};
match cube_count {
None => (glow::TEXTURE_2D_ARRAY, true, false),
Some(1) => (glow::TEXTURE_CUBE_MAP, false, true),
Some(_) => (glow::TEXTURE_CUBE_MAP_ARRAY, true, true),
None => (glow::TEXTURE_2D_ARRAY, true),
Some(1) => (glow::TEXTURE_CUBE_MAP, false),
Some(_) => (glow::TEXTURE_CUBE_MAP_ARRAY, true),
}
} else {
(glow::TEXTURE_2D, false, false)
(glow::TEXTURE_2D, false)
}
}
wgt::TextureDimension::D3 => {
copy_size.depth = desc.size.depth_or_array_layers;
(glow::TEXTURE_3D, true, false)
(glow::TEXTURE_3D, true)
}
};

Expand Down Expand Up @@ -639,7 +649,7 @@ impl crate::Device<super::Api> for super::Device {
}

gl.bind_texture(target, None);
(super::TextureInner::Texture { raw, target }, is_cubemap)
super::TextureInner::Texture { raw, target }
};

Ok(super::Texture {
Expand All @@ -653,7 +663,6 @@ impl crate::Device<super::Api> for super::Device {
format: desc.format,
format_desc,
copy_size,
is_cubemap,
})
}
unsafe fn destroy_texture(&self, texture: super::Texture) {
Expand Down
6 changes: 3 additions & 3 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ env_logger = "0.9"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"
optional = true

# used to test all the example shaders
[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"
features = ["wgsl-in"]

[target.'cfg(target_arch = "wasm32")'.dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "571302e"
rev = "89bed99"
#version = "0.8"
features = ["wgsl-out"]

Expand Down

0 comments on commit 17d7122

Please sign in to comment.