Coder Social home page Coder Social logo

wellcomez / shaderator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cezbloch/shaderator

0.0 0.0 0.0 6.97 MB

Shaderator - Compute Kernels Debugging and Unit Testing for HLSL, OpenCL and GLSL

License: Other

C++ 96.37% CMake 0.15% C 1.12% Objective-C 2.26% Python 0.09%

shaderator's Introduction

Build Status

What is this?

Shaderator is a productivity library intended to speed up complex Compute Shader development. It also provides means to Unit Tests shader code offering protection against regressions. Click on the image below to see the Lighting Talk from ACCU 2018 Conference.

Shaderator on ACCU 2018 Link

What problem does it solve?

Due to the nature of GPUs shaders are hard to debug. Back in the day developer wrote one, executed a batch and hoped for the best that the result is correct. Kernel function is usually executed hundreds of thousand times writing data to output buffer which can only be looked up when the Dispatch finished. This tool compiles .hlsl shader code to C++ and enables developer to leverage full Visual Studio debugging functionality to quickly find problems in the code.

Getting started with debugging

  1. Open Shaderator.sln in VS 2017
  2. Build solution (better choose Debug configuration to see more variables under debugger)
  3. Set ComputeShaderSort11 in examples folder as startup project (right click on the project in Visual Studio and select "Set as StartUp Project")
  4. Put breakpoint anywhere in ComputeShaderSort11.hlsl shader file
  5. Press F5 to Debug

VS will start regular debugging session and you will be able to debug the .hlsl shader code as C++ code. You can see all variables, can add them to watch, pin or look-up values when hovering the mouse. CPU shader is obviously very slow. The intention is to provide tools for faster Computer Shader development.

If you have Visual Assist X installed debugging experience may be reduced.

Getting started with Unit Tests

  1. Open Shaderator.sln in VS 2017
  2. Build solution
  3. Set processor architecture for Unit Tests. In VS menu go to "Test -> Test Settings -> Default Processor Architecture" and select the platform for which you have built the solution (X86 or X64).
  4. Open Test Explorer. In VS menu go to "Test -> Windows -> Test Explorer"
  5. In Test Explorer right click on the Unit Test found and press "Run Selected Tests" or "Debug Selected Tests"

Pre-requisites

  • Windows 10
  • Visual Studio 2017

Will this work with any shader?

Not yet, the project is in it's early phase, however it should work with many shaders. If there is interest, support for more HLSL language features will be added. At the moment matrices are not supported yet.

Problems or feedback

Please e-mail me at cez dot bloch at gmail dot com, you can also find email on my github profile.

shaderator's People

Contributors

cezbloch avatar potrecs avatar

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.