[rs] Enable EXPERIMENTAL_TRANSLATION with GL backend for some examples

This commit is contained in:
Gordon-F 2021-03-25 21:56:22 +03:00
parent 6d62cc5bc3
commit 6485e81f4b
4 changed files with 4 additions and 5 deletions

View File

@ -37,7 +37,7 @@ impl framework::Example for Example {
// load and compile the shader
let mut flags = wgpu::ShaderFlags::VALIDATION;
match adapter.get_info().backend {
wgt::Backend::Vulkan | wgt::Backend::Metal => {
wgt::Backend::Vulkan | wgt::Backend::Metal | wgt::Backend::Gl => {
flags |= wgpu::ShaderFlags::EXPERIMENTAL_TRANSLATION;
}
_ => {} //TODO

View File

@ -250,7 +250,7 @@ impl framework::Example for Example {
let mut flags = wgpu::ShaderFlags::VALIDATION;
match adapter.get_info().backend {
wgpu::Backend::Metal | wgpu::Backend::Vulkan => {
wgpu::Backend::Metal | wgpu::Backend::Vulkan | wgpu::Backend::Gl => {
flags |= wgpu::ShaderFlags::EXPERIMENTAL_TRANSLATION
}
_ => (), //TODO

View File

@ -58,7 +58,7 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
// Loads the shader from the SPIR-V file.arrayvec
let mut flags = wgpu::ShaderFlags::VALIDATION;
match adapter.get_info().backend {
wgpu::Backend::Vulkan | wgpu::Backend::Metal => {
wgpu::Backend::Vulkan | wgpu::Backend::Metal | wgpu::Backend::Gl => {
flags |= wgpu::ShaderFlags::EXPERIMENTAL_TRANSLATION;
}
_ => {}

View File

@ -22,8 +22,7 @@ impl Error for ContextError {
impl super::Context {
pub(super) fn format_error(&self, err: &(impl Error + 'static)) -> String {
let mut err_descs = Vec::new();
err_descs.push(self.format_pretty_any(err));
let mut err_descs = vec![self.format_pretty_any(err)];
let mut source_opt = err.source();
while let Some(source) = source_opt {