diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index e32c75a6bf2..c5954f59fcb 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -215,6 +215,7 @@ visit_intrinsic(nir_shader *shader, nir_intrinsic_instr *instr) case nir_intrinsic_load_poly_line_smooth_enabled: case nir_intrinsic_load_rasterization_primitive_amd: case nir_intrinsic_load_global_constant_uniform_block_intel: + case nir_intrinsic_cmat_length: is_divergent = false; break; @@ -608,6 +609,7 @@ visit_intrinsic(nir_shader *shader, nir_intrinsic_instr *instr) case nir_intrinsic_rq_proceed: case nir_intrinsic_rq_load: case nir_intrinsic_load_ray_triangle_vertex_positions: + case nir_intrinsic_cmat_extract: is_divergent = true; break; diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c index 0c2825d466f..5b5506edddf 100644 --- a/src/compiler/nir/nir_lower_indirect_derefs.c +++ b/src/compiler/nir/nir_lower_indirect_derefs.c @@ -152,6 +152,9 @@ lower_indirect_derefs_block(nir_block *block, nir_builder *b, if (!has_indirect || !base || indirect_array_len > max_lower_array_len) continue; + if (glsl_type_is_cmat(base->type)) + continue; + /* Only lower variables whose mode is in the mask, or compact * array variables. (We can't handle indirects on tightly packed * scalar arrays, so we need to lower them regardless.) diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 34f86c00475..cdf64e9a1ee 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -2454,7 +2454,8 @@ lower_vars_to_explicit(nir_shader *shader, glsl_type_is_struct_or_ifc(explicit_type) && glsl_get_length(explicit_type) == 0; - assert(util_is_power_of_two_nonzero(align) || is_empty_struct); + assert(util_is_power_of_two_nonzero(align) || is_empty_struct || + glsl_type_is_cmat(glsl_without_array(explicit_type))); var->data.driver_location = ALIGN_POT(offset, align); offset = var->data.driver_location + size; progress = true; diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c index 1fd6043aa33..468aef529cb 100644 --- a/src/compiler/nir/nir_lower_vars_to_ssa.c +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c @@ -222,6 +222,9 @@ get_deref_node(nir_deref_instr *deref, struct lower_variables_state *state) if (!nir_deref_mode_must_be(deref, nir_var_function_temp)) return NULL; + if (glsl_type_is_cmat(deref->type)) + return NULL; + struct deref_node *node = get_deref_node_recur(deref, state); if (!node) return NULL;