[Mesa-dev] [Bug 79783] Distorted output in obs-studio where other vendors "work"
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Sat Sep 19 08:58:35 PDT 2015
https://bugs.freedesktop.org/show_bug.cgi?id=79783
--- Comment #11 from gregory.hainaut at gmail.com ---
I ran some piglit tests with a new patch (see below) to only remove deadcode
variable that doesn't have a location. Unfortunately it triggers various
regression in piglit.
1/ Test spec at glsl-1.10@execution at variable-indexing@fs-temp-array-mat2-col-rd
Failed to link:
error: fragment shader varying color not written by vertex shader
An unused variable still exists on the program but technically the variable
isn't read. So maybe the check can be improved. The error appears for glsl <=
120 or as a warning in GLES.
Maybe we could use ir_variable_data.used bit, don't know.
2/ Test spec at glsl-1.10@api at getactiveattrib 110
Failing shader:
attribute vec4 not_used;
void main() { gl_Position = gl_Vertex; }
Attribute `not_used' should not be active but is.
I think we could optimize the vertex shader input as it is the first stage of
the pipeline (until someone add a new stage). However I don't know how to check
the current stage on the IR (neither if is possible actually). Or there is
maybe a special bits to detect attribute input.
diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp
index f45bf5d..29cbe52 100644
--- a/src/glsl/opt_dead_code.cpp
+++ b/src/glsl/opt_dead_code.cpp
@@ -125,6 +125,21 @@ do_dead_code(exec_list *instructions, bool
uniform_locations_assigned)
}
}
+ if (entry->var->data.mode == ir_var_shader_in &&
+ !entry->var->data.explicit_location)
+ continue;
+
entry->var->remove();
progress = true;
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150919/af2a9bf9/attachment.html>
More information about the mesa-dev
mailing list