mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
Revert "st/mesa: add a simple path to BufferData if it only discards buffer contents"
This reverts commit 5649f886f7.
It causes segfaults when size is zero.
This commit is contained in:
parent
c7a13dc5f5
commit
c4bea00fb3
1 changed files with 0 additions and 14 deletions
|
|
@ -182,20 +182,6 @@ st_bufferobj_data(struct gl_context *ctx,
|
|||
struct st_buffer_object *st_obj = st_buffer_object(obj);
|
||||
unsigned bind, pipe_usage;
|
||||
|
||||
if (st_obj->Base.Size == size && st_obj->Base.Usage == usage && data) {
|
||||
/* Just discard the old contents and write new data.
|
||||
* This should be the same as creating a new buffer, but we avoid
|
||||
* a lot of validation in Mesa.
|
||||
*/
|
||||
struct pipe_box box;
|
||||
|
||||
u_box_1d(0, size, &box);
|
||||
pipe->transfer_inline_write(pipe, st_obj->buffer, 0,
|
||||
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE,
|
||||
&box, data, 0, 0);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
st_obj->Base.Size = size;
|
||||
st_obj->Base.Usage = usage;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue