igl | opengl | Use glClearBufferfv to set different clear color for multiple render targets.#285
igl | opengl | Use glClearBufferfv to set different clear color for multiple render targets.#285vinsentli wants to merge 2 commits into
Conversation
|
Android builds failing, please fix |
@pixelperfect3 |
corporateshark
left a comment
There was a problem hiding this comment.
#283 was merged. Please rebase onto the latest main.
e9e9415 to
ec32c99
Compare
done |
|
@corporateshark |
Oh, this one has slightly different spec. I see. |
|
@corporateshark has imported this pull request. If you are a Meta employee, you can view this in D80472407. |
| renderPass_.colorAttachments[index].loadAction == LoadAction::Clear) { | ||
| auto clearColor = renderPass_.colorAttachments[index].clearColor; | ||
| getContext().colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | ||
| if (getContext().deviceFeatures().hasInternalFeature(InternalFeatures::ClearBufferfv)) { |
There was a problem hiding this comment.
This check must wrap the entire loop. As is, if InternalFeatures::ClearBufferfv isn't supported, you're leaving glClearColor set to the color of the last available color attachment, which is a significant change in behavior.
There was a problem hiding this comment.
The function InternalFeatures::ClearBufferfv is supported in OpenGL ES 3.0 but not in OpenGL ES 2.0. However, since MRT (Multiple Render Targets) is inherently unsupported in OpenGL ES 2.0, the scenario you described cannot occur in practice.
There was a problem hiding this comment.
On the non-ES world, MRT was introduced in OpenGL 2.0 while glClearBuffer is introduced in OpenGL 3.0.
To be safe, let's avoid any versioning assumptions and make the logic sound by itself.
ca352bf to
05552db
Compare
add iglClearBufferfv revert opt Revert "opt" This reverts commit 6b37c9a.
05552db to
af8b21f
Compare
…learBuffer is introduced in OpenGL 3.0.
|
@corporateshark merged this pull request in ac37006. |
No description provided.