Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for textures in GraphicsFuzz #1017

Open
afd opened this issue Jun 26, 2020 · 4 comments
Open

Support for textures in GraphicsFuzz #1017

afd opened this issue Jun 26, 2020 · 4 comments
Assignees

Comments

@afd
Copy link
Contributor

afd commented Jun 26, 2020

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.

@jarisiru
Copy link
Collaborator

jarisiru commented Sep 2, 2020

Suggested amber output for given minimal input shader:

mintex.zip
mintex

@jarisiru
Copy link
Collaborator

#1066 moves samplers out of uniform blocks, and #1070 implements the amber file generation changes.

@tungts1101
Copy link

Does GraphicFuzz now support shaders with texture?

@jarisiru
Copy link
Collaborator

Yes, see shaders/src/main/glsl/samples/320es/stable_sampler* for examples of use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants