wm_prog_data->base.nr_params = 0;
wm_prog_data->base.param = NULL;
- /* BLORP always just uses the first two binding table entries */
- wm_prog_data->binding_table.render_target_start = BLORP_RENDERBUFFER_BT_INDEX;
+ /* BLORP always uses the first two binding table entries:
+ * - Surface 0 is the render target (which always start from 0)
+ * - Surface 1 is the source texture
+ */
wm_prog_data->base.binding_table.texture_start = BLORP_TEXTURE_BT_INDEX;
nir = brw_preprocess_nir(compiler, nir);
/** @{
* surface indices the WM-specific surfaces
*/
- uint32_t render_target_start;
uint32_t render_target_read_start;
/** @} */
} binding_table;
* messages set "Render Target Index" to 0. Using a different binding
* table index would make it impossible to use headerless messages.
*/
- assert(prog_data->binding_table.render_target_start == 0);
-
const uint32_t surf_index = inst->target;
bool last_render_target = inst->eot ||
{
assert(inst->size_written % REG_SIZE == 0);
struct brw_wm_prog_data *prog_data = brw_wm_prog_data(this->prog_data);
- const unsigned surf_index =
- prog_data->binding_table.render_target_start + inst->target;
+ /* We assume that render targets start at binding table index 0. */
+ const unsigned surf_index = inst->target;
gen9_fb_READ(p, dst, payload, surf_index,
inst->header_size, inst->size_written / REG_SIZE,
const struct brw_wm_prog_key *key,
struct brw_wm_prog_data *prog_data)
{
- uint32_t next_binding_table_offset = 0;
-
- /* If there are no color regions, we still perform an FB write to a null
- * renderbuffer, which we place at surface index 0.
+ /* Render targets implicitly start at surface index 0. Even if there are
+ * no color regions, we still perform an FB write to a null render target,
+ * which will be surface 0.
*/
- prog_data->binding_table.render_target_start = next_binding_table_offset;
- next_binding_table_offset += MAX2(key->nr_color_regions, 1);
+ uint32_t next_binding_table_offset = MAX2(key->nr_color_regions, 1);
next_binding_table_offset =
brw_assign_common_binding_table_offsets(devinfo, prog, &prog_data->base,