google / graphicsfuzz

A testing framework for automatically finding and simplifying bugs in graphics shader compilers.
Apache License 2.0
561 stars 117 forks source link

--disable-glslangValidator not actually disabling validator usage #268

Closed jonathanmetzman closed 5 years ago

jonathanmetzman commented 5 years ago

On HEAD on dev branch, it appears that disable-glslangValidator isn't working as I expect (maybe I misunderstand what it should do).

When I run:

java -ea -cp /usr/local/google/home/metzman/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/jar/tool-1.0.jar com.graphicsfuzz.generator.tool.GlslGenerate --keep-bad-variants --disable-glslangValidator --disable-shader-translator graphicsfuzz/target/graphicsfuzz/shaders/samples/300es/ graphicsfuzz/target/graphicsfuzz/shaders/samples/300es/ 1 a_shader_family gf-out

I see the following output

11:00:35.812 INFO  GlslGenerate - About to generate 5 shader families, each with 1 variant.
11:00:35.814 INFO  GlslGenerate - Generating family 0 from reference bubblesort_flag.json.
11:00:35.838 INFO  ExecHelper - ~/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/bin/Linux/glslangValidator -E --stdin -S frag
11:00:35.868 INFO  ExecHelper - Result: 0
11:00:36.168 INFO  ExecHelper - ~/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/bin/Linux/glslangValidator -E --stdin -S frag
11:00:36.192 INFO  ExecHelper - Result: 0
11:00:36.450 INFO  ExecHelper - ~/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/bin/Linux/glslangValidator -E --stdin -S frag

Indicating that validator is indeed being run.

For my use case, running the validator isn't important since it isn't much more expensive to pass the shader to the binary I'm trying to find memory corruption in.

jonathanmetzman commented 5 years ago

I've taken a closer look. It seems like this is done to preprocess shaders before parsing them.