We'll use this for UBO surfaces.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
uint32_t brw_get_surface_num_multisamples(unsigned num_samples);
void brw_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
+ uint32_t offset,
int width,
uint32_t *out_offset);
void gen7_init_vtable_surface_functions(struct brw_context *brw);
void gen7_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
+ uint32_t offset,
int width,
uint32_t *out_offset);
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,
+ intel->vtbl.create_constant_surface(brw, brw->vs.const_bo, 0,
params->NumParameters,
&brw->vs.surf_offset[surf]);
void
brw_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
+ uint32_t offset,
int width,
uint32_t *out_offset)
{
if (intel->gen >= 6)
surf[0] |= BRW_SURFACE_RC_READ_WRITE;
- surf[1] = bo->offset; /* reloc */
+ surf[1] = bo->offset + offset; /* reloc */
surf[2] = ((w & 0x7f) << BRW_SURFACE_WIDTH_SHIFT |
((w >> 7) & 0x1fff) << BRW_SURFACE_HEIGHT_SHIFT);
*/
drm_intel_bo_emit_reloc(brw->intel.batch.bo,
*out_offset + 4,
- bo, 0,
+ bo, offset,
I915_GEM_DOMAIN_SAMPLER, 0);
}
}
drm_intel_gem_bo_unmap_gtt(brw->wm.const_bo);
- intel->vtbl.create_constant_surface(brw, brw->wm.const_bo,
+ intel->vtbl.create_constant_surface(brw, brw->wm.const_bo, 0,
params->NumParameters,
&brw->wm.surf_offset[surf_index]);
void
gen7_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
+ uint32_t offset,
int width,
uint32_t *out_offset)
{
surf->ss0.render_cache_read_write = 1;
assert(bo);
- surf->ss1.base_addr = bo->offset; /* reloc */
+ surf->ss1.base_addr = bo->offset + offset; /* reloc */
surf->ss2.width = w & 0x7f; /* bits 6:0 of size or width */
surf->ss2.height = (w >> 7) & 0x1fff; /* bits 19:7 of size or width */
drm_intel_bo_emit_reloc(brw->intel.batch.bo,
(*out_offset +
offsetof(struct gen7_surface_state, ss1)),
- bo, 0,
+ bo, offset,
I915_GEM_DOMAIN_SAMPLER, 0);
gen7_check_surface_setup(surf, false /* is_render_target */);
unsigned unit);
void (*create_constant_surface)(struct brw_context *brw,
drm_intel_bo *bo,
+ uint32_t offset,
int width,
uint32_t *out_offset);
/** \} */