Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to change variables after using glUniform pointer variants?

Tags:

opengl

I'm wondering if glUniformXXv blocks until the data the pointer is referering to is copied to GPU. In other words, can this code cause issues if the GPU is busy?

int i=5;
glUniform1iv(location,1,&i);
i = 6;

Will this cause glUniform1fv to send 6 if the GPU is busy?

like image 902
bofjas Avatar asked Oct 06 '22 13:10

bofjas


1 Answers

With the exception of OpenGL functions that end in the word "Pointer", every OpenGL function that takes a pointer will read from/write to that pointer before it returns. So changes to the memory after the fact will not be seen.

like image 181
Nicol Bolas Avatar answered Oct 10 '22 03:10

Nicol Bolas