Skip to content

Commit 918ddf1

Browse files
committed
Revert change that resulted in unnecessary casts
1 parent f626c65 commit 918ddf1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

naga/src/back/hlsl/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4506,10 +4506,10 @@ fn get_inner_matrix_of_global_uniform(
45064506
base: Handle<crate::Expression>,
45074507
func_ctx: &back::FunctionCtx<'_>,
45084508
) -> Option<MatrixType> {
4509-
let (mut current_base, _, _) = find_matrix_in_access_chain(module, base, func_ctx)?;
45104509
let mut mat_data = None;
45114510
let mut array_base = None;
45124511

4512+
let mut current_base = base;
45134513
loop {
45144514
let mut resolved = func_ctx.resolve_type(current_base, &module.types);
45154515
if let TypeInner::Pointer { base, .. } = *resolved {

naga/tests/out/hlsl/wgsl-hlsl_mat_cx2.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ void access_m()
5353
int _e31 = idx;
5454
float l_s_e_vv = asfloat(s_m.Load(_e31*4+_e29*8));
5555
float2x2 l_u_m = ((float2x2)u_m);
56-
float2 l_u_c_c = ((float2)u_m._0);
56+
float2 l_u_c_c = u_m._0;
5757
int _e40 = idx;
58-
float2 l_u_c_v = ((float2)__get_col_of_mat2x2(u_m, _e40));
59-
float l_u_e_cc = ((float)u_m._0.x);
58+
float2 l_u_c_v = __get_col_of_mat2x2(u_m, _e40);
59+
float l_u_e_cc = u_m._0.x;
6060
int _e49 = idx;
61-
float l_u_e_cv = ((float)u_m._0[_e49]);
61+
float l_u_e_cv = u_m._0[_e49];
6262
int _e53 = idx;
63-
float l_u_e_vc = ((float)__get_col_of_mat2x2(u_m, _e53).x);
63+
float l_u_e_vc = __get_col_of_mat2x2(u_m, _e53).x;
6464
int _e58 = idx;
6565
int _e60 = idx;
66-
float l_u_e_vv = ((float)__get_col_of_mat2x2(u_m, _e58)[_e60]);
66+
float l_u_e_vv = __get_col_of_mat2x2(u_m, _e58)[_e60];
6767
{
6868
float2x2 _value2 = l_u_m;
6969
s_m.Store2(0, asuint(_value2[0]));

0 commit comments

Comments
 (0)