Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drivers/gles3/effects/cubemap_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ Vector2 hammersley(uint32_t i, uint32_t N) {
}

void CubemapFilter::filter_radiance(GLuint p_source_cubemap, GLuint p_dest_cubemap, GLuint p_dest_framebuffer, int p_source_size, int p_mipmap_count, int p_layer) {
glDisable(GL_CULL_FACE);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
glDisable(GL_CULL_FACE);
glDisable(GL_CULL_FACE);
scene_state.cull_mode = RS::CULL_MODE_DISABLED;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clayjohn I just had a check at this, scene_state is not exposed to any of the effects, and none of the other effects respect the scene state.

We really need to introduce a new object that keeps track of the global OpenGL state that we can access from different areas of compatibility renderer and remove this logic from scene state. But that goes a little beyond the scope of this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the shortest path forward is to move the change outside of this function and into the calling code. Otherwise it will break the scene shader

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thing is, we do this stuff everywhere already. I think that is why we keep having issues like these popup at the strangest times. OpenGLs global state sucks :)


glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_CUBE_MAP, p_source_cubemap);
glBindFramebuffer(GL_FRAMEBUFFER, p_dest_framebuffer);
Expand Down