Skip to content

Commit d007569

Browse files
committed
Renamed 'minimal' sample app to 'minimal d3d12'.
1 parent ecb1be1 commit d007569

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

build.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ fn samplesWindowsLinux(b: *std.Build, options: Options) void {
323323
zstbi_pkg.link(exe);
324324
installDemo(b, exe, "bindless");
325325
}
326-
{ // minimal
327-
const exe = minimal.build(b, options);
326+
{ // minimal d3d12
327+
const exe = minimal_d3d12.build(b, options);
328328
exe.addModule("zwin32", zwin32_pkg.zwin32);
329-
installDemo(b, exe, "minimal");
329+
installDemo(b, exe, "minimal_d3d12");
330330
}
331331
{ // triangle
332332
const exe = triangle.build(b, options);
@@ -598,7 +598,7 @@ const layers_wgpu = @import("samples/layers_wgpu/build.zig");
598598
const gamepad_wgpu = @import("samples/gamepad_wgpu/build.zig");
599599
const physics_test_wgpu = @import("samples/physics_test_wgpu/build.zig");
600600

601-
const minimal = @import("samples/minimal/build.zig");
601+
const minimal_d3d12 = @import("samples/minimal_d3d12/build.zig");
602602
const triangle = @import("samples/triangle/build.zig");
603603
const textured_quad = @import("samples/textured_quad/build.zig");
604604
const mesh_shader_test = @import("samples/mesh_shader_test/build.zig");
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
## minimal
1+
## minimal d3d12
22

33
This sample application shows how to draw a triangle using D3D12 API. It has no dependencies except our [zwin32](https://github.com/michal-z/zig-gamedev/tree/main/libs/zwin32) bindings.
44

55
You can build and run it on **Windows** and **Linux**.
66

77
To build and run on Windows:
88
```
9-
zig build minimal-run
9+
zig build minimal_d3d12-run
1010
```
1111
To build and run on Linux ([Wine](https://www.winehq.org/) with [VKD3D-Proton](https://github.com/HansKristian-Work/vkd3d-proton) is needed):
1212
```
13-
zig build -Dtarget=x86_64-windows-gnu minimal
14-
wine zig-out/bin/minimal.exe
13+
zig build -Dtarget=x86_64-windows-gnu minimal_d3d12
14+
wine zig-out/bin/minimal_d3d12.exe
1515
```
1616
It has been tested on Ubuntu 22.04 with Wine 8.0-rc4 and VK3D-Proton v2.8

samples/minimal/build.zig renamed to samples/minimal_d3d12/build.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const Options = @import("../../build.zig").Options;
44

55
pub fn build(b: *std.Build, options: Options) *std.Build.CompileStep {
66
const exe = b.addExecutable(.{
7-
.name = "minimal",
8-
.root_source_file = .{ .path = thisDir() ++ "/src/minimal.zig" },
7+
.name = "minimal_d3d12",
8+
.root_source_file = .{ .path = thisDir() ++ "/src/minimal_d3d12.zig" },
99
.target = options.target,
1010
.optimize = options.optimize,
1111
});
@@ -44,10 +44,10 @@ pub fn build(b: *std.Build, options: Options) *std.Build.CompileStep {
4444
}
4545

4646
fn buildShaders(b: *std.Build) *std.Build.Step {
47-
const dxc_step = b.step("minimal-dxc", "Build shaders for 'minimal' demo");
47+
const dxc_step = b.step("minimal_d3d12-dxc", "Build shaders for 'minimal d3d12' demo");
4848

49-
makeDxcCmd(b, dxc_step, "src/minimal.hlsl", "vsMinimal", "minimal.vs.cso", "vs", "");
50-
makeDxcCmd(b, dxc_step, "src/minimal.hlsl", "psMinimal", "minimal.ps.cso", "ps", "");
49+
makeDxcCmd(b, dxc_step, "src/minimal_d3d12.hlsl", "vsMain", "minimal_d3d12.vs.cso", "vs", "");
50+
makeDxcCmd(b, dxc_step, "src/minimal_d3d12.hlsl", "psMain", "minimal_d3d12.ps.cso", "ps", "");
5151

5252
return dxc_step;
5353
}

samples/minimal/src/minimal.hlsl renamed to samples/minimal_d3d12/src/minimal_d3d12.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#define root_signature "RootFlags(0)"
22

33
[RootSignature(root_signature)]
4-
void vsMinimal(
4+
void vsMain(
55
uint vertex_id : SV_VertexID,
66
out float4 out_position : SV_Position
77
) {
@@ -10,7 +10,7 @@ void vsMinimal(
1010
}
1111

1212
[RootSignature(root_signature)]
13-
void psMinimal(
13+
void psMain(
1414
float4 position : SV_Position,
1515
out float4 out_color : SV_Target0
1616
) {

samples/minimal/src/minimal.zig renamed to samples/minimal_d3d12/src/minimal_d3d12.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const hrPanicOnFail = zwin32.hrPanicOnFail;
99
pub export const D3D12SDKVersion: u32 = 608;
1010
pub export const D3D12SDKPath: [*:0]const u8 = ".\\d3d12\\";
1111

12-
const window_name = "zig-gamedev: minimal";
12+
const window_name = "zig-gamedev: minimal d3d12";
1313

1414
fn processWindowMessage(
1515
window: w32.HWND,
@@ -93,8 +93,8 @@ pub fn main() !void {
9393
var root_signature: *d3d12.IRootSignature = undefined;
9494
var pipeline: *d3d12.IPipelineState = undefined;
9595
{
96-
const vs_cso = @embedFile("./minimal.vs.cso");
97-
const ps_cso = @embedFile("./minimal.ps.cso");
96+
const vs_cso = @embedFile("./minimal_d3d12.vs.cso");
97+
const ps_cso = @embedFile("./minimal_d3d12.ps.cso");
9898

9999
var pso_desc = d3d12.GRAPHICS_PIPELINE_STATE_DESC.initDefault();
100100
pso_desc.DepthStencilState.DepthEnable = w32.FALSE;

0 commit comments

Comments
 (0)