This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository direct3d.
View the commit online.
commit cba30519e3b033a245de925eef982d6b955b73a7
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Sat Aug 19 13:24:23 2023 +0200
shaders: better doc
---
src/shader_1.hlsl | 2 +-
src/shader_2.hlsl | 16 ++++++++++++++--
src/shader_3.hlsl | 17 +++++++++++++++--
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/src/shader_1.hlsl b/src/shader_1.hlsl
index 6b4e7a4..acaed0f 100644
--- a/src/shader_1.hlsl
+++ b/src/shader_1.hlsl
@@ -14,7 +14,7 @@ struct ps_input
* @param input the 2 coordinates of a vertex, got from CPU
* @return the 4D position of the pixel corresponding to the vertex in GPU
*/
-ps_input main_vs(vs_input input )
+ps_input main_vs(vs_input input)
{
ps_input output;
output.position = float4(input.position, 0.0f, 1.0f);
diff --git a/src/shader_2.hlsl b/src/shader_2.hlsl
index ed2b87e..f085621 100644
--- a/src/shader_2.hlsl
+++ b/src/shader_2.hlsl
@@ -1,7 +1,7 @@
cbuffer cv_viewport : register(b0)
{
float2 viewport_inv_size;
- float2 dummy;
+ float2 dummy; /* unused, to have a multiple of 16 bytes */
}
struct vs_input
@@ -14,7 +14,13 @@ struct ps_input
float4 position : SV_POSITION;
};
-ps_input main_vs(vs_input input )
+/*
+ * vertex shater program
+ *
+ * @param input the 2 coordinates of a pixel, got from CPU
+ * @return the 4D position of the normalized coordinates of the vertex in GPU
+ */
+ps_input main_vs(vs_input input)
{
ps_input output;
float2 p = input.position;
@@ -26,6 +32,12 @@ ps_input main_vs(vs_input input )
return output;
}
+/*
+ * pixel shater program
+ *
+ * @param input the 4D coordinates of a pixel
+ * @return the color of the pixel in RGBA colorspace, here pink
+ */
float4 main_ps(ps_input input) : SV_TARGET
{
return float4(1.0f, 0.0f, 1.0f, 1.0f);
diff --git a/src/shader_3.hlsl b/src/shader_3.hlsl
index 443c0a2..336ffb5 100644
--- a/src/shader_3.hlsl
+++ b/src/shader_3.hlsl
@@ -1,7 +1,7 @@
cbuffer cv_viewport : register(b0)
{
float2 viewport_inv_size;
- float2 dummy;
+ float2 dummy; /* unused, to have a multiple of 16 bytes */
}
struct vs_input
@@ -16,7 +16,14 @@ struct ps_input
float4 color : COLOR;
};
-ps_input main_vs(vs_input input )
+/*
+ * vertex shater program
+ *
+ * @param input the 2 coordinates of a pixel, got from CPU
+ * @return the 4D position of the normalized coordinates of the vertex in GPU
+ * as well as the color
+ */
+ps_input main_vs(vs_input input)
{
ps_input output;
float2 p = input.position;
@@ -29,6 +36,12 @@ ps_input main_vs(vs_input input )
return output;
}
+/*
+ * pixel shater program
+ *
+ * @param input the 4D coordinates of a pixel and the color
+ * @return the color of the pixel in RGBA colorspace passed as input
+ */
float4 main_ps(ps_input input) : SV_TARGET
{
return input.color;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.