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 3d111809dba4ec9ea0a9232c2e6914fa289610fc
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Sat Apr 13 08:11:47 2024 +0200

    use same filename number for .c and .hlsl
---
 src/d3d_2.c       |  4 ++--
 src/shader_1.hlsl | 33 ---------------------------------
 src/shader_2.hlsl | 19 ++++---------------
 3 files changed, 6 insertions(+), 50 deletions(-)

diff --git a/src/d3d_2.c b/src/d3d_2.c
index 8e85352..48d8aee 100644
--- a/src/d3d_2.c
+++ b/src/d3d_2.c
@@ -289,7 +289,7 @@ D3d *d3d_init(Window *win, int vsync)
     flags |= D3DCOMPILE_DEBUG;
 #endif
     vs_blob = NULL;
-    res = D3DCompileFromFile(L"shader_1.hlsl",
+    res = D3DCompileFromFile(L"shader_2.hlsl",
                              NULL,
                              D3D_COMPILE_STANDARD_FILE_INCLUDE,
                              "main_vs",
@@ -334,7 +334,7 @@ D3d *d3d_init(Window *win, int vsync)
 
     /* Pixel shader */
     ps_blob = NULL;
-    res = D3DCompileFromFile(L"shader_1.hlsl",
+    res = D3DCompileFromFile(L"shader_2.hlsl",
                              NULL,
                              D3D_COMPILE_STANDARD_FILE_INCLUDE,
                              "main_ps",
diff --git a/src/shader_1.hlsl b/src/shader_1.hlsl
deleted file mode 100644
index acaed0f..0000000
--- a/src/shader_1.hlsl
+++ /dev/null
@@ -1,33 +0,0 @@
-struct vs_input
-{
-    float2 position : POSITION;
-};
-
-struct ps_input
-{
-    float4 position : SV_POSITION;
-};
-
-/*
- * vertex shater program
- *
- * @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 output;
-    output.position = float4(input.position, 0.0f, 1.0f);
-    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_2.hlsl b/src/shader_2.hlsl
index f085621..acaed0f 100644
--- a/src/shader_2.hlsl
+++ b/src/shader_2.hlsl
@@ -1,12 +1,6 @@
-cbuffer cv_viewport : register(b0)
-{
-    float2 viewport_inv_size;
-    float2 dummy;             /* unused, to have a multiple of 16 bytes */
-}
-
 struct vs_input
 {
-    uint2 position : POSITION;
+    float2 position : POSITION;
 };
 
 struct ps_input
@@ -17,18 +11,13 @@ struct ps_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
+ * @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 output;
-    float2 p = input.position;
-    p *= viewport_inv_size;
-    p *= 2.0f;
-    p -= 1.0f;
-    p.y *= -1.0f;
-    output.position = float4(p, 0.0f, 1.0f);
+    output.position = float4(input.position, 0.0f, 1.0f);
     return output;
 }
 

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

Reply via email to