• This repository has been archived on 04/Jan/2023
  • Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command line tool for offline shader ISA inspection.

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel. Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. Intel no longer accepts patches to this project.

Intel Shader Analyzer

Intel Shader Analyzer is a tool for offline static analysis of shaders for Intel GPU Architectures. It allows a user to compile dxbc or HLSL code and inspect the generated GPU ISA for either DX11 and DX12.

Intel Shader Analyzer uses a dedicated driver API to compile and disassemble shaders, and may be run on any Windows 10 machine. It depends on the following graphics driver components:

  • For 32-bit:
    • igc32.dll
    • iga32.dll
    • IntelGPUCompiler32.dll
  • For 64-bit:
    • igc64.dll
    • iga64.dll
    • IntelGPUCompiler64.dll

In the initial release, these driver components are bundled with the release executable. Future driver releases will also allow Intel GPU users to run with in-situ drivers.

Besides being a functional tool, Intel Shader Analyzer is also intended to serve as a working refrence for the use of the driver compilation API, so that others may incorporate into their own tool chains as appropriate.

Related Links

The following third-party tools integrate IntelShaderAnalyzer and provide GUIs:

Below are some overviews and articles which introduce the ISA and architecture:

Detailed ISA documentation can be found in the PRMs:

Usage

Intel Shader Analyzer can consume HLSL input or DX bytecode, and pass them for compilation to either the DX11 or DX12 compilers. Currently, HLSL is only supported for shader model 5 shaders.

A simple HLSL command line is shown below:

IntelShaderAnalyzer.exe -s hlsl -f MyVS -p vs_5_0 shader.hlsl

By default, DX11 will be used. DX12 may be specified by using the --api command line switch. For example:

IntelShaderAnalyzer.exe -s hlsl --api dx12 -f MyVS -p vs_5_0 shader.hlsl

The dxbc source language may be used to feed dx bytecode directly to the tool. For example:

IntelShaderAnalyzer.exe -s dxbc --api dx11 shader.bin

The dxbc option also supports passing DXIL shaders to the DX12 backend. For example:

IntelShaderAnalyzer.exe -s dxbc --api dx12 --rootsig_file rootsig.bin shader.bin

Root Signatures

DX12 compilation requires a root signature, so that the compiler may determine how samplers, descriptors, and constants are to be provided to the shader. Different root signatures will result in slightly different generation. Intel Shader Analyzer can obtain a root signature in several differnet ways. If more than one of them is attempted, they are applied in the order described here.

HLSL Attributes

The first option is to use HLSL attributes to embed a root signature in the resulting shader blob, as shown in the example below. If a root signature is found embedded in the compiled shader, it will always be used first.

#define MyRS1 "DescriptorTable(SRV(t0))," \
              "StaticSampler(s0, addressU = TEXTURE_ADDRESS_CLAMP, " \
                                "filter = FILTER_MIN_MAG_MIP_LINEAR )"
                                 
Texture2D<float4> tx : register(t0);
sampler SS : register(s0);

[RootSignature(MyRS1)]
float4 main( float4 uv : uv ) : SV_Target
{
   return tx.Sample( SS, uv );
}


Two-Pass Compilation

For HLSL shaders, a second option is to use the --rootsig_macro command line switch to compile a root signature out of the same source. Here is the same shader, without the rootsignature attribute:

#define MyRS1 "DescriptorTable(SRV(t0))," \
              "StaticSampler(s0, addressU = TEXTURE_ADDRESS_CLAMP, " \
                                "filter = FILTER_MIN_MAG_MIP_LINEAR )"
                                 
Texture2D<float4> tx : register(t0);
sampler SS : register(s0);

float4 main( float4 uv : uv ) : SV_Target
{
   return tx.Sample( SS, uv );
}

If the following command line is used, Intel Shader Analyzer will attempt to compile the input file a second time to obtain the root signature:

IntelShaderAnalyzer.exe -s HLSL --rootsig_macro MyRS1 --api dx12 --profile ps_5_0 filename.hlsl

Precompiled Root Signatures

The final option is to supply a pre-compiled, serialized root signature in a separate file, using the following command line:

IntelShaderAnalyzer.exe -s HLSL --rootsig_file rootsig.bin --api dx12 --profile ps_5_0 filename.hlsl

This option may also be used with dxbc input:

IntelShaderAnalyzer.exe -s dxbc --rootsig_file rootsig.bin --api dx12 filename.dxbc

Command Line

General-Purpose Options

-l
--list-asics

Print a list of supported device families.

-c <device_name>
--asic <device_name>

Add the specified device to the list of compile targets. The device name must be one of the ones returned by --list-asics. By default, all supported asics are compiled.

--api dx11
--api dx12

Set the target API. Default is 'dx11'. Code generation may differ between the dx11 and dx12 drivers. Supported APIs are 'dx11' and 'dx12' Compilation for DX12 requires a root signature.

--isa <path_prefix>

Set the directory name for output ISA files. For each target device the compiler will emit a file named <path_prefix><device_name>.asm

For example:
--isa ./output --asic Skylake

will produce a file named: ./outputSkylake.asm

The default is "./isa_".

-s [hlsl | dxbc]

Set the source language. Valid values are hlsl or dxbc. The dxbcsource language may be used for both legacy DX11 bytecode and DXIL. Default is dxbc

--rootsig_file <path>

Load a serialized DX root signature from the specified path.

HLSL Options

--rootsig_profile <profile>

Set the compilation profile for root signature compilation. Default is: rootsig_1_0.

--rootsig_macro <name>

Sets the macro name for root signature compilation. If this option is specified, and no root signature is provided. The tool will attempt to re-compile the input HLSL source to extract the root signature.

--DXLocation

Set the location of the D3D compiler DLL. The default is d3dcompiler_47.dll

--DXFlags <number>

Set the flags for the HLSL compiler. Argument is a bitwise combination of D3DCOMPILE_ flags. See the MSDN documentation

-D <SYMBOL>=<VALUE>
-D <SYMBOL>

Add a preprocessor define

--profile
-p

Set the shader profile for HLSL compilation. Required.

--function
-f

Set the entrypoint for HLSL compilation. Optional. Default is main.

Running Tests

The tests use a very simple-minded python script.

To run the tests, cd to the 'tests' directory, copy the executable into it (and the driver DLLs, as required). Then run python run_tests.py The script will automatically check exit codes, but it is necessary to manually inspect the output to ensure that the tool is behaving as expected.

The tests need to be run from a bash shell, or a windows shell with GNU 'rm' utilities in the path.

More Repositories

1

PresentMon

Capture and analyze the high-level performance characteristics of graphics applications on Windows.
C++
1,576
star
2

IntroductionToVulkan

Source code examples for "API without Secrets: Introduction to Vulkan" tutorial
C++
1,273
star
3

MaskedOcclusionCulling

Example code for the research paper "Masked Software Occlusion Culling"; implements an efficient alternative to the hierarchical depth buffer algorithm.
C++
592
star
4

XeGTAO

An implementation of [Jimenez et al., 2016] Ground Truth Ambient Occlusion, MIT license
C++
589
star
5

GTS-GamesTaskScheduler

A task scheduling framework designed for the needs of game developers.
C++
437
star
6

ISPCTextureCompressor

ISPC Texture Compressor
C++
426
star
7

OcclusionCulling

Demonstrates a software (CPU) based approach to occllusion culling using multi-threading and SIMD instructions to improve performance.
C++
383
star
8

Intel-Texture-Works-Plugin

Intel has extended Photoshop* to take advantage of the latest image compression methods (BCn/DXT) via plugin. The purpose of this plugin is to provide a tool for artists to access superior compression results at optimized compression speeds within Photoshop*.
C++
247
star
9

ASSAO

Adaptive Screen Space Ambient Occlusion
C++
245
star
10

MetricsGui

Library of ImGui controls for displaying performance metrics.
C++
237
star
11

OutdoorLightScattering

Outdoor Light Scattering Sample
C++
236
star
12

DynamicCheckerboardRendering

Checkerboard Rendering and Dynamic Resolution Rendering in the DX12 MiniEngine
C++
174
star
13

OpenGL-ES-3.0-Deferred-Rendering

OpenGL ES 3.0 Deferred Renderer
C
142
star
14

CMAA2

Conservative Morphological Anti-Aliasing 2.0
C++
129
star
15

asteroids_d3d12

Intel Asteroids DirectX 12 Sample
C++
128
star
16

PracticalVulkan

Repository with code samples for "API without Secrets: The Practical Approach to Vulkan" series of articles.
C++
119
star
17

stardust_vulkan

The Stardust sample application uses the Vulkan graphics API to efficiently render a cloud of animated particles.
C
116
star
18

gpudetect

An example application that demonstrates how to detect which Intel GPU is present, as well as architecture-specific information such as how much memory is available.
C++
115
star
19

SamplerFeedbackStreaming

This sample uses D3D12 Sampler Feedback and DirectStorage as part of an asynchronous texture streaming solution.
C++
105
star
20

TAA

Intel® Graphics Optimized Temporal Anti-Aliasing (TAA)
C++
100
star
21

LightScattering

Source code for the light scattering sample
C++
96
star
22

VRS-DoF

Variable Rate Shading and Depth of Field
C++
95
star
23

CloudsGPUPro6

C++
91
star
24

DX12-Multi-Adapter

DirectX 12 Explicit Heterogeneous Multi-adapter Sample implementing Split Frame Rendering
C++
82
star
25

CloudySky

Cloud Rendering Sample
C++
79
star
26

XeSSUnrealPlugin

Intel® XeSS Plugin for Unreal* Engine
78
star
27

FlipModelD3D12

Interactive visualization for understanding swap chains in D3D12
C++
76
star
28

FaceMapping2

This is an improvement on the original FaceMapping code sample. This sample uses Intel RealSense to scan the user's face, and map it onto 3d head mesh.
C++
73
star
29

ClusteredShadingAndroid

Clustered shading on Android sample
C
68
star
30

HybridDetect

Heterogeneous & Homogeneous CPU Detect for Intel Processors
C++
65
star
31

DeferredCoarsePixelShading

Deferred Coarse Pixel Shading Source Code (For the article in GPU Pro 7)
C++
62
star
32

UnrealCapabilityDetect

A plugin for system capability detect in Unreal Engine 4
C++
55
star
33

FaceMapping

The face mapping sample uses the 3D Scan module to scan the user's face and then map it onto an existing 3D head model. This technique does a "stone face" mapping that is not rigged or currently capable of animating.
C++
44
star
34

FaceTracking

Intel® RealSense™ SDK-Based Real-Time Face Tracking and Animation
Logos
42
star
35

AOIT-Update

Adaptive Order Independant Transparency Sample
C++
39
star
36

UE4_GPA_Plugin

Intel® Graphics Performance Analyzer plugin for Unreal Engine* 4
C++
39
star
37

DynamicResolutionRendering

DynamicResolutionRendering_source_V3_update
C++
32
star
38

UE4RealSensePlugin

This UE4 plugin provides support for the Intel RealSense SDK to Unreal Engine 4 developers by exposing features of the SDK to the Blueprints Visual Scripting System.
C++
28
star
39

Multi-Adapter-Particles

Demonstration of Integrated + Discrete Multi-Adapter modified from Microsoft's D3D12nBodyGravity
C++
26
star
40

D3D12VariableRateShading

A simple D3D12 example demonstrating how to use Intel Tier 1 Variable Rate Shading
C++
21
star
41

MetricsDiscoveryHelper

A wrapper for Intel(R) MetricsDiscovery API that simplifies some common tasks and provides a more unified interface across different graphics APIs.
C++
20
star
42

UnityPerformanceSandbox

Project that can be used to learn Graphics Performance Analyzer toolkit by following along Unity* Optimization Guide for Intel x86 Platforms article. https://software.intel.com/en-us/android/articles/unity-optimization-guide-for-x86-android-part-1
C#
17
star
43

ChatHeads

Chat Heads is a native sample that uses RealSense to overlay background segmented (BGS) player images on a 3D scene or video playback in a multiplayer scenario.
C++
16
star
44

VALAR

Velocity And Luminance Adaptive Rasterization
C++
13
star
45

GrassInstancing

Grass rendering using geometry instancing in Direct3D 10.
C++
13
star
46

OpenGLESTessellation

Sample demonstrating the use of tessellation shaders with OpenGLES
C
13
star
47

Windows-Desktop-Sensors

Sample demonstrating how to use sensors for Windows Desktop
C++
8
star
48

EZSIMD

C++
8
star
49

64-bit-Typed-Atomics-Extension

C
8
star
50

XeSS-VALAR-Demo

Mini-Engine Demonstration of Combining XeSS with VRS Tier 2.
C++
8
star
51

CPU_Capability_Tester

C#
7
star
52

RCRaceland

Unreal Engine 4 sample showing how to take advantage of the CPU for more realistic scenes
C++
5
star
53

CmdThrottlePolicy

sample showing how to use the DX12 CmdThrottlePolicy Extension
C
4
star
54

VALAR-API

C
3
star
55

InstantAccess_Tiling

C++
3
star
56

AdaptiveSync

Demo and Library for Adaptive Sync
C++
3
star
57

gametechdev.github.io

HTML
1
star