GLGraphics and invalid memory access
in
Contributed Library Questions
•
3 years ago
Greetings!
This is the contents of the shader:
Reusing this thread of mine as this problem has arisen again, but in a new context.
Basically I have a shader, using GLGraphics, that fades a GLTexture to white, and then fades another GLTexture (at the same location) from white. What happens is that, depending on how fast the transitions are done, the application will eventually crash with the following error:
Invalid memory access of location 0x0 eip=0x9893ce57
And this error report pops up:
- uniform sampler2D backBuffer;
- uniform float ratio;
- void main() {
- vec4 color;
- color = texture2D(backBuffer, gl_TexCoord[0].st);
- color.r = color.r + ratio;
- color.g = color.g + ratio;
- color.b = color.b + ratio;
- gl_FragColor = color;
- }
- // fade src image to white
- if (!reverse) {
- currentVal += 0.01f;
- texFilter.setParameterValue("ratio", currentVal);
- src.filter(texFilter, src);
- if (currentVal >= 1.0f)
- reverse = true;
- }
- // fade dest image from white
- if (reverse) {
- currentVal -= 0.01f;
- texFilter.setParameterValue("ratio", currentVal);
- dest.filter(texFilter, src);
- if (currentVal <= 0.0f)
- finished = true;
- }
Many thanks for any help!
2