diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index b02ec341df..528b98804c 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2486,7 +2486,10 @@ update_shader_texture_bindings(ShaderContext *prev) { bool has_write = param->has_write_access(); input._writable = has_write; - if (has_read && has_write) { + if (gl_force_image_bindings_writeonly) { + access = GL_WRITE_ONLY; + + } else if (has_read && has_write) { access = GL_READ_WRITE; } else if (has_read) { diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index c44a36aaf6..544a5c2c79 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -299,6 +299,11 @@ ConfigVariableBool gl_support_shadow_filter "cards suffered from a broken implementation of the " "shadow map filtering features.")); +ConfigVariableBool gl_force_image_bindings_writeonly + ("gl-force-image-bindings-writeonly", false, + PRC_DESC("Forces all image inputs (not textures!) to be bound as writeonly, " + "to read from an image, rebind it as sampler.")); + ConfigVariableEnum gl_coordinate_system ("gl-coordinate-system", CS_yup_right, PRC_DESC("Which coordinate system to use as the internal " diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index b008aeb8d3..fb8040828f 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -80,6 +80,7 @@ extern ConfigVariableBool gl_fixed_vertex_attrib_locations; extern ConfigVariableBool gl_support_primitive_restart_index; extern ConfigVariableBool gl_support_sampler_objects; extern ConfigVariableBool gl_support_shadow_filter; +extern ConfigVariableBool gl_force_image_bindings_writeonly; extern ConfigVariableEnum gl_coordinate_system; extern EXPCL_GL void CLP(init_classes)();