Support for textures in GraphicsFuzz
As a starting point, let's support just sampler2D in a pipeline, and have a default checkerboard texture be used.
Suppose a shader job includes a declaration:
uniform sampler2D foo;
The corresponding JSON file should be able to contain a uniform entry:
"foo": { func: "sampler2D", texture = SOME_STRING }
When uniform bindings are added to the shader job, "foo" should be given a descriptor set binding just like with any other uniform; similarly for the code that removes uniform bindings.
SOME_STRING should either be:
- A known special name for a pre-defined texture, or
- The name of a .png file Initially, let's just support a single pre-defined texture called CHECKERBOARD, so that we could have:
"foo": { func: "sampler2D", texture = "CHECKERBOARD" }
Let's adapt gfauto so that, if the .json file defines a sampler2D with CHECKERBOARD as the texture, appropriate Amber code is generated to make an image, run a pipeline to render a checkerboard pattern to the image, and bind this image to the main pipeline at descriptor set 0 and the binding specified in the .json file.
@paulthomson @jarisiru for info.
https://github.com/google/graphicsfuzz/pull/1066 moves samplers out of uniform blocks, and https://github.com/google/graphicsfuzz/pull/1070 implements the amber file generation changes.
Does GraphicFuzz now support shaders with texture?
Yes, see shaders/src/main/glsl/samples/320es/stable_sampler* for examples of use.
