mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Add new texel buffer type.
GLSL 3+ shaders can read from texel buffers by declaring a uniform samplerBuffer variable and calling texelFetch with a 0-based index, in the shader code. All attributes in a texel buffer's format array must have the same data format (e.g. all 'floatvec4' formats). Shader:send accepts a texel Buffer for samplerBuffer uniforms. Added 'texelbuffer' to love.graphics.getSupported (requires GLSL 3+ and desktop OpenGL). Added 'texelbuffersize' to love.graphics.getSystemLimits. Returns the max number of values in a texel buffer (array length multiplied by the number of attributes declared in the buffer's format array).
This commit is contained in:
@@ -60,6 +60,7 @@ public:
|
||||
TYPEFLAG_NONE = 0,
|
||||
TYPEFLAG_VERTEX = 1 << BUFFERTYPE_VERTEX,
|
||||
TYPEFLAG_INDEX = 1 << BUFFERTYPE_INDEX,
|
||||
TYPEFLAG_TEXEL = 1 << BUFFERTYPE_TEXEL,
|
||||
};
|
||||
|
||||
struct DataDeclaration
|
||||
@@ -141,10 +142,6 @@ public:
|
||||
|
||||
/**
|
||||
* Fill a portion of the buffer with data and marks the range as modified.
|
||||
*
|
||||
* @param offset The offset in the GLBuffer to store the data.
|
||||
* @param size The size of the incoming data.
|
||||
* @param data Pointer to memory to copy data from.
|
||||
*/
|
||||
virtual void fill(size_t offset, size_t size, const void *data) = 0;
|
||||
|
||||
@@ -153,6 +150,12 @@ public:
|
||||
**/
|
||||
virtual void copyTo(size_t offset, size_t size, Buffer *other, size_t otheroffset) = 0;
|
||||
|
||||
/**
|
||||
* Texel buffers may use an additional texture handle as well as a buffer
|
||||
* handle.
|
||||
**/
|
||||
virtual ptrdiff_t getTexelBufferHandle() const = 0;
|
||||
|
||||
static std::vector<DataDeclaration> getCommonFormatDeclaration(CommonFormat format);
|
||||
|
||||
class Mapper
|
||||
|
||||
Reference in New Issue
Block a user