Browse Source

no message

Hongtae Kim 6 years ago
parent
commit
aabd3b95fa
3 changed files with 9 additions and 3 deletions
  1. 7
    1
      Data/triangle.vert
  2. BIN
      Data/triangle.vert.spv
  3. 2
    2
      TestApp1/TestApp1.cpp

+ 7
- 1
Data/triangle.vert View File

@@ -6,6 +6,12 @@
6 6
 layout (location = 0) in vec3 inPos;
7 7
 layout (location = 1) in vec3 inColor;
8 8
 
9
+layout (binding = 0) uniform UBO 
10
+{
11
+	mat4 projectionMatrix;
12
+	mat4 modelMatrix;
13
+	mat4 viewMatrix;
14
+} ubo;
9 15
 
10 16
 layout (location = 0) out vec3 outColor;
11 17
 
@@ -18,5 +24,5 @@ out gl_PerVertex
18 24
 void main() 
19 25
 {
20 26
 	outColor = inColor;
21
-	gl_Position = vec4(inPos.xyz, 1.0);
27
+	gl_Position = ubo.projectionMatrix * ubo.viewMatrix * ubo.modelMatrix * vec4(inPos.xyz, 1.0);
22 28
 }

BIN
Data/triangle.vert.spv View File


+ 2
- 2
TestApp1/TestApp1.cpp View File

@@ -36,7 +36,7 @@ public:
36 36
 		for (int i = 0; i < vertShaderFunction->VertexAttributes().Count(); ++i)
37 37
 		{ 
38 38
 			const DKVertexAttribute& attr = vertShaderFunction->VertexAttributes().Value(i);
39
-			DKLog("  --> VertexAttribute[%d]: %ls (%u)", i, (const wchar_t*)attr.name, attr.location);
39
+			DKLog("  --> VertexAttribute[%d]: \"%ls\" (location:%u)", i, (const wchar_t*)attr.name, attr.location);
40 40
 		}
41 41
 
42 42
 		struct Vertex
@@ -96,7 +96,7 @@ public:
96 96
 				case DKShaderArgument::TypeSampler:	argType = "Sampler"; break;
97 97
 				case DKShaderArgument::TypeThreadgroupMemory:	argType = "ThreadMemory"; break;
98 98
 				}
99
-				DKLog("  --> %ls[%u] binding:%u:%u type:%s", (const wchar_t*)arg.name, uint32_t(arg.arrayLength), arg.set, arg.binding, argType);
99
+				DKLog("  --> \"%ls\"[%u] binding:%u:%u type:%s", (const wchar_t*)arg.name, uint32_t(arg.count), arg.set, arg.binding, argType);
100 100
 			};
101 101
 			DKLog("PipelineReflection.VertexArguments: %d", reflection.vertexArguments.Count());
102 102
 			for (auto& arg : reflection.vertexArguments)