|
3016 | 3016 | /// types are simply the direct SPIR-V analog of the Naga IR's. But in some |
3017 | 3017 | /// cases, the Naga IR and SPIR-V types need to diverge. |
3018 | 3018 | /// |
3019 | | -/// This enum specifies how [`BlockContext::write_expression_pointer`] should |
| 3019 | +/// This enum specifies how [`BlockContext::write_access_chain`] should |
3020 | 3020 | /// choose a SPIR-V result type for the `OpAccessChain` it generates, based on |
3021 | 3021 | /// the type of the given Naga IR [`Expression`] it's generating code for. |
3022 | 3022 | /// |
|
3060 | 3060 |
|
3061 | 3061 | <span class="doccomment">/// The results of emitting code for a left-hand-side expression. |
3062 | 3062 | /// |
3063 | | -/// On success, `write_expression_pointer` returns one of these. |
| 3063 | +/// On success, `write_access_chain` returns one of these. |
3064 | 3064 | </span><span class="kw">enum </span>ExpressionPointer { |
3065 | 3065 | <span class="doccomment">/// The pointer to the expression's value is available, as the value of the |
3066 | 3066 | /// expression with the given id. |
|
3399 | 3399 | } => { |
3400 | 3400 | <span class="comment">// Only binding arrays in the `Handle` address space will take |
3401 | 3401 | // this path, since we handled the `Pointer` case above. |
3402 | | - </span><span class="kw">let </span>result_id = <span class="kw">match </span><span class="self">self</span>.write_expression_pointer( |
| 3402 | + </span><span class="kw">let </span>result_id = <span class="kw">match </span><span class="self">self</span>.write_access_chain( |
3403 | 3403 | expr_handle, |
3404 | 3404 | block, |
3405 | 3405 | AccessTypeAdjustment::IntroducePointer( |
|
3490 | 3490 | } => { |
3491 | 3491 | <span class="comment">// Only binding arrays in the `Handle` address space will take |
3492 | 3492 | // this path, since we handled the `Pointer` case above. |
3493 | | - </span><span class="kw">let </span>result_id = <span class="kw">match </span><span class="self">self</span>.write_expression_pointer( |
| 3493 | + </span><span class="kw">let </span>result_id = <span class="kw">match </span><span class="self">self</span>.write_access_chain( |
3494 | 3494 | expr_handle, |
3495 | 3495 | block, |
3496 | 3496 | AccessTypeAdjustment::IntroducePointer( |
|
4743 | 4743 | /// |
4744 | 4744 | /// On success, the return value is an [`ExpressionPointer`] value; see the |
4745 | 4745 | /// documentation for that type. |
4746 | | - </span><span class="kw">fn </span>write_expression_pointer( |
| 4746 | + </span><span class="kw">fn </span>write_access_chain( |
4747 | 4747 | <span class="kw-2">&mut </span><span class="self">self</span>, |
4748 | 4748 | <span class="kw-2">mut </span>expr_handle: Handle<<span class="kw">crate</span>::Expression>, |
4749 | 4749 | block: <span class="kw-2">&mut </span>Block, |
|
4974 | 4974 | access_type_adjustment: AccessTypeAdjustment, |
4975 | 4975 | result_type_id: Word, |
4976 | 4976 | ) -> <span class="prelude-ty">Result</span><Word, Error> { |
4977 | | - <span class="kw">match </span><span class="self">self</span>.write_expression_pointer(pointer, block, access_type_adjustment)<span class="question-mark">? </span>{ |
| 4977 | + <span class="kw">match </span><span class="self">self</span>.write_access_chain(pointer, block, access_type_adjustment)<span class="question-mark">? </span>{ |
4978 | 4978 | ExpressionPointer::Ready { pointer_id } => { |
4979 | 4979 | <span class="kw">let </span>id = <span class="self">self</span>.gen_id(); |
4980 | 4980 | <span class="kw">let </span>atomic_space = |
|
5595 | 5595 | } |
5596 | 5596 | Statement::Store { pointer, value } => { |
5597 | 5597 | <span class="kw">let </span>value_id = <span class="self">self</span>.cached[value]; |
5598 | | - <span class="kw">match </span><span class="self">self</span>.write_expression_pointer( |
| 5598 | + <span class="kw">match </span><span class="self">self</span>.write_access_chain( |
5599 | 5599 | pointer, |
5600 | 5600 | <span class="kw-2">&mut </span>block, |
5601 | 5601 | AccessTypeAdjustment::None, |
|
5695 | 5695 | <span class="self">self</span>.cached[result] = id; |
5696 | 5696 | } |
5697 | 5697 |
|
5698 | | - <span class="kw">let </span>pointer_id = <span class="kw">match </span><span class="self">self</span>.write_expression_pointer( |
| 5698 | + <span class="kw">let </span>pointer_id = <span class="kw">match </span><span class="self">self</span>.write_access_chain( |
5699 | 5699 | pointer, |
5700 | 5700 | <span class="kw-2">&mut </span>block, |
5701 | 5701 | AccessTypeAdjustment::None, |
|
5867 | 5867 | .write_barrier(<span class="kw">crate</span>::Barrier::WORK_GROUP, <span class="kw-2">&mut </span>block); |
5868 | 5868 | <span class="kw">let </span>result_type_id = <span class="self">self</span>.get_expression_type_id(<span class="kw-2">&</span><span class="self">self</span>.fun_info[result].ty); |
5869 | 5869 | <span class="comment">// Embed the body of |
5870 | | - </span><span class="kw">match </span><span class="self">self</span>.write_expression_pointer( |
| 5870 | + </span><span class="kw">match </span><span class="self">self</span>.write_access_chain( |
5871 | 5871 | pointer, |
5872 | 5872 | <span class="kw-2">&mut </span>block, |
5873 | 5873 | AccessTypeAdjustment::None, |
|
0 commit comments