{
FREE(transfer);
}
-
-void u_default_redefine_user_buffer(struct pipe_context *ctx,
- struct pipe_resource *resource,
- unsigned offset,
- unsigned size)
-{
- resource->width0 = MAX2(resource->width0, offset + size);
-}
unsigned stride,
unsigned layer_stride);
-void u_default_redefine_user_buffer(struct pipe_context *ctx,
- struct pipe_resource *resource,
- unsigned offset,
- unsigned size);
-
#endif
}
-static void galahad_redefine_user_buffer(struct pipe_context *_context,
- struct pipe_resource *_resource,
- unsigned offset, unsigned size)
-{
- struct galahad_context *glhd_context = galahad_context(_context);
- struct galahad_resource *glhd_resource = galahad_resource(_resource);
- struct pipe_context *context = glhd_context->pipe;
- struct pipe_resource *resource = glhd_resource->resource;
-
- context->redefine_user_buffer(context, resource, offset, size);
-}
-
-
struct pipe_context *
galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
{
glhd_pipe->base.transfer_unmap = galahad_context_transfer_unmap;
glhd_pipe->base.transfer_flush_region = galahad_context_transfer_flush_region;
glhd_pipe->base.transfer_inline_write = galahad_context_transfer_inline_write;
- glhd_pipe->base.redefine_user_buffer = galahad_redefine_user_buffer;
glhd_pipe->pipe = pipe;
i915->base.set_viewport_state = i915_set_viewport_state;
i915->base.set_vertex_buffers = i915_set_vertex_buffers;
i915->base.set_index_buffer = i915_set_index_buffer;
- i915->base.redefine_user_buffer = u_default_redefine_user_buffer;
}
void
}
-static void identity_redefine_user_buffer(struct pipe_context *_context,
- struct pipe_resource *_resource,
- unsigned offset, unsigned size)
-{
- struct identity_context *id_context = identity_context(_context);
- struct identity_resource *id_resource = identity_resource(_resource);
- struct pipe_context *context = id_context->pipe;
- struct pipe_resource *resource = id_resource->resource;
-
- context->redefine_user_buffer(context, resource, offset, size);
-}
-
-
struct pipe_context *
identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
{
id_pipe->base.transfer_unmap = identity_context_transfer_unmap;
id_pipe->base.transfer_flush_region = identity_context_transfer_flush_region;
id_pipe->base.transfer_inline_write = identity_context_transfer_inline_write;
- id_pipe->base.redefine_user_buffer = identity_redefine_user_buffer;
id_pipe->pipe = pipe;
llvmpipe->pipe.set_vertex_buffers = llvmpipe_set_vertex_buffers;
llvmpipe->pipe.set_index_buffer = llvmpipe_set_index_buffer;
-
- llvmpipe->pipe.redefine_user_buffer = u_default_redefine_user_buffer;
}
ctx->sampler_view_destroy = noop_sampler_view_destroy;
ctx->surface_destroy = noop_surface_destroy;
ctx->draw_vbo = noop_draw_vbo;
- ctx->redefine_user_buffer = u_default_redefine_user_buffer;
ctx->create_stream_output_target = noop_create_stream_output_target;
ctx->stream_output_target_destroy = noop_stream_output_target_destroy;
ctx->set_stream_output_targets = noop_set_stream_output_targets;
pipe->set_vertex_buffers = nv30_set_vertex_buffers;
pipe->set_index_buffer = nv30_set_index_buffer;
-
- pipe->redefine_user_buffer = u_default_redefine_user_buffer;
}
pipe->set_vertex_buffers = nv50_set_vertex_buffers;
pipe->set_index_buffer = nv50_set_index_buffer;
-
- pipe->redefine_user_buffer = u_default_redefine_user_buffer;
}
pipe->create_stream_output_target = nvc0_so_target_create;
pipe->stream_output_target_destroy = nvc0_so_target_destroy;
pipe->set_stream_output_targets = nvc0_set_transform_feedback_targets;
-
- pipe->redefine_user_buffer = u_default_redefine_user_buffer;
}
r300->context.set_vertex_buffers = r300_set_vertex_buffers;
r300->context.set_index_buffer = r300_set_index_buffer;
- r300->context.redefine_user_buffer = u_default_redefine_user_buffer;
r300->context.create_vertex_elements_state = r300_create_vertex_elements_state;
r300->context.bind_vertex_elements_state = r300_bind_vertex_elements_state;
rctx->context.set_vertex_sampler_views = evergreen_set_vs_sampler_view;
rctx->context.set_viewport_state = evergreen_set_viewport_state;
rctx->context.sampler_view_destroy = r600_sampler_view_destroy;
- rctx->context.redefine_user_buffer = u_default_redefine_user_buffer;
rctx->context.texture_barrier = r600_texture_barrier;
rctx->context.create_stream_output_target = r600_create_so_target;
rctx->context.stream_output_target_destroy = r600_so_target_destroy;
rctx->context.set_vertex_sampler_views = r600_set_vs_sampler_views;
rctx->context.set_viewport_state = r600_set_viewport_state;
rctx->context.sampler_view_destroy = r600_sampler_view_destroy;
- rctx->context.redefine_user_buffer = u_default_redefine_user_buffer;
rctx->context.texture_barrier = r600_texture_barrier;
rctx->context.create_stream_output_target = r600_create_so_target;
rctx->context.stream_output_target_destroy = r600_so_target_destroy;
rctx->context.set_vertex_sampler_views = evergreen_set_vs_sampler_view;
rctx->context.set_viewport_state = evergreen_set_viewport_state;
rctx->context.sampler_view_destroy = r600_sampler_view_destroy;
- rctx->context.redefine_user_buffer = u_default_redefine_user_buffer;
rctx->context.texture_barrier = r600_texture_barrier;
rctx->context.create_stream_output_target = r600_create_so_target;
rctx->context.stream_output_target_destroy = r600_so_target_destroy;
}
-static void rbug_redefine_user_buffer(struct pipe_context *_context,
- struct pipe_resource *_resource,
- unsigned offset, unsigned size)
-{
- struct rbug_context *rb_pipe = rbug_context(_context);
- struct rbug_resource *rb_resource = rbug_resource(_resource);
- struct pipe_context *context = rb_pipe->pipe;
- struct pipe_resource *resource = rb_resource->resource;
-
- pipe_mutex_lock(rb_pipe->call_mutex);
- context->redefine_user_buffer(context, resource, offset, size);
- pipe_mutex_unlock(rb_pipe->call_mutex);
-}
-
-
struct pipe_context *
rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
{
rb_pipe->base.transfer_unmap = rbug_context_transfer_unmap;
rb_pipe->base.transfer_flush_region = rbug_context_transfer_flush_region;
rb_pipe->base.transfer_inline_write = rbug_context_transfer_inline_write;
- rb_pipe->base.redefine_user_buffer = rbug_redefine_user_buffer;
rb_pipe->pipe = pipe;
pipe->set_vertex_buffers = softpipe_set_vertex_buffers;
pipe->set_index_buffer = softpipe_set_index_buffer;
- pipe->redefine_user_buffer = u_default_redefine_user_buffer;
}
svga->pipe.transfer_unmap = u_transfer_unmap_vtbl;
svga->pipe.transfer_destroy = u_transfer_destroy_vtbl;
svga->pipe.transfer_inline_write = u_transfer_inline_write_vtbl;
- svga->pipe.redefine_user_buffer = svga_redefine_user_buffer;
}
void
unsigned usage,
unsigned size);
-void
-svga_redefine_user_buffer(struct pipe_context *ctx,
- struct pipe_resource *resource,
- unsigned offset,
- unsigned size);
-
#endif /* SVGA_BUFFER_H */
next = curr->next;
}
}
-
-
-void
-svga_redefine_user_buffer(struct pipe_context *pipe,
- struct pipe_resource *resource,
- unsigned offset,
- unsigned size)
-{
- struct svga_buffer *sbuf = svga_buffer(resource);
-
- assert(sbuf->user);
- assert(!sbuf->dma.pending);
- assert(!sbuf->handle);
- assert(!sbuf->hwbuf);
-
- /* use the default action of simply resizing the user buffer's size */
- u_default_redefine_user_buffer(pipe, resource, offset, size);
-}
}
-static void trace_redefine_user_buffer(struct pipe_context *_context,
- struct pipe_resource *_resource,
- unsigned offset, unsigned size)
-{
- struct trace_context *tr_context = trace_context(_context);
- struct trace_resource *tr_res = trace_resource(_resource);
- struct pipe_context *context = tr_context->pipe;
- struct pipe_resource *resource = tr_res->resource;
-
- assert(resource->screen == context->screen);
-
- trace_dump_call_begin("pipe_context", "redefine_user_buffer");
-
- trace_dump_arg(ptr, context);
- trace_dump_arg(ptr, resource);
- trace_dump_arg(uint, offset);
- trace_dump_arg(uint, size);
-
- trace_dump_call_end();
-
- context->redefine_user_buffer(context, resource, offset, size);
-}
-
-
static void trace_render_condition(struct pipe_context *_context,
struct pipe_query *query,
uint mode)
tr_ctx->base.transfer_unmap = trace_context_transfer_unmap;
tr_ctx->base.transfer_flush_region = trace_context_transfer_flush_region;
tr_ctx->base.transfer_inline_write = trace_context_transfer_inline_write;
- tr_ctx->base.redefine_user_buffer = trace_redefine_user_buffer;
tr_ctx->pipe = pipe;
unsigned stride,
unsigned layer_stride);
-
- /* Notify a driver that a content of a user buffer has been changed.
- * The changed range is [offset, offset+size-1].
- * The new width0 of the buffer is offset+size. */
- void (*redefine_user_buffer)(struct pipe_context *,
- struct pipe_resource *,
- unsigned offset,
- unsigned size);
-
/**
* Flush any pending framebuffer writes and invalidate texture caches.
*/