[code-reflection] Integrated: Hat shade toy UI

Gary Frost gfrost at openjdk.org
Thu Feb 5 14:07:01 UTC 2026


Ok the raw shade toy ui is up and running.  

Also added `.toy` so we can run using scriptable java 


java @.bld 
java @.toy blue.java


Where blue.java is 

import hat.Accelerator;
import hat.backend.Backend;
import shade.types.ivec2;
import shade.types.vec2;
import shade.types.vec4;
import static shade.types.vec4.*;
import static shade.types.vec2.*;
import shade.Main;
import shade.Main.Shader;

static void main(String[] args) throws IOException {
    var acc =  new Accelerator(MethodHandles.lookup(), Backend.FIRST);
    var shader = new Shader() {
        @Override
        public vec4 mainImage(vec4 inFragColor, vec2 fragCoord, int iTime, int iFrame, ivec2 iMouse) {
            return vec4(0f,0f,5f,0f);
        }
    };
    new Main(acc, 1024, 1024, shader);
}

-------------

Commit messages:
 - HAT added a couple of toy sripts (blue + gradient)
 - Non HAT Shade Toy initial impl

Changes: https://git.openjdk.org/babylon/pull/894/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=894&range=00
  Stats: 1447 lines in 11 files changed: 459 ins; 972 del; 16 mod
  Patch: https://git.openjdk.org/babylon/pull/894.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/894/head:pull/894

PR: https://git.openjdk.org/babylon/pull/894


More information about the babylon-dev mailing list