Add prc variable to force image bindings as writeonly (#131)

This commit is contained in:
tobspr 2016-12-06 18:42:08 +01:00 committed by rdb
parent b182224463
commit 3fa5b6b4ee
3 changed files with 10 additions and 1 deletions

View File

@ -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) {

View File

@ -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<CoordinateSystem> gl_coordinate_system
("gl-coordinate-system", CS_yup_right,
PRC_DESC("Which coordinate system to use as the internal "

View File

@ -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<CoordinateSystem> gl_coordinate_system;
extern EXPCL_GL void CLP(init_classes)();