google / shadertrap Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
glDrawBuffers and glReadBuffer functions are only needed if there are multiple render targets, but they are always called when running a graphics pipeline. These functions are also unsupported for ES2.
To work around a cppcheck bug, the ShaderTrap CI will feature applying a custom patch. This should be gotten rid of next time there is a cppcheck release, as the problem doesn't persist in cppcheck's main branch.
Right now this command takes BUFFER1 and BUFFER2 parameters, which is misleading (as they need to be renderbuffers), and cumbersome (as both could be provided under a single parameter).
Write ShaderTrap scripts that use compute shaders to perform matrix multiplication.
The purpose of these examples is to provide an interesting set of compute shaders. They do not necessarily need to represent good practice from a performance perspective.
Top-level spec for all examples:
Inputs: 2 arrays of floating-point data representing the contents of a pair of 16x16 matrices
Output: 1 array of floating-point data that will represent the 16x16 matrix that results from multiplying these matrices together
Version 1:
The red triangle example script has a vertex buffer of three vertices, but the index buffer has indices from 0..5. Half of them can be removed.
Right now ASSERT_EQUAL takes BUFFER1 and BUFFER2 as parameters. This is misleading as they can be renderbuffers (and we'd like to make the language clear by avoiding blurring the terms "buffer" and "renderbuffer", and also cumbersome since both buffers/renderbuffers could fall under a single parameter.
There's a glMemoryBarrier call at the beginning of VisitRunGraphics. This seems unnecessary and also doesn't function with ES3.0 or below.
Currently uniforms can only be set by location. It would be convenient to have a means for setting a uniform by name.
When using ShaderTrap with alternative renderers, such as llvmpipe or SwiftShader, it can be reassuring to know that one is indeed using the desired renderer.
Add an option, --show-gl-info, that will cause this information to be printed to stdout before script execution begins.
The gtest unit tests should be run during continuous integration.
Ideally .shadertrap files in examples should also be run.
At the moment, the CI expects all the examples to be executed successfully. However, it may be useful to have some failing examples to ensure that shadertrap behaves as it should even in these cases.
AssertPixels only prints an error message but still returns true if the check fails. This means there's no way of detecting a failing test.
Write ShaderTrap scripts that use compute shaders to perform reductions.
The purpose of these examples is to provide an interesting set of compute shaders. They do not necessarily need to represent good practice from a performance perspective.
Top-level spec for all examples:
Input: an array of 256 uint or int data elements
Output: a uint or an int, representing the result of combining together the contents of the array using a reduction operation. Allowed reduction operations are: add, min, max, bitwise and, bitwise or and bitwise xor
A cut and paste error!
Right now all vertex attributes are assumed to have 32-bit floating point type, but it would be good (and easy) to be more general here. We should add a TYPE or ELEMENT_TYPE field to the data provided for a vertex buffer. Right now there could be just one option - float. But this would pave the way for more options without having to make float the default.
Write ShaderTrap scripts that use compute shaders to compute a histogram of values.
The purpose of these examples are to provide an interesting set of compute shaders. They do not necessarily need to represent good practice from a performance perspective.
Top-level spec for all examples:
input: a shader storage buffer object containing 256 unsigned integers, each in the range 0-15
output: a shader storage buffer object containing 16 unsigned integers. Position i of this buffer should reflect the number of occurrences of integer i in the input buffer.
Version 1:
In RUN_GRAPHICS, only TRIANGLES can currently be used as the TOPOLOGY argument.
It should be easy to support other kinds of triangle primitive, and likely further primitives would be straightforward too.
For each primitive, a new end-to-end test case in examples should be added.
Buffers can already be compared in a single run using the ASSERT_EQUAL command but it does not permit to save buffer results to compare them across different runs.
While the binary representation could already be useful, a human-readable version would be best for debugging. As the type of the underlying data is bound at buffer creation (and by the underlying interface block in the shader), it could use the format provided at creation to recognize uint, int, etc.. when dumping to the file.
When comparing two buffers, it can be convenient to compare them on the assumption that their element are interpreted as having particular types. It also may be useful to skip certain parts of the buffers.
The ASSERT_EQUAL command should be adapted to have an optional FORMAT parameter, following what is used in DUMP_BUFFER_TEXT.
For the most complex of the reduction examples added via #66, it would be good to have a version for each of the other atomic operations supported in GLSL - i.e. using bitwise operations, min, max, etc.
Currently the command takes NUM_GROUPS_X, NUM_GROUPS_Y and NUM_GROUPS_Z as separate parameters, which is cumbersome and doesn't seem to aid readability.
Only TEXTURE_MAG_FILTER and TEXTURE_MIN_FILTER are supported at present. More parameters should be supported as they are needed. Because some parameters take simple enum value and others take multiple values, some parser work will be required.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.