WORLD_DYNAMIC_USER
WORLD_DYNAMIC_USER

Reputation: 309

Max count of buffers

How many buffers I can to generate with glGenBuffers function? Can I try to generate 8192 (or more) buffers?

I am rendering only one buffer, but I need to store many buffers.

int i = 0;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &i);

returns 8. This is max count of buffer, that rendering in same time.

Am I right?

Upvotes: 4

Views: 3331

Answers (2)

KillianDS
KillianDS

Reputation: 17186

The GL_MAX_DRAW_BUFFERS value has nothing to with glGenBuffers but with buffers a fragment shader can write in to (see glDrawBuffers).

There is no limit for the number of buffers in the standard, you can create as many as you want. You are however limited by memory, so if you plan to store huge amounts of data, a call like glBufferData may fail with GL_OUT_OF_MEMORY

Upvotes: 5

datenwolf
datenwolf

Reputation: 162317

How many buffers I can to generate with glGenBuffers function?

glGenBuffers doesn't allocate any storage it only aquires a name/ID for a buffer. The limit for this is purely implementation specific, but in theory is only goverend by the available memory and the size of the management structure. The far more limiting factor is the amount of buffer storage you allocate.

The question is of course: Why do you need so many buffers? And why are you Pixes Buffer Objects, or Color Buffer Attachments at all? Were textures not better fitting storage objects for your data?

returns 8. This is max count of buffer, that rendering in same time.

Yes, this is the maximum count for target buffers in multiple target rendering.

Upvotes: 2

Related Questions