GithubHelp home page GithubHelp logo

google / amber Goto Github PK

View Code? Open in Web Editor NEW
185.0 17.0 64.0 3.51 MB

Amber is a multi-API shader test framework

License: Apache License 2.0

CMake 1.43% C++ 93.00% Python 2.40% Shell 1.70% Batchfile 0.19% Makefile 0.22% C 0.25% Emacs Lisp 0.25% CSS 0.01% Java 0.16% NASL 0.12% Vim Script 0.28%
vulkan dawn testing vulkan-compute-shaders

amber's Issues

Redefined buffer types

AmberScript's buffer type is confusing.

I feel that we should have the following buffer types:

  • color for color attachment of framebuffer
  • depth stencil for depth/stencil attachment of framebuffer
  • vertex for vertex buffer
  • index for index buffer
  • storage image
  • sampled image
  • combined image sampler
  • uniform texel buffer
  • storage texel buffer
  • storage buffer
  • uniform buffer
  • input attachment

Note that here we also uses the term 'buffer' for image because in the view of Amber script, the image is also a sequence of bytes.

Since storage image, sampled image, combined image sampler, uniform texel buffer, storage texel buffer, storage buffer, uniform buffer, and input attachment are Vulkan specific descriptor types and I am not sure WebGPU will define the same types or not, we would better consider how to support buffers of WebGPU efficiently.

Clarify semantics of the Shutdown() commands

Does it mean:

  • I can never use this object again? If so then I'd call it Destroy()
  • Reset() . -- I can revive this object by re-initializing it?

It means never use again. For anything in Shutdown() that doesn't require error checking we can probably move it to the Destructor. Shutdown is there so we can error check the closing of our resources (similar to the Initialize() for startup).

Vulkan: Add memory barrier

Draw after sending vertex data to vertex buffer is not guaranteed currently, as well as probe after copying frame buffer to host accessible buffer.
We must add memory barrier for safety.

Windows build

Make sure everything builds and works on Windows. (This does not include the Dawn backend at this time).

Using system include directory causes build errors

If some libraries in third_party/ are already installed in the system, current Amber build adopts the system library instead of the one in third_party/ and it can lead to build errors.

The following log shows arguments for src/amberscript/parser_test.cc:

[6/7] /usr/bin/c++  -DAMBER_ENGINE_DAWN=0 -DAMBER_ENGINE_VULKAN=1 -I../../include
-I../../ -I../../third_party/spirv-tools/include -isystem /usr/local/include -isystem
../../third_party/googletest/googletest/include -I../../third_party/shaderc/libshaderc/include
-I../../third_party/glslang/SPIRV/.. -I../../third_party/glslang/SPIRV/../External
-I../../third_party/glslang/glslang/.. -I../../third_party/spirv-headers/include -isystem
../../third_party/googletest/googletest -std=c++11
-Wall -Werror -Wextra -Wno-unknown-pragmas -Wpedantic -pedantic-errors -g
-Wno-global-constructors -fno-exceptions -fno-rtti -pthread -MD -MT 
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o -MF 
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o.d -o 
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o -c ../../src/amberscript/parser_test.cc

-isystem /usr/local/include is shown before -isystem ../../third_party/googletest/googletest/include.

If gtest/gtest.h exists in /usr/local/include, it will be used instead of third_party/googletest/googletest/include.

However, the build will try to link it with the one in third_party/ and it can lead to unreferenced symbols.

Dump image data

There is an un-implemented command line option to the amber script to dump image data, this should be implemented.

Vulkan: Remove asserts from the codebase

The vulkan engine currently asserts in places where things should never happen. We should probably return in these cases so that amber can be used as a library if desired.

Dump buffer data

There is an un-implemented flag to the amber script to dump buffer data, this should be implemented.

VkScript: Data Ordering

According to the VkRunner README the draw commands are only executed when a probe command is encountered. So if you have something like:

ssbo 0 subdata vec3 0 1 2 3
draw rect
ssbo 0 subdata vec3 0 5 6 7
probe

The draw rect command will use the 5 6 7 values and not the 1 2 3 values.

We have to decide if we want to follow this behaviour or go with a more expected draw executes when it's seen so draw would use 1 2 3 not 5 6 7.

ComputeCommand does not need PipelineData

As far as I understand, PipelineData will be used for only graphics pipeline because it only has setups for graphics pipeline e.g., topology, polygon mode, cull mode.

I think we can remove it from ComputeCommand.

Add shader oracle for Android CTS.

When working with the CTS the preference is to pre-compile all of the shaders, and send that blob over to the device. We need to support this in Amber.

There are two sides to this 1- generating the oracle 2- consuming the oracle.

For 1, we add a --oracle option to the amber application which will loop over all of the test cases, parse them, pull out the pipelines and compile the shaders as needed. It will generate a SHA of the shader source + spirv-opt options used during the compilation. This will then be written out to a file as SPIRV-HEX in a format like:

SHADER <sha>
 ... hex bytes ...
END

one block for each shader we compiled. (This also has the benefit of de-duplicating any shaders which use the same options to spirv-opt like the passthrough shader).

For 2, we update the amber application such that you can pass in the path to an Oracle, it will get read and when ShaderCompiler runs it will pull the shader from the Oracle instead of compiling.

Oracle class would be something like

Oracle:
  GenerateID(shader, options) ... outputs sha
  FindShader(shader, options) ... outputs hex bytes
  Load(string data)   ... loads oracle data from given string
  string Record()     ... writes data the string

We then put something into the API to allow you to Load and Record oracle data.

I actually think for the (shader, options) flags we want to pass in Pipeline and define an actual pipeline object like AmberScript will have. We force the creation for VkScript as needed.

VkScript: Buffer Sizing

The buffer size for a given ssbo, uniform or uniform ubo is defined to be the largest size seen in the script. This isn't currently possible in Amber as you won't have the last SSBO command when you see the first one.

So, I think we need to add a pre-pass over the commands in Amber to sum the size of each type of buffer and send that data to the engine to declare the various buffers of the correct sizes.

AmberScript: Add support for DXC

We currently link in shaderc to compile GLSL shaders. We should add the option to build in DXC as well to compile HLSL shaders.

NDK Build

Add support to building Amber with the NDK and executing on Android.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.