summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-04-28 10:08:17 +0200
committerSamuel Iglesias Gonsalvez <[email protected]>2015-09-25 08:39:23 +0200
commit2e16dd1350703865104253a9d871e4c0a3257933 (patch)
tree7df48960904d08075cc784d523d813c2621e39d6 /src/mesa/main/get.c
parent4b7b1cf3c0b1682d5ae8983df2bbf5dea50081cd (diff)
mesa: Add queries for GL_SHADER_STORAGE_BUFFER
These handle querying the buffer name attached to a giving binding point as well as the start offset and size of that buffer. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index e643d3a5e36..2390850a0af 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1001,6 +1001,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
case GL_UNIFORM_BUFFER_BINDING:
v->value_int = ctx->UniformBuffer->Name;
break;
+ /* GL_ARB_shader_storage_buffer_object */
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ v->value_int = ctx->ShaderStorageBuffer->Name;
+ break;
/* GL_ARB_timer_query */
case GL_TIMESTAMP:
if (ctx->Driver.GetTimestamp) {
@@ -1939,6 +1943,33 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
v->value_int = ctx->UniformBufferBindings[index].Size;
return TYPE_INT;
+ /* ARB_shader_storage_buffer_object */
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ if (!ctx->Extensions.ARB_shader_storage_buffer_object)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxShaderStorageBufferBindings)
+ goto invalid_value;
+ v->value_int = ctx->ShaderStorageBufferBindings[index].BufferObject->Name;
+ return TYPE_INT;
+
+ case GL_SHADER_STORAGE_BUFFER_START:
+ if (!ctx->Extensions.ARB_shader_storage_buffer_object)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxShaderStorageBufferBindings)
+ goto invalid_value;
+ v->value_int = ctx->ShaderStorageBufferBindings[index].Offset < 0 ? 0 :
+ ctx->ShaderStorageBufferBindings[index].Offset;
+ return TYPE_INT;
+
+ case GL_SHADER_STORAGE_BUFFER_SIZE:
+ if (!ctx->Extensions.ARB_shader_storage_buffer_object)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxShaderStorageBufferBindings)
+ goto invalid_value;
+ v->value_int = ctx->ShaderStorageBufferBindings[index].Size < 0 ? 0 :
+ ctx->ShaderStorageBufferBindings[index].Size;
+ return TYPE_INT;
+
/* ARB_texture_multisample / GL3.2 */
case GL_SAMPLE_MASK_VALUE:
if (index != 0)