* surface indices the WM-specific surfaces
*/
uint32_t render_target_start;
+ uint32_t render_target_read_start;
/** @} */
} binding_table;
* unused but also make sure that addition of small offsets to them will
* trigger some of our asserts that surface indices are < BRW_MAX_SURFACES.
*/
-void
+uint32_t
brw_assign_common_binding_table_offsets(gl_shader_stage stage,
const struct brw_device_info *devinfo,
const struct gl_shader_program *shader_prog,
stage_prog_data->binding_table.plane_start[2] = next_binding_table_offset;
next_binding_table_offset += num_textures;
- assert(next_binding_table_offset <= BRW_MAX_SURFACES);
-
/* prog_data->base.binding_table.size will be set by brw_mark_surface_used. */
+
+ assert(next_binding_table_offset <= BRW_MAX_SURFACES);
+ return next_binding_table_offset;
}
static void
unsigned control_data_header_size_bits;
};
-void
+uint32_t
brw_assign_common_binding_table_offsets(gl_shader_stage stage,
const struct brw_device_info *devinfo,
const struct gl_shader_program *shader_prog,
prog_data->binding_table.render_target_start = next_binding_table_offset;
next_binding_table_offset += MAX2(key->nr_color_regions, 1);
- brw_assign_common_binding_table_offsets(MESA_SHADER_FRAGMENT, devinfo,
- shader_prog, prog, &prog_data->base,
- next_binding_table_offset);
+ next_binding_table_offset =
+ brw_assign_common_binding_table_offsets(MESA_SHADER_FRAGMENT, devinfo,
+ shader_prog, prog, &prog_data->base,
+ next_binding_table_offset);
+
+ if (prog->nir->info.outputs_read && !key->coherent_fb_fetch) {
+ prog_data->binding_table.render_target_read_start =
+ next_binding_table_offset;
+ next_binding_table_offset += key->nr_color_regions;
+ }
}
/**