Shader Playground is a website for exploring shader compilers.

Overview

Shader Playground

Shader Playground is a website for exploring shader compilers.

Supported backends

Compilers

Analyzers and optimizers

Compressors

Building

See BUILDING.md

Contributions

Contributions are gratefully accepted. If you want to add a new compiler, or improve integration with an existing compiler, or any other type of bug fix or improvement to the website, please open an issue.

Supporters

Shader Playground is supported by these amazing people. Their sponsorship allows Shader Playground to exist as a free resource for everyone. If you'd like to help, please consider becoming a sponsor on GitHub.

Author

Tim Jones

Issues
  • Build problems

    Build problems

    Hi @tgjones,

    Thank you for building such a useful tool!

    I've been investigating the work required to implement #72. From what I've seen, making the code changes would not be particularly hard. However, I'm struggling a bit to get the project building using the build.ps1 script:

    • There's a number of compiler URLs that are now broken. For example, dxc, and the radeon driver no longer fetch (there might be more, these are what I hit so far).
    • The project uses netcoreapp2.2, which is now deprecated. While you can go and manually download this, it's a bit of a barrier and would be nice to update to something longer-term supported.
    • There's hardcoded paths to 7-zip, which are undocumented, but are easily solvable.

    I've spent a bit of time trying to fix up some of these issues, and I've been playing with a docker file that tries to simplify building the project. However, I've noticed that there has been little activity on the project this year. Are you continuing to maintain this project and/or accepting pull requests?

    Thank you again for such a great tool!

    Cheers, Ben

    opened by ben-clayton 8
  • Support CUDA/C++/PTX output from Slang

    Support CUDA/C++/PTX output from Slang

    Slang has added support for CUDA and C++ targets.

    It also supports PTX, but requires Slang to have nvrtc compiler available to Slang (say in same directory as slang binary). A little more about this is in Slang CUDA docs

    Note - I didn't get to compile/test, because doing so required Visual Studio installing GBs of stuff.

    opened by jsmall-nvidia 3
  • missing tools

    missing tools

    Many tools are listed in the readme but I can't find some of them like SMOL-V and spirv-cross on your site http://shader-playground.timjones.io/ Especially interested in spirv-cross. It should be possible to compile a shader to spirv and back, to see what optimizations have been done.

    opened by Trass3r 3
  • Slow down the compile as you type delay, to reduce server load and increase percieved responsiveness

    Slow down the compile as you type delay, to reduce server load and increase percieved responsiveness

    Currently the canonical playground runs compile-as-you-type (compileCodeTimeout, link) 500ms after you stop typing, which is quite aggressive and easy to hit as you continue to make changes.

    Increasing it would reduce the load on the server, and perceptual responsiveness would therefore increase when lots of people are using the playground at the same time, even though it takes longer to kick off an as-you-type compile when you stop smashing the keys.

    opened by rys 3
  • Support reflection backend for SPIRV-Cross

    Support reflection backend for SPIRV-Cross

    SPIRV-Cross will support outputting JSON formatted reflection data about a given shader in the next release with the --reflect option. Can you add support to the app to output this as an option?

    opened by jherico 3
  • Ability to select MSL Version in Spirv-Cross

    Ability to select MSL Version in Spirv-Cross

    Some features require newer versions of MSL, and it would be nice to expose the --msl-version flag of spirv-cross so it is willing to generate newer versions.

    Valid values appear to be (based on https://developer.apple.com/documentation/metal/mtllanguageversion): 10000 10100 10200 20000 20100 20200 20300

    opened by cwfitzgerald 2
  • Passing options to DXC doesn't work

    Passing options to DXC doesn't work

    I passed option /blablabla (just a random text) and got this site error:

    System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Invalid value for ExtraOptions: '/blablabla'')
       at ShaderPlayground.Core.ShaderCompilerArguments.GetString(String name) in C:\Code\shader-playground\src\ShaderPlayground.Core\ShaderCompilerArguments.cs:line 63
       at ShaderPlayground.Core.Compilers.Dxc.DxcCompiler.Compile(ShaderCode shaderCode, ShaderCompilerArguments arguments) in C:\Code\shader-playground\src\ShaderPlayground.Core\Compilers\Dxc\DxcCompiler.cs:line 204
       at ShaderPlayground.Core.Compiler.Compile(ShaderCode shaderCode, CompilationStep[] compilationSteps) in C:\Code\shader-playground\src\ShaderPlayground.Core\Compiler.cs:line 125
       at ShaderPlayground.Web.Controllers.ApiController.Compile(ShaderCompilationRequestViewModel model) in C:\Code\shader-playground\src\ShaderPlayground.Web\Controllers\ApiController.cs:line 67
    

    Normally, it should just pass it straightforward to the compiler command line without searching for allowed values.

    opened by Xottab-DUTY 2
  • Add Dockerfile and new build script for hermetic build environment

    Add Dockerfile and new build script for hermetic build environment

    Includes:

    • Visual Studio 2017, 2019 C++ and C# toolchains
    • Windows 10 SDK
    • depot_tools
    • cmake, git, 7zip, python2 & python3

    Also add some documentation on building.

    I've had to disable the adrenalin download logic as this no longer works. When the other PRs land, the build should be successful (but RGA will fail to compile due to missing dlls).

    Issue: #73

    opened by ben-clayton 2
  • Make caret configurable

    Make caret configurable

    I love shader-playground but it's always jarring to use it since I don't otherwise text edit with a block caret. My personal preference would be to just make it a "standard" line caret, but in the interest of making everyone happy it'd be great if there was a setting for this.

    opened by MattSutherlin 2
  • Hangs and unspecified errors

    Hangs and unspecified errors

    I have been trying to use the playground but I only managed to get something (super slowly ) out of DXC, everything else hangs and a pop up show up saying unspecified error.

    I tried on chrome, firefox and edge same issues. They should be all up to date. Any thoughts on the matter?

    
    
    www.googletagmanager…?id=UA-5166698-11:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
    az416426.vo.msecnd.n…scripts/a/ai.0.js:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
    /Api/Compile:1 Failed to load resource: the server responded with a status of 502 (Bad Gateway)
    
    

    Those are the errors I managed to get from the console from chrome. Only the last one might be related.

    I have been using the website before with great success, not sure what happened.

    Cheers

    opened by giordi91 2
  • Output spirv as C array

    Output spirv as C array

    This output would be very useful for small in-engine shaders that you just want embedded in the code.

    Example: https://github.com/bkaradzic/bgfx/blob/master/src/vs_clear.bin.h

    And here's one way to convert to array: https://github.com/Novum/vkQuake/blob/master/Shaders/bintoc.c

    opened by jesta88 2
  • Update to latest Mali Offline Compiler

    Update to latest Mali Offline Compiler

    Would it be possible to update to the latest Mali Offline Compiler (found in Arm Mobile Studio), as it exposes the new Mali-G710 series GPUs?

    On the practical side of things, is there anything we can do from the Arm side to help here / make things easier to update?

    opened by solidpixel 0
  • Older Radeon GPU Analyzer versions don't display updated ASIC list

    Older Radeon GPU Analyzer versions don't display updated ASIC list

    For example if I select 2.3 from the list, I don't see Bonaire in the ASIC list like was available on previous live versions of Shader Playground when using 2.3.

    opened by djmips 0
  • Microsoft DXC trunk is older than the advertised date (2022-02-05)

    Microsoft DXC trunk is older than the advertised date (2022-02-05)

    Shader Playground says it's using DXC trunk 2022-02-05 but the output DXIL suggests it's quite a bit older.

    Example: https://shader-playground.timjones.io/7fe4cff3eee0b279d6a0c62f84c8c639

    The problematic line in the output DXIL:

    %4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 8, i32 0 })  ; AnnotateHandle(res,props)  resource: Texture2DMSArray<<invalid CompType>>
    

    When I compile the same shader using the December 2021 DXC release, I see the correct output:

    %4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 8, i32 1033 })  ; AnnotateHandle(res,props)  resource: Texture2DMSArray<4xF32>
    

    The second component of ResourceProperties is i32 1033 instead of i32 0 and the CompType is 4xF32 instead of invalid CompType.

    I think the fix happened in https://github.com/microsoft/DirectXShaderCompiler/commit/fd07613a95723550c3491b548967d5bae1ece374 (2021-03-15).

    opened by sooknarine 1
  • Don't Know How to access local container.

    Don't Know How to access local container.

    I'v Build the docker image and container follow the 'BUILDING.md' instructions. Because the shader-playground.timjones.io is a little bit slow. By after that I don't know how to access this container. Seems no ports exposed in this image.

    Is there anyone can teach us, how to use the container. Thank you very much.

    opened by NorvinZhang2022 0
  • Color error messages

    Color error messages

    See #103

    I'm unfamiliar with C# and getting the project to build seemed daunting, so I just pasted the implementation of ansi_up.js. I'm not sure if referencing it directly with a script tag to github raw would be a good idea, but there's probably a better way of including ansi_up as a dependency besides just copying it.

    Anyway... Before: before

    After: after

    opened by JackYoustra 1
  • WGSL Naga errors are unclear

    WGSL Naga errors are unclear

    https://shader-playground.timjones.io/ab65b6f42d3ece71085e65c732c3edf9

    Naga errors this code, but the error message has an unnecessary timestamp and is full of color control keys.

    We can either strip or use these. I'm not familiar with this project and haven't contributed before, but color usually looks good so I'll try and preserve the color.

    opened by JackYoustra 2
collection of C/C++ programs that try to get compilers to exploit undefined behavior

------------------------------------------------------------------------------- UB Canaries: A collection of C/C++ programs that detect undefined beh

John Regehr 160 Jun 27, 2022
Comprehensive Hashing Library for C++ Compilers.

HashLib4CPP HashLib4CPP is a C++11 library that provides an easy to use interface for computing hashes and checksums of strings, files, streams, bytea

Telepati 24 Jan 2, 2022
Exploring possibilities of ESP32 platform to attack on nearby Wi-Fi networks.

ESP32 Wi-Fi Penetration Tool This project introduces an universal tool for ESP32 platform for implementing various Wi-Fi attacks. It provides some com

null 447 Jun 29, 2022
Set of examples how to use CLion with various unsupported compilers using Custom Defined Compiler feature

About This repository contains: Set of examples how to use CLion with various unsupported compilers using Custom Defined Compiler feature Public set o

JetBrains 30 Jun 15, 2022
Exploring the Design Space of Page Management for Multi-Tiered Memory Systems (USENIX ATC'21)

AutoTiering This repo contains the kernel code in the following paper: Exploring the Design Space of Page Management for Multi-Tiered Memory Systems (

Computer Systems Laboratory @ Ajou University 13 Mar 31, 2022
a playground for working with fully static tensors and automatic differentiation

This is a playground for learning about how to apply template-meta-programming to get more efficient evaluation for tensor-based automatic differentiation.

Edward Kmett 16 Mar 18, 2021
A bootloader and experimentation playground for Apple Silicon

m1n1: an experimentation playground for Apple Silicon (And to some extent a Linux bootloader) Building You need an aarch64-linux-gnu-gcc cross-compile

Asahi Linux 2k Jul 1, 2022
Compiler Optimizations Playground

This is (hopefully) the simplest implementation of the classic register-machine intermediate representation (IR) to undertake data and control flow analysis in a compiler middle-end.

null 27 May 31, 2022
Playground app for ZNN Dart SDK

Prerequisites Flutter SDK VS Code IDE recommended Installation Clone the repo git clone https://github.com/nemoryoliver/znn_playground.git Install pa

Oliver Martinez 9 Feb 16, 2022
[PS3] Bo1 Mod Menu Jo-Milk's Playground V2... I never finished this project what a shame... works on HEN

-PS3-Bo1-Mod-Menu-Jo-Milk-s-Playground-V2 [PS3] Bo1 Mod Menu Jo-Milk's Playground V2... I never finished this project what a shame... works on HEN Ple

Jo-Milk 4 May 3, 2022
A simple website layout.

my_website A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if th

Alireza 2 Nov 16, 2021
Program that allows you to get the source code of a website's home page without doing it manually. Use it at your own risk.

Website-Homepage-Grabber Install one of the folders x64 or x32 if the program doesn't work(probably because you don't have visual studio installed) If

null 5 Feb 19, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 273 Jun 10, 2022
Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL

XShaderCompiler ("Cross Shader Compiler") Features Cross compiles HLSL shader code (Shader Model 4 and 5) into GLSL Simple to integrate into other pro

Lukas Hermanns 342 Jun 20, 2022
GPU 3D signed distance field generator, written with DirectX 11 compute shader

GPU SDF Generator GPU 3D signed distance field generator, written with DirectX 11 compute shader Building git clone --recursive https://github.com/Air

Z Guan 23 May 20, 2022
Skyline's fork of yuzu's shader compiler

Skyline Shader Compiler (SSC) A fork of yuzu's shader compiler modified for Skyline's needs with all other changes being upstreamed and changes from y

Skyline 13 Jun 16, 2022
A small DLL that fixes tool's usage of the Halo 3 shader compiler.

h3-shader-compiler-fix A small DLL that fixes tool's usage of the Halo 3 shader compiler. Tool forgot to initialise the compiler before using it, so t

null 7 Jun 20, 2022
The mainly point on this project is show how level of my comprehend for fragment SHADER.

PS The mainly point on this project is show how level of my comprehend for fragment SHADER. This project has some issue I can't solve else. cause I st

null 2 Nov 26, 2021
PlenOctree Volume Rendering (supports CUDA & fragment shader backends)

PlenOctree Volume Rendering This is a real-time PlenOctree volume renderer written in C++ using OpenGL, constituting part of the code release for: Ple

Alex Yu 450 Jun 27, 2022