Commit 98a1a2c7 authored by Iago Toral's avatar Iago Toral Committed by Samuel Iglesias Gonsálvez

mesa: Initialize and free shader storage buffers

v2:
- Fix indention, used tabs instead of whitespaces. (Jordan)
Reviewed-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
parent 2747d566
......@@ -836,6 +836,9 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
_mesa_reference_buffer_object(ctx, &ctx->UniformBuffer,
ctx->Shared->NullBufferObj);
_mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer,
ctx->Shared->NullBufferObj);
_mesa_reference_buffer_object(ctx, &ctx->AtomicBuffer,
ctx->Shared->NullBufferObj);
......@@ -850,6 +853,14 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
ctx->UniformBufferBindings[i].Size = -1;
}
for (i = 0; i < MAX_COMBINED_SHADER_STORAGE_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->ShaderStorageBufferBindings[i].BufferObject,
ctx->Shared->NullBufferObj);
ctx->ShaderStorageBufferBindings[i].Offset = -1;
ctx->ShaderStorageBufferBindings[i].Size = -1;
}
for (i = 0; i < MAX_COMBINED_ATOMIC_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->AtomicBufferBindings[i].BufferObject,
......@@ -872,6 +883,8 @@ _mesa_free_buffer_objects( struct gl_context *ctx )
_mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, NULL);
_mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer, NULL);
_mesa_reference_buffer_object(ctx, &ctx->AtomicBuffer, NULL);
_mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer, NULL);
......@@ -882,6 +895,12 @@ _mesa_free_buffer_objects( struct gl_context *ctx )
NULL);
}
for (i = 0; i < MAX_COMBINED_SHADER_STORAGE_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->ShaderStorageBufferBindings[i].BufferObject,
NULL);
}
for (i = 0; i < MAX_COMBINED_ATOMIC_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->AtomicBufferBindings[i].BufferObject,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment