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

Non uniform for everything! #177

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Builder;
use crate::builder_spirv::{SpirvValue, SpirvValueExt, SpirvValueKind};
use crate::spirv_type::SpirvType;
use rspirv::spirv::Word;
use rspirv::spirv::{Decoration, Word};
use rustc_codegen_ssa::traits::BuilderMethods;
use rustc_errors::ErrorGuaranteed;
use rustc_span::DUMMY_SP;
Expand Down Expand Up @@ -38,9 +38,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
};
let u32_ty = SpirvType::Integer(32, false).def(DUMMY_SP, self);
let u32_ptr = self.type_ptr_to(u32_ty);
let array = array.def(self);
let actual_index = actual_index.def(self);
self.emit().decorate(array, Decoration::NonUniform, []);
self.emit()
.decorate(actual_index, Decoration::NonUniform, []);
let ptr = self
.emit()
.in_bounds_access_chain(u32_ptr, None, array.def(self), [actual_index.def(self)])
.in_bounds_access_chain(u32_ptr, None, array, [actual_index])
.unwrap()
.with_type(u32_ptr);
self.load(u32_ty, ptr, Align::ONE)
Expand Down
Loading
Loading