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 2ebac2c99f4fc84aac5e0e6de9c2c600b4c1374b
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Sat Apr 13 08:10:02 2024 +0200

    use same filename number for .c and .hlsl
---
 src/d3d_3.c       |  4 ++--
 src/shader_3.hlsl | 10 +++-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/d3d_3.c b/src/d3d_3.c
index d9d8bf4..65bba77 100644
--- a/src/d3d_3.c
+++ b/src/d3d_3.c
@@ -294,7 +294,7 @@ D3d *d3d_init(Window *win, int vsync)
     flags |= D3DCOMPILE_DEBUG;
 #endif
     vs_blob = NULL;
-    res = D3DCompileFromFile(L"shader_2.hlsl",
+    res = D3DCompileFromFile(L"shader_3.hlsl",
                              NULL,
                              D3D_COMPILE_STANDARD_FILE_INCLUDE,
                              "main_vs",
@@ -339,7 +339,7 @@ D3d *d3d_init(Window *win, int vsync)
 
     /* Pixel shader */
     ps_blob = NULL;
-    res = D3DCompileFromFile(L"shader_2.hlsl",
+    res = D3DCompileFromFile(L"shader_3.hlsl",
                              NULL,
                              D3D_COMPILE_STANDARD_FILE_INCLUDE,
                              "main_ps",
diff --git a/src/shader_3.hlsl b/src/shader_3.hlsl
index 336ffb5..f085621 100644
--- a/src/shader_3.hlsl
+++ b/src/shader_3.hlsl
@@ -7,13 +7,11 @@ cbuffer cv_viewport : register(b0)
 struct vs_input
 {
     uint2 position : POSITION;
-    float4 color : COLOR;
 };
 
 struct ps_input
 {
     float4 position : SV_POSITION;
-    float4 color : COLOR;
 };
 
 /*
@@ -21,7 +19,6 @@ struct ps_input
  *
  * @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)
 {
@@ -32,17 +29,16 @@ ps_input main_vs(vs_input input)
     p -= 1.0f;
     p.y *= -1.0f;
     output.position = float4(p, 0.0f, 1.0f);
-    output.color = input.color;
     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
+ * @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 input.color;
+    return float4(1.0f, 0.0f, 1.0f, 1.0f);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to