gen7_check_surface_setup(surf, false /* is_render_target */);
}
-static void
-gen7_update_buffer_texture_surface(struct gl_context *ctx,
- unsigned unit,
- uint32_t *surf_offset)
-{
- struct brw_context *brw = brw_context(ctx);
- struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
- struct intel_buffer_object *intel_obj =
- intel_buffer_object(tObj->BufferObject);
- uint32_t size = tObj->BufferSize;
- drm_intel_bo *bo = NULL;
-
- if (intel_obj) {
- size = MIN2(size, intel_obj->Base.Size);
- bo = intel_bufferobj_buffer(brw, intel_obj, tObj->BufferOffset, size);
- }
-
- gl_format format = tObj->_BufferObjectFormat;
-
- uint32_t surface_format = brw_format_for_mesa_format(format);
- if (surface_format == 0 && format != MESA_FORMAT_RGBA_FLOAT32) {
- _mesa_problem(NULL, "bad format %s for texture buffer\n",
- _mesa_get_format_name(format));
- }
-
- int texel_size = _mesa_get_format_bytes(format);
-
- gen7_emit_buffer_surface_state(brw,
- surf_offset,
- bo,
- tObj->BufferOffset,
- surface_format,
- size / texel_size,
- texel_size,
- 0 /* mocs */,
- false /* rw */);
-}
-
static void
gen7_update_texture_surface(struct gl_context *ctx,
unsigned unit,
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
if (tObj->Target == GL_TEXTURE_BUFFER) {
- gen7_update_buffer_texture_surface(ctx, unit, surf_offset);
+ brw_update_buffer_texture_surface(ctx, unit, surf_offset);
return;
}