Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
The same texture for input and output
Post Body

glFramebufferTexture2D documentation says:

Special precautions need to be taken to avoid attaching a texture image to the currently bound framebuffer while the texture object is currently bound and potentially sampled by the current vertex or fragment shader. Doing so could lead to the creation of a "feedback loop" between the writing of pixels by rendering operations and the simultaneous reading of those same pixels when used as texels in the currently bound texture. In this scenario, the framebuffer will be considered framebuffer complete, but the values of fragments rendered while in this state will be undefined. The values of texture samples may be undefined as well.

Is it still wrong to use the same texture for input and output if my fragment shader performs a pixel-to-pixel transformation only (so that it was in-place)? For example:

#version 410 core

uniform sampler2D input;

out vec4 result;

void main()

{

ivec2 xy = ivec2(gl_FragCoord.xy);

vec4 val = texelFetch(input, xy, 0);

result = val * val;

}

Author
Account Strength
100%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
29,837
Link Karma
34
Comment Karma
29,540
Profile updated: 3 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago