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,
/* 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,
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;
}
* 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,
}
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;
}
* 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)
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;
}
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.
*/
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;
}