struct brw_bo *bo =
intel_bufferobj_buffer(brw,
intel_buffer_object(indirect_buffer),
- indirect, 3 * sizeof(GLuint));
+ indirect, 3 * sizeof(GLuint), false);
brw->compute.num_work_groups_bo = bo;
brw->compute.num_work_groups_offset = indirect;
struct gl_buffer_object *indirect_buffer = brw->ctx.DrawIndirectBuffer;
struct brw_bo *bo = intel_bufferobj_buffer(brw,
intel_buffer_object(indirect_buffer),
- prim->indirect_offset, 5 * sizeof(GLuint));
+ prim->indirect_offset, 5 * sizeof(GLuint), false);
indirect_flag = GEN7_3DPRIM_INDIRECT_PARAMETER_ENABLE;
const uint32_t start = buffer_range_start[i];
const uint32_t range = buffer_range_end[i] - buffer_range_start[i];
- buffer->bo = intel_bufferobj_buffer(brw, enabled_buffer[i], start, range);
+ buffer->bo = intel_bufferobj_buffer(brw, enabled_buffer[i], start,
+ range, false);
brw_bo_reference(buffer->bo);
}
struct brw_bo *bo =
intel_bufferobj_buffer(brw, intel_buffer_object(bufferobj),
- offset, ib_size);
+ offset, ib_size, false);
if (bo != brw->ib.bo) {
brw_bo_unreference(brw->ib.bo);
brw->ib.bo = bo;
if (intel_obj) {
size = MIN2(size, intel_obj->Base.Size);
- bo = intel_bufferobj_buffer(brw, intel_obj, tObj->BufferOffset, size);
+ bo = intel_bufferobj_buffer(brw, intel_obj, tObj->BufferOffset, size,
+ false);
}
/* The ARB_texture_buffer_specification says:
uint32_t offset_bytes = 4 * offset_dwords;
struct brw_bo *bo = intel_bufferobj_buffer(brw, intel_bo,
offset_bytes,
- buffer_obj->Size - offset_bytes);
+ buffer_obj->Size - offset_bytes,
+ true);
uint32_t *surf = brw_state_batch(brw, 6 * 4, 32, out_offset);
uint32_t pitch_minus_1 = 4*stride_dwords - 1;
size_t size_dwords = buffer_obj->Size / 4;
struct brw_bo *bo =
intel_bufferobj_buffer(brw, intel_bo,
binding->Offset,
- size);
+ size, false);
brw_create_constant_surface(brw, bo, binding->Offset,
size,
&ubo_surf_offsets[i]);
struct brw_bo *bo =
intel_bufferobj_buffer(brw, intel_bo,
binding->Offset,
- size);
+ size, true);
brw_create_buffer_surface(brw, bo, binding->Offset,
size,
&ssbo_surf_offsets[i]);
&ctx->AtomicBufferBindings[prog->sh.AtomicBuffers[i]->Binding];
struct intel_buffer_object *intel_bo =
intel_buffer_object(binding->BufferObject);
- struct brw_bo *bo = intel_bufferobj_buffer(
- brw, intel_bo, binding->Offset, intel_bo->Base.Size - binding->Offset);
+ struct brw_bo *bo =
+ intel_bufferobj_buffer(brw, intel_bo, binding->Offset,
+ intel_bo->Base.Size - binding->Offset,
+ true);
brw_emit_buffer_surface_state(brw, &surf_offsets[i], bo,
binding->Offset, ISL_FORMAT_RAW,
assert(start % 4 == 0);
uint32_t end = ALIGN(start + xfb_obj->Size[i], 4);
struct brw_bo *bo =
- intel_bufferobj_buffer(brw, bufferobj, start, end - start);
+ intel_bufferobj_buffer(brw, bufferobj, start, end - start, true);
assert(end <= bo->size);
brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) {
struct brw_bo *
intel_bufferobj_buffer(struct brw_context *brw,
struct intel_buffer_object *intel_obj,
- uint32_t offset, uint32_t size)
+ uint32_t offset, uint32_t size, bool write)
{
/* This is needed so that things like transform feedback and texture buffer
* objects that need a BO but don't want to check that they exist for
if (size == 0)
return;
- dst_bo = intel_bufferobj_buffer(brw, intel_dst, write_offset, size);
- src_bo = intel_bufferobj_buffer(brw, intel_src, read_offset, size);
+ dst_bo = intel_bufferobj_buffer(brw, intel_dst, write_offset, size, true);
+ src_bo = intel_bufferobj_buffer(brw, intel_src, read_offset, size, false);
intel_emit_linear_blit(brw,
dst_bo, write_offset,
/* Get the bm buffer associated with a GL bufferobject:
*/
struct brw_bo *intel_bufferobj_buffer(struct brw_context *brw,
- struct intel_buffer_object *obj,
- uint32_t offset,
- uint32_t size);
+ struct intel_buffer_object *obj,
+ uint32_t offset,
+ uint32_t size,
+ bool write);
void intel_upload_data(struct brw_context *brw,
const void *data,
format, type, 0, 0, 0);
src_buffer = intel_bufferobj_buffer(brw, src, src_offset,
- height * src_stride);
+ height * src_stride, false);
struct intel_mipmap_tree *pbo_mt =
intel_miptree_create_for_bo(brw,
struct brw_bo *bo = intel_bufferobj_buffer(brw, intel_buffer_obj,
buffer_offset,
- row_stride * image->Height);
+ row_stride * image->Height,
+ !read_only);
intel_texobj->mt =
intel_miptree_create_for_bo(brw, bo,
image->TexFormat,