PrevUpHomeNext

Shader storage blocks

#include <oglplus/shader_storage_block.hpp>

Basic block location operations

template <>
class ProgVarLocOps<tag::ShaderStorageBlock>
{
public:
	static GLint GetLocation(
		ProgramName program,
		StrCRef identifier,
		bool active_only
	); 1
};

1

Finds the location of the shader storage block specified by identifier in a program. If active_only is true then throws ProgVarError if no such shader storage block exists or if it is not active. See glGetProgramResourceIndex.

Common shader storage block operations

template <>
class ProgVarCommonOps<tag::ShaderStorageBlock>
 : public ProgVarLoc<tag::ShaderStorageBlock>
{
public:
	static GLuint MaxIn(ShaderType shader_type); 1

	GLuint64 DataSize(void) const; 2

	void Binding(ShaderStorageBufferBindingPoint binding); 3
};

1

Returns the maximum number of shader storage blocks for a shader_type.

2

Returns the size of the shader storage block. See glGetActiveShaderStorageBlock, GL_UNIFORM_BLOCK_DATA_SIZE.

3

Sets up the shader storage block binding. See glShaderStorageBlockBinding.

Definition

template <typename T>
using ShaderStorage = ProgVar<
	tag::ImplicitSel,
	tag::ShaderStorageBlock,
	tag::NoTypecheck,
	void
>; 1

1

ShaderStorageBlock indirectly inherits from ProgVarLocOps and ProgVarCommonOps.


PrevUpHomeNext