Skip to content
This repository was archived by the owner on Jun 6, 2021. It is now read-only.

testing in shaders #38

Open
Vengarioth opened this issue Jan 15, 2018 · 0 comments
Open

testing in shaders #38

Vengarioth opened this issue Jan 15, 2018 · 0 comments

Comments

@Vengarioth
Copy link
Member

Vengarioth commented Jan 15, 2018

This issue tracks ideas and conversation about posibilities of testing in shaders

Assertions

Often times while developing shaders we want to be sure that our functions return values of a certain range when given input of a certain range, especially when converting from/to uv space into data (we encountered this while implementing procedural sky rendering).

let samples = from_distribution(PlanetHeight, AtmosphereHeight);
let results = samples.map(convert_from_height);
assert_range(results, 0.0, PI);

Where from_distribution returns a list of values within the range of its two parameters, map is your typical mapping function, assert_range asserts that a list of values is within the given range of parameters.

Interpreter

One idea is to build an interpreter for xshade, running xshade code on the CPU.

Compiling into another language, then execute

Another aproach can be to translate xshade code into another CPU language to run the tests.

Try to use compute shaders

It could also be possible to use compute shaders to test xshade code.

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

No branches or pull requests

1 participant