Skip to content

Commit

Permalink
[naga spv-out] Rename write_expression_pointer to `write_access_cha…
Browse files Browse the repository at this point in the history
…in`.

This function's sole purpose is to generate `OpAccessChain`
instructions, so there's no point in being coy about it.
  • Loading branch information
jimblandy authored and ErichDonGubler committed Oct 31, 2024
1 parent 57fcc69 commit 6b85e65
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions naga/src/back/spv/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_dimension(type_inner: &crate::TypeInner) -> Dimension {
/// types are simply the direct SPIR-V analog of the Naga IR's. But in some
/// cases, the Naga IR and SPIR-V types need to diverge.
///
/// This enum specifies how [`BlockContext::write_expression_pointer`] should
/// This enum specifies how [`BlockContext::write_access_chain`] should
/// choose a SPIR-V result type for the `OpAccessChain` it generates, based on
/// the type of the given Naga IR [`Expression`] it's generating code for.
///
Expand Down Expand Up @@ -68,7 +68,7 @@ enum AccessTypeAdjustment {

/// The results of emitting code for a left-hand-side expression.
///
/// On success, `write_expression_pointer` returns one of these.
/// On success, `write_access_chain` returns one of these.
enum ExpressionPointer {
/// The pointer to the expression's value is available, as the value of the
/// expression with the given id.
Expand Down Expand Up @@ -407,7 +407,7 @@ impl<'w> BlockContext<'w> {
} => {
// Only binding arrays in the `Handle` address space will take
// this path, since we handled the `Pointer` case above.
let result_id = match self.write_expression_pointer(
let result_id = match self.write_access_chain(
expr_handle,
block,
AccessTypeAdjustment::IntroducePointer(
Expand Down Expand Up @@ -498,7 +498,7 @@ impl<'w> BlockContext<'w> {
} => {
// Only binding arrays in the `Handle` address space will take
// this path, since we handled the `Pointer` case above.
let result_id = match self.write_expression_pointer(
let result_id = match self.write_access_chain(
expr_handle,
block,
AccessTypeAdjustment::IntroducePointer(
Expand Down Expand Up @@ -1751,7 +1751,7 @@ impl<'w> BlockContext<'w> {
///
/// On success, the return value is an [`ExpressionPointer`] value; see the
/// documentation for that type.
fn write_expression_pointer(
fn write_access_chain(
&mut self,
mut expr_handle: Handle<crate::Expression>,
block: &mut Block,
Expand Down Expand Up @@ -1982,7 +1982,7 @@ impl<'w> BlockContext<'w> {
access_type_adjustment: AccessTypeAdjustment,
result_type_id: Word,
) -> Result<Word, Error> {
match self.write_expression_pointer(pointer, block, access_type_adjustment)? {
match self.write_access_chain(pointer, block, access_type_adjustment)? {
ExpressionPointer::Ready { pointer_id } => {
let id = self.gen_id();
let atomic_space =
Expand Down Expand Up @@ -2603,7 +2603,7 @@ impl<'w> BlockContext<'w> {
}
Statement::Store { pointer, value } => {
let value_id = self.cached[value];
match self.write_expression_pointer(
match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down Expand Up @@ -2703,7 +2703,7 @@ impl<'w> BlockContext<'w> {
self.cached[result] = id;
}

let pointer_id = match self.write_expression_pointer(
let pointer_id = match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down Expand Up @@ -2875,7 +2875,7 @@ impl<'w> BlockContext<'w> {
.write_barrier(crate::Barrier::WORK_GROUP, &mut block);
let result_type_id = self.get_expression_type_id(&self.fun_info[result].ty);
// Embed the body of
match self.write_expression_pointer(
match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down

0 comments on commit 6b85e65

Please sign in to comment.