i965: Unvirtualize brw_create_constant_surface; delete Gen7+ variant.

Now that brw_create_constant_surface uses a virtual function internally,
it doesn't need to be virtual itself.  We can delete the Gen7+ variant
and simplify things.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Kenneth Graunke 2013-11-01 17:37:10 -07:00
parent ee23dd139a
commit 7a974a645e
4 changed files with 17 additions and 45 deletions

View file

@ -976,12 +976,6 @@ struct brw_context
unsigned unit);
void (*update_null_renderbuffer_surface)(struct brw_context *brw,
unsigned unit);
void (*create_constant_surface)(struct brw_context *brw,
drm_intel_bo *bo,
uint32_t offset,
uint32_t size,
uint32_t *out_offset,
bool dword_pitch);
void (*create_raw_surface)(struct brw_context *brw,
drm_intel_bo *bo,
@ -1577,6 +1571,12 @@ unsigned brw_get_index_type(GLenum type);
/* brw_wm_surface_state.c */
void brw_init_surface_formats(struct brw_context *brw);
void brw_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
uint32_t offset,
uint32_t size,
uint32_t *out_offset,
bool dword_pitch);
void
brw_update_sol_surface(struct brw_context *brw,
struct gl_buffer_object *buffer_obj,

View file

@ -85,9 +85,9 @@ brw_upload_vec4_pull_constants(struct brw_context *brw,
drm_intel_gem_bo_unmap_gtt(stage_state->const_bo);
brw->vtbl.create_constant_surface(brw, stage_state->const_bo, 0, size,
&stage_state->surf_offset[surf_index],
false);
brw_create_constant_surface(brw, stage_state->const_bo, 0, size,
&stage_state->surf_offset[surf_index],
false);
brw->state.dirty.brw |= brw_new_constbuf;
}

View file

@ -321,7 +321,7 @@ brw_update_texture_surface(struct gl_context *ctx,
* Create the constant buffer surface. Vertex/fragment shader constants will be
* read from this buffer with Data Port Read instructions/messages.
*/
static void
void
brw_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
uint32_t offset,
@ -469,9 +469,9 @@ brw_upload_wm_pull_constants(struct brw_context *brw)
}
drm_intel_gem_bo_unmap_gtt(brw->wm.base.const_bo);
brw->vtbl.create_constant_surface(brw, brw->wm.base.const_bo, 0, size,
&brw->wm.base.surf_offset[surf_index],
true);
brw_create_constant_surface(brw, brw->wm.base.const_bo, 0, size,
&brw->wm.base.surf_offset[surf_index],
true);
brw->state.dirty.brw |= BRW_NEW_SURFACES;
}
@ -840,10 +840,10 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
* glBindBufferRange case is undefined, we can just bind the whole buffer
* glBindBufferBase wants and be a correct implementation.
*/
brw->vtbl.create_constant_surface(brw, bo, binding->Offset,
bo->size - binding->Offset,
&surf_offsets[i],
shader->Type == GL_FRAGMENT_SHADER);
brw_create_constant_surface(brw, bo, binding->Offset,
bo->size - binding->Offset,
&surf_offsets[i],
shader->Type == GL_FRAGMENT_SHADER);
}
if (shader->NumUniformBlocks)
@ -931,6 +931,5 @@ gen4_init_vtable_surface_functions(struct brw_context *brw)
brw->vtbl.update_renderbuffer_surface = brw_update_renderbuffer_surface;
brw->vtbl.update_null_renderbuffer_surface =
brw_update_null_renderbuffer_surface;
brw->vtbl.create_constant_surface = brw_create_constant_surface;
brw->vtbl.emit_buffer_surface_state = gen4_emit_buffer_surface_state;
}

View file

@ -397,32 +397,6 @@ gen7_update_texture_surface(struct gl_context *ctx,
gen7_check_surface_setup(surf, false /* is_render_target */);
}
/**
* Create the constant buffer surface. Vertex/fragment shader constants will
* be read from this buffer with Data Port Read instructions/messages.
*/
static void
gen7_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
uint32_t offset,
uint32_t size,
uint32_t *out_offset,
bool dword_pitch)
{
uint32_t stride = dword_pitch ? 4 : 16;
uint32_t elements = ALIGN(size, stride) / stride;
gen7_emit_buffer_surface_state(brw,
out_offset,
bo,
offset,
BRW_SURFACEFORMAT_R32G32B32A32_FLOAT,
elements,
stride,
0 /* mocs */,
false /* rw */);
}
/**
* Create a raw surface for untyped R/W access.
*/
@ -613,7 +587,6 @@ gen7_init_vtable_surface_functions(struct brw_context *brw)
brw->vtbl.update_renderbuffer_surface = gen7_update_renderbuffer_surface;
brw->vtbl.update_null_renderbuffer_surface =
gen7_update_null_renderbuffer_surface;
brw->vtbl.create_constant_surface = gen7_create_constant_surface;
brw->vtbl.create_raw_surface = gen7_create_raw_surface;
brw->vtbl.emit_buffer_surface_state = gen7_emit_buffer_surface_state;
}