This way it can be used anywhere. I need it from the visitor.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
struct brw_reg dst,
struct brw_reg surf_index);
- void mark_surface_used(unsigned surf_index);
-
void patch_discard_jumps_to_fb_writes();
struct brw_context *brw;
{
}
-void
-fs_generator::mark_surface_used(unsigned surf_index)
-{
- assert(surf_index < BRW_MAX_SURFACES);
-
- c->prog_data.base.binding_table.size_bytes =
- MAX2(c->prog_data.base.binding_table.size_bytes, (surf_index + 1) * 4);
-}
-
void
fs_generator::patch_discard_jumps_to_fb_writes()
{
eot,
inst->header_present);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&c->prog_data.base, surf_index);
}
void
simd_mode,
return_format);
- mark_surface_used(surface_index);
+ brw_mark_surface_used(&c->prog_data.base, surface_index);
}
brw_oword_block_read(p, dst, brw_message_reg(inst->base_mrf),
read_offset, surf_index);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&c->prog_data.base, surf_index);
}
void
BRW_SAMPLER_SIMD_MODE_SIMD4X2,
0);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&c->prog_data.base, surf_index);
}
void
simd_mode,
return_format);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&c->prog_data.base, surf_index);
}
void
simd_mode,
0);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&c->prog_data.base, surf_index);
}
/**
c->prog_data.base.binding_table.shader_time_start);
brw_pop_insn_state(p);
- mark_surface_used(c->prog_data.base.binding_table.shader_time_start);
+ brw_mark_surface_used(&c->prog_data.base,
+ c->prog_data.base.binding_table.shader_time_start);
}
void
atomic_op.dw1.ud, surf_index.dw1.ud,
inst->mlen, dispatch_width / 8);
- mark_surface_used(surf_index.dw1.ud);
+ brw_mark_surface_used(&c->prog_data.base, surf_index.dw1.ud);
}
void
surf_index.dw1.ud,
inst->mlen, dispatch_width / 8);
- mark_surface_used(surf_index.dw1.ud);
+ brw_mark_surface_used(&c->prog_data.base, surf_index.dw1.ud);
}
void
brw->shader_time.bo = NULL;
}
+void
+brw_mark_surface_used(struct brw_stage_prog_data *prog_data,
+ unsigned surf_index)
+{
+ assert(surf_index < BRW_MAX_SURFACES);
+
+ prog_data->binding_table.size_bytes =
+ MAX2(prog_data->binding_table.size_bytes, (surf_index + 1) * 4);
+}
+
bool
brw_stage_prog_data_compare(const struct brw_stage_prog_data *a,
const struct brw_stage_prog_data *b)
const struct brw_sampler_prog_key_data *key);
void brw_add_texrect_params(struct gl_program *prog);
+void
+brw_mark_surface_used(struct brw_stage_prog_data *prog_data,
+ unsigned surf_index);
+
bool
brw_stage_prog_data_compare(const struct brw_stage_prog_data *a,
const struct brw_stage_prog_data *b);
assert(next_binding_table_offset <= BRW_MAX_SURFACES);
- /* prog_data->base.binding_table.size will be set by mark_surface_used. */
+ /* prog_data->base.binding_table.size will be set by brw_mark_surface_used. */
}
struct brw_reg dst,
struct brw_reg surf_index);
- void mark_surface_used(unsigned surf_index);
-
struct brw_context *brw;
struct brw_compile *p;
{
}
-void
-vec4_generator::mark_surface_used(unsigned surf_index)
-{
- assert(surf_index < BRW_MAX_SURFACES);
-
- prog_data->base.binding_table.size_bytes =
- MAX2(prog_data->base.binding_table.size_bytes, (surf_index + 1) * 4);
-}
-
void
vec4_generator::generate_math1_gen4(vec4_instruction *inst,
struct brw_reg dst,
BRW_SAMPLER_SIMD_MODE_SIMD4X2,
return_format);
- mark_surface_used(surface_index);
+ brw_mark_surface_used(&prog_data->base, surface_index);
}
void
true, /* header_present */
1 /* rlen */);
- mark_surface_used(surf_index);
+ brw_mark_surface_used(&prog_data->base, surf_index);
}
void
BRW_SAMPLER_SIMD_MODE_SIMD4X2,
0);
- mark_surface_used(surf_index.dw1.ud);
+ brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
}
void
atomic_op.dw1.ud, surf_index.dw1.ud,
inst->mlen, 1);
- mark_surface_used(surf_index.dw1.ud);
+ brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
}
void
surf_index.dw1.ud,
inst->mlen, 1);
- mark_surface_used(surf_index.dw1.ud);
+ brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
}
/**
case SHADER_OPCODE_SHADER_TIME_ADD:
brw_shader_time_add(p, src[0],
prog_data->base.binding_table.shader_time_start);
- mark_surface_used(prog_data->base.binding_table.shader_time_start);
+ brw_mark_surface_used(&prog_data->base,
+ prog_data->base.binding_table.shader_time_start);
break;
case SHADER_OPCODE_UNTYPED_ATOMIC: