{
struct intel_context intel; /**< base class, must be first field */
+ struct
+ {
+ void (*destroy) (struct brw_context * brw);
+ void (*finish_batch) (struct brw_context * brw);
+ void (*new_batch) (struct brw_context * brw);
+
+ void (*update_texture_surface)(struct gl_context *ctx,
+ unsigned unit,
+ uint32_t *binding_table,
+ unsigned surf_index);
+ void (*update_renderbuffer_surface)(struct brw_context *brw,
+ struct gl_renderbuffer *rb,
+ bool layered,
+ 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);
+
+ /**
+ * Send the appropriate state packets to configure depth, stencil, and
+ * HiZ buffers (i965+ only)
+ */
+ void (*emit_depth_stencil_hiz)(struct brw_context *brw,
+ struct intel_mipmap_tree *depth_mt,
+ uint32_t depth_offset,
+ uint32_t depthbuffer_format,
+ uint32_t depth_surface_type,
+ struct intel_mipmap_tree *stencil_mt,
+ bool hiz, bool separate_stencil,
+ uint32_t width, uint32_t height,
+ uint32_t tile_x, uint32_t tile_y);
+
+ } vtbl;
+
/** drirc option cache */
driOptionCache optionCache;
height = stencil_irb->Base.Base.Height;
}
- intel->vtbl.emit_depth_stencil_hiz(brw, depth_mt, depth_offset,
- depthbuffer_format, depth_surface_type,
- stencil_mt, hiz, separate_stencil,
- width, height, tile_x, tile_y);
+ brw->vtbl.emit_depth_stencil_hiz(brw, depth_mt, depth_offset,
+ depthbuffer_format, depth_surface_type,
+ stencil_mt, hiz, separate_stencil,
+ width, height, tile_x, tile_y);
}
void
drm_intel_gem_bo_unmap_gtt(brw->vs.const_bo);
const int surf = SURF_INDEX_VERT_CONST_BUFFER;
- intel->vtbl.create_constant_surface(brw, brw->vs.const_bo, 0, size,
- &brw->vs.surf_offset[surf], false);
+ brw->vtbl.create_constant_surface(brw, brw->vs.const_bo, 0, size,
+ &brw->vs.surf_offset[surf], false);
brw->state.dirty.brw |= BRW_NEW_VS_CONSTBUF;
}
void brwInitVtbl( struct brw_context *brw )
{
- brw->intel.vtbl.new_batch = brw_new_batch;
- brw->intel.vtbl.finish_batch = brw_finish_batch;
- brw->intel.vtbl.destroy = brw_destroy_context;
+ brw->vtbl.new_batch = brw_new_batch;
+ brw->vtbl.finish_batch = brw_finish_batch;
+ brw->vtbl.destroy = brw_destroy_context;
assert(brw->intel.gen >= 4);
if (brw->intel.gen >= 7) {
gen7_init_vtable_surface_functions(brw);
- brw->intel.vtbl.emit_depth_stencil_hiz = gen7_emit_depth_stencil_hiz;
+ brw->vtbl.emit_depth_stencil_hiz = gen7_emit_depth_stencil_hiz;
} else if (brw->intel.gen >= 4) {
gen4_init_vtable_surface_functions(brw);
- brw->intel.vtbl.emit_depth_stencil_hiz = brw_emit_depth_stencil_hiz;
+ brw->vtbl.emit_depth_stencil_hiz = brw_emit_depth_stencil_hiz;
}
}
}
drm_intel_gem_bo_unmap_gtt(brw->wm.const_bo);
- intel->vtbl.create_constant_surface(brw, brw->wm.const_bo, 0, size,
- &brw->wm.surf_offset[surf_index],
- true);
+ brw->vtbl.create_constant_surface(brw, brw->wm.const_bo, 0, size,
+ &brw->wm.surf_offset[surf_index],
+ true);
brw->state.dirty.brw |= BRW_NEW_SURFACES;
}
static void
brw_update_renderbuffer_surfaces(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &brw->intel.ctx;
GLuint i;
if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) {
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
if (intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[i])) {
- intel->vtbl.update_renderbuffer_surface(brw, ctx->DrawBuffer->_ColorDrawBuffers[i],
- ctx->DrawBuffer->Layered, i);
+ brw->vtbl.update_renderbuffer_surface(brw, ctx->DrawBuffer->_ColorDrawBuffers[i],
+ ctx->DrawBuffer->Layered, i);
} else {
- intel->vtbl.update_null_renderbuffer_surface(brw, i);
+ brw->vtbl.update_null_renderbuffer_surface(brw, i);
}
}
} else {
- intel->vtbl.update_null_renderbuffer_surface(brw, 0);
+ brw->vtbl.update_null_renderbuffer_surface(brw, 0);
}
brw->state.dirty.brw |= BRW_NEW_SURFACES;
}
/* _NEW_TEXTURE */
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- intel->vtbl.update_texture_surface(ctx, unit,
- brw->vs.surf_offset,
- SURF_INDEX_VS_TEXTURE(s));
+ brw->vtbl.update_texture_surface(ctx, unit,
+ brw->vs.surf_offset,
+ SURF_INDEX_VS_TEXTURE(s));
}
}
/* _NEW_TEXTURE */
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- intel->vtbl.update_texture_surface(ctx, unit,
- brw->wm.surf_offset,
- SURF_INDEX_TEXTURE(s));
+ brw->vtbl.update_texture_surface(ctx, unit,
+ brw->wm.surf_offset,
+ SURF_INDEX_TEXTURE(s));
}
}
}
uint32_t *surf_offsets)
{
struct gl_context *ctx = &brw->intel.ctx;
- struct intel_context *intel = &brw->intel;
if (!shader)
return;
* glBindBufferRange case is undefined, we can just bind the whole buffer
* glBindBufferBase wants and be a correct implementation.
*/
- intel->vtbl.create_constant_surface(brw, bo, binding->Offset,
- bo->size - binding->Offset,
- &surf_offsets[i],
- shader->Type == GL_FRAGMENT_SHADER);
+ brw->vtbl.create_constant_surface(brw, bo, binding->Offset,
+ bo->size - binding->Offset,
+ &surf_offsets[i],
+ shader->Type == GL_FRAGMENT_SHADER);
}
if (shader->NumUniformBlocks)
void
gen4_init_vtable_surface_functions(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
-
- intel->vtbl.update_texture_surface = brw_update_texture_surface;
- intel->vtbl.update_renderbuffer_surface = brw_update_renderbuffer_surface;
- intel->vtbl.update_null_renderbuffer_surface =
+ brw->vtbl.update_texture_surface = brw_update_texture_surface;
+ brw->vtbl.update_renderbuffer_surface = brw_update_renderbuffer_surface;
+ brw->vtbl.update_null_renderbuffer_surface =
brw_update_null_renderbuffer_surface;
- intel->vtbl.create_constant_surface = brw_create_constant_surface;
+ brw->vtbl.create_constant_surface = brw_create_constant_surface;
}
void
gen7_init_vtable_surface_functions(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
-
- intel->vtbl.update_texture_surface = gen7_update_texture_surface;
- intel->vtbl.update_renderbuffer_surface = gen7_update_renderbuffer_surface;
- intel->vtbl.update_null_renderbuffer_surface =
+ brw->vtbl.update_texture_surface = gen7_update_texture_surface;
+ brw->vtbl.update_renderbuffer_surface = gen7_update_renderbuffer_surface;
+ brw->vtbl.update_null_renderbuffer_surface =
gen7_update_null_renderbuffer_surface;
- intel->vtbl.create_constant_surface = gen7_create_constant_surface;
+ brw->vtbl.create_constant_surface = gen7_create_constant_surface;
}
fprintf(stderr, "intel_do_flush_locked failed: %s\n", strerror(-ret));
exit(1);
}
- intel->vtbl.new_batch(brw);
+ brw->vtbl.new_batch(brw);
return ret;
}
intel->batch.reserved_space = 0;
- if (intel->vtbl.finish_batch)
- intel->vtbl.finish_batch(brw);
+ if (brw->vtbl.finish_batch)
+ brw->vtbl.finish_batch(brw);
/* Mark the end of the buffer. */
intel_batchbuffer_emit_dword(brw, MI_BATCH_BUFFER_END);
_mesa_meta_free(&intel->ctx);
- intel->vtbl.destroy(brw);
+ brw->vtbl.destroy(brw);
if (ctx->swrast_context) {
_swsetup_DestroyContext(&intel->ctx);
{
struct gl_context ctx; /**< base class, must be first field */
- struct
- {
- void (*destroy) (struct brw_context * brw);
- void (*finish_batch) (struct brw_context * brw);
- void (*new_batch) (struct brw_context * brw);
-
- void (*update_texture_surface)(struct gl_context *ctx,
- unsigned unit,
- uint32_t *binding_table,
- unsigned surf_index);
- void (*update_renderbuffer_surface)(struct brw_context *brw,
- struct gl_renderbuffer *rb,
- bool layered,
- 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);
-
- /**
- * Send the appropriate state packets to configure depth, stencil, and
- * HiZ buffers (i965+ only)
- */
- void (*emit_depth_stencil_hiz)(struct brw_context *brw,
- struct intel_mipmap_tree *depth_mt,
- uint32_t depth_offset,
- uint32_t depthbuffer_format,
- uint32_t depth_surface_type,
- struct intel_mipmap_tree *stencil_mt,
- bool hiz, bool separate_stencil,
- uint32_t width, uint32_t height,
- uint32_t tile_x, uint32_t tile_y);
-
- } vtbl;
-
GLuint NewGLState;
dri_bufmgr *bufmgr;