greenboxal
greenboxal

Reputation: 469

glDrawArrays modify attribute address

Will glDrawArrays modify glVertexAttribPointer addresses?

I stumbled up onto this problem when I was trying to cache glVertexAttribPointer calls, and if I don't reapply the glVertexAttribPointer call after each glDrawArrays I get a Access Violation Exception. This is the normal behavior or maybe a driver bug?

Upvotes: 0

Views: 129

Answers (2)

Robert Rouhani
Robert Rouhani

Reputation: 14678

An access violation happens when your vertex attribute pointer goes beyond the memory range of the buffer you're reading from.

How are you caching these calls? If you don't disable a vertex attrib array, the previously set info will still be there and will still try to read from the new VBO.

Upvotes: 0

datenwolf
datenwolf

Reputation: 162164

Will glDrawArrays modify glVertexAttribPointer addresses?

No.

I stumbled up onto this problem when I was trying to cache glVertexAttribPointer calls

Please explain (ideally show source code) how you did implement this "caching".

Upvotes: 3

Related Questions