diff --git a/src/nouveau/compiler/nak.h b/src/nouveau/compiler/nak.h index 8bc9218d57c..c5286a2a060 100644 --- a/src/nouveau/compiler/nak.h +++ b/src/nouveau/compiler/nak.h @@ -87,7 +87,12 @@ struct nak_constant_offset_info { uint32_t sample_masks_offset; /** - * The offset into cb0 for the printf buffer pointer. + * The constant buffer index at which the printf buffer pointer lives. + */ + uint8_t printf_cb; + + /** + * The offset into printf_cb for the printf buffer pointer. */ uint32_t printf_buffer_offset; }; diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 4577189204f..27a3384f5cd 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -835,7 +835,7 @@ nak_nir_lower_printf_intrin(nir_builder *b, nir_intrinsic_instr *intrin, if (intrin->intrinsic == nir_intrinsic_load_printf_buffer_address) { nir_def *buffer_addr = nir_ldc_nv( b, 1, 64, - nir_imm_int(b, 0), + nir_imm_int(b, nak_const_offsets(nak, is_graphics)->printf_cb), nir_imm_int(b, nak_const_offsets(nak, is_graphics)->printf_buffer_offset)); nir_def_replace(&intrin->def, buffer_addr); return true; diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index d570e3ad17c..550ee5b1f7c 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -38,6 +38,7 @@ const struct nak_constant_offset_info nak_const_offsets_base = { .sample_info_cb = 0, .sample_locations_offset = nvk_root_descriptor_offset(draw.sample_locations), .sample_masks_offset = nvk_root_descriptor_offset(draw.sample_masks), + .printf_cb = 0, .printf_buffer_offset = nvk_root_descriptor_offset(printf_buffer_addr), };