Updated documentation to reflect latest changes and features

* Also in many places OpenGL is now advertised as full support, since it
  is pretty close by now and needs people to jump on it full-time and
  use it in anger.
This commit is contained in:
baldurk
2015-02-27 13:18:54 +00:00
parent cd35c726bc
commit a50445781f
25 changed files with 508 additions and 72 deletions
+73 -7
View File
@@ -9,8 +9,10 @@
<section address="intro">
<title>Introduction</title>
<content>
<para>The basic process of setting up the custom shader involves writing a .hlsl file that
will be compiled and used by RenderDoc.</para>
<para>The basic process of setting up the custom shader involves writing a .hlsl or .glsl
file that will be compiled and used by RenderDoc. Note that the type used matches the API
used, and RenderDoc will automatically list only the hlsl shaders you have if you load
a log with D3D11, and vice-versa for OpenGL.</para>
<para>There are several special global variables that can be specified and will
be filled in with values by RenderDoc.</para>
<para>Your pixel shader defines an operation that transforms the raw value from the input
@@ -20,8 +22,8 @@
<para>Multisampled textures will be resolved before being passed to your function.
Depth and stencil textures will be bound separately and passed as multisampled resources.</para>
<para>To set up your shader, it's recommended that you use the UI defined in the documentation for the
<link xlink:href="2c540574-0b81-4a40-8119-ba0283fddf41" />, but you can manually create a .hlsl file in
<codeInline>%APPDATA%\RenderDoc\</codeInline>. The file must contain an hlsl function main() that
<link xlink:href="2c540574-0b81-4a40-8119-ba0283fddf41" />, but you can manually create a .hlsl or .glsl file in
<codeInline>%APPDATA%\RenderDoc\</codeInline>. The file must contain an entry point main() that
returns float4, and uses any of the below inputs. These shaders are loaded when RenderDoc
loads a logfile, and RenderDoc watches for any changes to the files (either externally or in
the shader editor in RenderDoc) and automatically reloads them.</para>
@@ -38,6 +40,10 @@
<para>Type and capitalisation is important for these variables, so ensure you use the right
declaration!</para>
</alert>
<para>The shader editor when using the UI can be used to insert these snippets for you,
with the right type and spelling. Be careful for GL though, as these snippets are inserted
at the top of the file and so are inserted before the #version statement.</para>
<table>
<tableHeader>
@@ -47,7 +53,7 @@
</row>
</tableHeader>
<row>
<entry><para>UV co-ordinates</para></entry>
<entry><para>UV co-ordinates (D3D11 only)</para></entry>
<entry>
<code language="hlsl">
float4 main(<markup><u>float4 pos : SV_Position</u></markup>, <markup><u>float4 uv : TEXCOORD0</u></markup>) : SV_Target0
@@ -69,7 +75,8 @@ co-ordinates from 0 to 1 in each dimension over the size of the texture (or text
<entry><para>Texture dimensions</para></entry>
<entry>
<code language="hlsl">
uint4 RENDERDOC_TexDim;
uint4 RENDERDOC_TexDim; // hlsl
uvec4 RENDERDOC_TexDim; // glsl
</code>
<para>This variable will be filled out with the following values:</para>
@@ -99,6 +106,12 @@ uint RENDERDOC_TextureType;
<para>This variable will be set to a given integer value, depending on the type of
the current texture being displayed. This can be used to sample from the correct resource.</para>
<alert class="note">
<para>The value varies depending on whether this is an HLSL shader or GLSL, as they have different
resource types.</para>
</alert>
<para>D3D11 / HLSL</para>
<list class="ordered">
<listItem><para>1D texture</para></listItem>
<listItem><para>2D texture</para></listItem>
@@ -111,10 +124,24 @@ uint RENDERDOC_TextureType;
<listItem><para>2D texture (Multisampled)</para></listItem>
</list>
<para>OpenGL / GLSL</para>
<list class="ordered">
<listItem><para>1D texture</para></listItem>
<listItem><para>2D texture</para></listItem>
<listItem><para>3D texture</para></listItem>
<listItem><para>Cubemap</para></listItem>
<listItem><para>1D array texture</para></listItem>
<listItem><para>2D array texture</para></listItem>
<listItem><para>Cubemap array</para></listItem>
<listItem><para>Rectangle</para></listItem>
<listItem><para>Buffer texture</para></listItem>
<listItem><para>2D texture (Multisampled)</para></listItem>
</list>
</entry>
</row>
<row>
<entry><para>Samplers</para></entry>
<entry><para>Samplers (D3D11 only)</para></entry>
<entry>
<code language="hlsl">
SamplerState pointSampler : register(s0);
@@ -128,6 +155,7 @@ SamplerState linearSampler : register(s1);
<row>
<entry><para>Resources</para></entry>
<entry>
<para>D3D11 / HLSL</para>
<code language="hlsl">
Texture1DArray&lt;float4&gt; texDisplayTex1DArray : register(t1);
Texture2DArray&lt;float4&gt; texDisplayTex2DArray : register(t2);
@@ -148,6 +176,44 @@ Texture1DArray&lt;int4&gt; texDisplayIntTex1DArray : register(t21);
Texture2DArray&lt;int4&gt; texDisplayIntTex2DArray : register(t22);
Texture3D&lt;int4&gt; texDisplayIntTex3D : register(t23);
Texture2DMSArray&lt;int4&gt; texDisplayIntTex2DMSArray : register(t29);
</code>
<para>OpenGL / GLSL</para>
<code language="hlsl">
// Unsigned int samplers
layout (binding = 1) uniform usampler1D texUInt1D;
layout (binding = 2) uniform usampler2D texUInt2D;
layout (binding = 3) uniform usampler3D texUInt3D;
// skip cube = 4
layout (binding = 5) uniform usampler1DArray texUInt1DArray;
layout (binding = 6) uniform usampler2DArray texUInt2DArray;
// skip cube array = 7
layout (binding = 8) uniform usampler2DRect texUInt2DRect;
layout (binding = 9) uniform usamplerBuffer texUIntBuffer;
layout (binding = 10) uniform usampler2DMS texUInt2DMS;
// Int samplers
layout (binding = 1) uniform isampler1D texSInt1D;
layout (binding = 2) uniform isampler2D texSInt2D;
layout (binding = 3) uniform isampler3D texSInt3D;
// skip cube = 4
layout (binding = 5) uniform isampler1DArray texSInt1DArray;
layout (binding = 6) uniform isampler2DArray texSInt2DArray;
// skip cube array = 7
layout (binding = 8) uniform isampler2DRect texSInt2DRect;
layout (binding = 9) uniform isamplerBuffer texSIntBuffer;
layout (binding = 10) uniform isampler2DMS texSInt2DMS;
// Floating point samplers
layout (binding = 1) uniform sampler1D tex1D;
layout (binding = 2) uniform sampler2D tex2D;
layout (binding = 3) uniform sampler3D tex3D;
layout (binding = 4) uniform samplerCube texCube;
layout (binding = 5) uniform sampler1DArray tex1DArray;
layout (binding = 6) uniform sampler2DArray tex2DArray;
layout (binding = 7) uniform samplerCubeArray texCubeArray;
layout (binding = 8) uniform sampler2DRect tex2DRect;
layout (binding = 9) uniform samplerBuffer texBuffer;
layout (binding = 10) uniform sampler2DMS tex2DMS;
</code>
<para>These resources are bound sparsely with the appropriate type for the
current texture. With a couple of exceptions there will only be one texture bound
+2 -2
View File
@@ -13,13 +13,13 @@
<para><link xlink:href="a00964a1-733f-4288-a79e-c28238bc6018">Custom visualisation shaders</link> allow you to define
your own transformation on any texture you're viewing before it is displayed. Mostly this is useful for decoding
packed or custom-format data, or displaying some data in a more visually intuitive fashion.</para>
<para>These shaders live as .hlsl files in <codeInline>%APPDATA%\RenderDoc\</codeInline>, and can be edited in your
<para>These shaders live as .hlsl/.glsl files in <codeInline>%APPDATA%\RenderDoc\</codeInline>, and can be edited in your
editor of choice, any changes saved will be reloaded. Note however that there is currently no way to see the
compile warnings or errors produced. This is probably best for when you have an existing shader to drop-in.</para>
<para>To edit a shader inside RenderDoc simply click the edit button
<mediaLinkInline><image xlink:href="page_white_edit"/></mediaLinkInline> when you have selected your custom shader
for use. This will launch a new window with the custom shader and any changes you make to this shader will be
saved to the .hlsl file and compiled and reflected in the texture viewer as long as you have that custom shader
saved to the .hlsl/.glsl file and compiled and reflected in the texture viewer as long as you have that custom shader
selected.</para>
</content>
</section>
+1 -2
View File
@@ -72,8 +72,7 @@
<para>You can expand each event to see if there were multiple fragments, and see the shader output
value from each fragment.</para>
<para>Right clicking will allow you to launch the shader debugger at the given event for the selected
pixel. Currently this does not debug the specific fragment you selected, only the default behaviour
for debugging that event.</para>
pixel. If you select a particular fragment or primitive, this will be the fragment that is debugged.</para>
</content>
</section>
<relatedTopics>
+10
View File
@@ -75,6 +75,10 @@
<caption placement="after" lead="Custom Buffer Layout">Customising the layout of the buffer by defining a structure.</caption>
<image xlink:href="RawBuffer"/>
</mediaLink>
<alert class="note">
<para>This window supports copy and paste, so simply select the entries and ctrl-c to
copy to the clipboard</para>
</alert>
</content>
</section>
<section address="constants">
@@ -89,6 +93,12 @@
<caption placement="after" lead="Constant Buffer">An updating preview of the contents of this constant buffer.</caption>
<image xlink:href="CBuffer"/>
</mediaLink>
<alert class="note">
<para>This window supports copy and paste, so simply select the entries and ctrl-c to
copy to the clipboard</para>
</alert>
</content>
</section>
</developerConceptualDocument>