Skip to content

Commit d46eb3c

Browse files
committed
commitment
1 parent 8c4777c commit d46eb3c

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

GAIL/Application.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using GAIL.Graphics;
33
using GAIL.Input;
44
using GAIL.Window;
5-
using OxDED.Terminal;
65
using LambdaKit.Logging;
76
using LambdaKit.Logging.Targets;
7+
using LambdaKit.Terminal;
88

99
namespace GAIL
1010
{
@@ -88,7 +88,11 @@ public Application(Logger? logger = null, Severity severity = Severity.Info) {
8888

8989
int index = Logger.GetTargetIndex<TerminalTarget>();
9090
if (index > -1) {
91-
Logger.GetTarget<TerminalTarget>(index)!.Format = "<{0}>: ("+Color.DarkBlue.ToForegroundANSI()+"{2}"+ANSI.Styles.ResetAll+")[{5}"+ANSI.Styles.Bold+"{3}"+ANSI.Styles.ResetAll+"] : {5}{4}"+ANSI.Styles.ResetAll;
91+
Logger.GetTarget<TerminalTarget>(index)!.Format =
92+
new StyleBuilder().Text("<{0}>: (")
93+
.Foreground((StandardColor)StandardColor.Colors.Blue).Text("{2}")
94+
.Reset().Text(")[{5}").Bold().Text("{3}").Bold(false)
95+
.Text("] : {5}{4}").Reset().ToString();
9296
Logger.GetTarget<TerminalTarget>(index)!.NameFormat = "{0} - {1}";
9397
}
9498
index = Logger.GetTargetIndex<FileTarget>();

GAIL/Graphics/Renderer/Vulkan/Device.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,16 @@ public SwapChain.SupportDetails CheckSwapChainSupport(PhysicalDevice device) {
138138
var details = new SwapChain.SupportDetails();
139139

140140
unsafe {
141-
_ = Utils.Check(surface.surfaceExtension.GetPhysicalDeviceSurfaceCapabilities(device, surface.surface, out details.Capabilities), Logger, "Failed at getting PhysicalDevice surface capabilities", true);
141+
_ = Utils.Check(surface.Extension.GetPhysicalDeviceSurfaceCapabilities(device, surface.surface, out details.Capabilities), Logger, "Failed at getting PhysicalDevice surface capabilities", true);
142142

143143
// Surface formats
144144
Utils.GetArray((Pointer<SurfaceFormatKHR> pointer, Pointer<uint> count) => {
145-
return surface.surfaceExtension.GetPhysicalDeviceSurfaceFormats(device, surface.surface, count, pointer);
145+
return surface.Extension.GetPhysicalDeviceSurfaceFormats(device, surface.surface, count, pointer);
146146
}, out details.Formats, Logger, "PhysicalDeviceSurfaceFormats", true);
147147

148148
// Surface present modes
149149
Utils.GetArray((Pointer<PresentModeKHR> pointer, Pointer<uint> count) => {
150-
return surface.surfaceExtension.GetPhysicalDeviceSurfacePresentModes(device, surface.surface, count, pointer);
150+
return surface.Extension.GetPhysicalDeviceSurfacePresentModes(device, surface.surface, count, pointer);
151151
}, out details.PresentModes, Logger, "PhysicalDeviceSurfacePresentModes", true);
152152
}
153153

@@ -200,7 +200,7 @@ public QueueFamilyIndices FindQueueFamilies(PhysicalDevice device) {
200200
indices.GraphicsFamily = i;
201201
}
202202

203-
_ = Utils.Check(surface.surfaceExtension.GetPhysicalDeviceSurfaceSupport(device, i, surface.surface, out Bool32 presentSupport), Logger, "Unable get physical device surface support", true);
203+
_ = Utils.Check(surface.Extension.GetPhysicalDeviceSurfaceSupport(device, i, surface.surface, out Bool32 presentSupport), Logger, "Unable get physical device surface support", true);
204204

205205
if (presentSupport) {
206206
indices.PresentFamily = i;

GAIL/Graphics/Renderer/Vulkan/Shader.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public VertexInputAttributeDescription[] GetAttributesDescription() {
114114
for (uint i = 0; i < requiredAttributes.Count; i++) {
115115
AttributeType type = requiredAttributes[(int)i];
116116
descriptions[i] = new VertexInputAttributeDescription() {
117-
Binding = 0, // TODO: Change this.
117+
Binding = i, // TODO: Change this.
118118
Location = i, // TODO: depending on size of attribute.
119119
Format = (Format)type,
120120
Offset = ... // TODO: depending on size of attribute.
@@ -123,6 +123,20 @@ public VertexInputAttributeDescription[] GetAttributesDescription() {
123123

124124
return descriptions;
125125
}
126+
public VertexInputBindingDescription[] GetBindingsDescription() {
127+
VertexInputBindingDescription[] descriptions = new VertexInputBindingDescription[requiredAttributes.Count];
128+
// TODO: Stuck: We don't know how we get the vertex data.
129+
for (uint i = 0; i < requiredAttributes.Count; i++) {
130+
AttributeType type = requiredAttributes[(int)i];
131+
descriptions[i] = new VertexInputBindingDescription() {
132+
Binding = 0;
133+
Stride = ...;
134+
InputRate = VertexInputRate.Vertex
135+
};
136+
}
137+
138+
return descriptions;
139+
}
126140

127141
/// <inheritdoc/>
128142
public void Dispose() {

GAIL/Graphics/Renderer/VulkanRenderer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using GAIL.Core;
2-
using GAIL.Graphics.Material;
32
using GAIL.Graphics.Renderer.Layer;
43
using GAIL.Graphics.Renderer.Vulkan;
54
using GAIL.Graphics.Renderer.Vulkan.Layer;

examples/HelloTriangle/HelloTriangle.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<ImplicitUsings>enable</ImplicitUsings>
1111
<Nullable>enable</Nullable>
1212
</PropertyGroup>
13+
14+
<!-- Build Shaders -->
1315
<Target Name="BuildVert" BeforeTargets="PreBuildEvent">
1416
<Exec Command="%VULKAN_SDK%/Bin/glslc -fshader-stage=vertex -o vert.spv vert.glsl" />
1517
</Target>

0 commit comments

Comments
 (0)