Skip to content

Commit 1d1368b

Browse files
committed
Fucks sake
1 parent 92a32ff commit 1d1368b

9 files changed

Lines changed: 53 additions & 111 deletions

File tree

Examples/Hello.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,11 @@ int main(int argc, char **argv) {
121121
return status;
122122
}
123123

124-
char *basePath = SDL_GetBasePath();
124+
const char *basePath = SDL_GetBasePath();
125125
if (basePath) {
126126
char shaderDir[512];
127127
SDL_snprintf(shaderDir, sizeof(shaderDir), "%sShaders", basePath);
128128
$$(Resource, addResourcePath, shaderDir);
129-
SDL_free(basePath);
130129
}
131130

132131
window = SDL_CreateWindow("ObjectivelyGPU Hello", 800, 600, SDL_WINDOW_HIGH_PIXEL_DENSITY);

Examples/HelloCompute.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ int main(int argc, char **argv) {
5656
return status;
5757
}
5858

59-
char *basePath = SDL_GetBasePath();
59+
const char *basePath = SDL_GetBasePath();
6060
if (basePath) {
6161
char shaderDir[512];
6262
SDL_snprintf(shaderDir, sizeof(shaderDir), "%sShaders", basePath);
6363
$$(Resource, addResourcePath, shaderDir);
64-
SDL_free(basePath);
6564
}
6665

6766
window = SDL_CreateWindow("ObjectivelyGPU HelloCompute", 800, 600, SDL_WINDOW_HIGH_PIXEL_DENSITY);

Examples/Shaders/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SPIRV_BLOBS = \
3030
EXTRA_DIST = $(HLSL_FILES) $(MSL_BLOBS) $(SPIRV_BLOBS)
3131

3232
.PHONY: shadercross
33-
shadercross: $(addprefix $(srcdir)/,$(MSL_BLOBS) $(SPIRV_BLOBS))
33+
shadercross: $(EXTRA_DIST)
3434

3535
$(srcdir)/%.vert.spv: $(srcdir)/%.vert.hlsl
3636
$(SHADERCROSS) $< -s HLSL -d SPIRV -t vertex -e vs_main -o $@

ObjectivelyGPU.xcodeproj/project.pbxproj

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
AA000000000000000000FF01 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; };
4545
CCCB11DB70E4A962360A2119 /* CopyPass.c in Sources */ = {isa = PBXBuildFile; fileRef = C862954A9DD435C1FF7CD31D /* CopyPass.c */; };
4646
CEA0030000000000000000F1 /* Objectively.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA0030000000000000000F0 /* Objectively.framework */; };
47+
CECF83982FEF6A7200CB0CCA /* Mathlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CECF83972FEF6A7200CB0CCA /* Mathlib.h */; settings = {ATTRIBUTES = (Public, ); }; };
4748
DF73824CC25298378B451056 /* CopyPass.h in Headers */ = {isa = PBXBuildFile; fileRef = 59334BDAED542AB6DE565EDD /* CopyPass.h */; settings = {ATTRIBUTES = (Public, ); }; };
4849
EE00100000000000000000B1 /* Hello.c in Sources */ = {isa = PBXBuildFile; fileRef = EE00010000000000000000B1 /* Hello.c */; };
4950
EE00110000000000000000B2 /* HelloCompute.c in Sources */ = {isa = PBXBuildFile; fileRef = EE00020000000000000000B2 /* HelloCompute.c */; };
@@ -117,9 +118,13 @@
117118
9220C57BBAA3C951D8083799 /* RenderDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderDevice.h; sourceTree = "<group>"; };
118119
AA000000000000000000EE01 /* SDL3.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SDL3.xcframework; path = Frameworks/SDL3.xcframework; sourceTree = "<group>"; };
119120
C16D60B0E94469E649953EC5 /* ObjectivelyGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectivelyGPU.h; sourceTree = "<group>"; };
120-
C510361664FA37CEC93731E8 /* Renderer.vert.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = Renderer.vert.hlsl; sourceTree = "<group>"; };
121121
C862954A9DD435C1FF7CD31D /* CopyPass.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = CopyPass.c; sourceTree = "<group>"; };
122122
CEA0030000000000000000F0 /* Objectively.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Objectively.framework; sourceTree = BUILT_PRODUCTS_DIR; };
123+
CECF83912FEF634300CB0CCA /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.make; };
124+
CECF83942FEF65EB00CB0CCA /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
125+
CECF83952FEF65FF00CB0CCA /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
126+
CECF83962FEF65FF00CB0CCA /* ObjectivelyGPU.pc.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = ObjectivelyGPU.pc.in; sourceTree = "<group>"; };
127+
CECF83972FEF6A7200CB0CCA /* Mathlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Mathlib.h; sourceTree = "<group>"; };
123128
CEEAAFF72FED833A00FFEBE6 /* COPYING */ = {isa = PBXFileReference; lastKnownFileType = text; path = COPYING; sourceTree = "<group>"; };
124129
CEEAAFF82FED833A00FFEBE6 /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
125130
CEEAAFFA2FED833A00FFEBE6 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
@@ -138,12 +143,11 @@
138143
EI00040000000000000000B4 /* ObjectivelyGPU-Hello-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ObjectivelyGPU-Hello-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
139144
EI00050000000000000000B5 /* ObjectivelyGPU.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ObjectivelyGPU.xcframework; path = Frameworks/ObjectivelyGPU.xcframework; sourceTree = "<group>"; };
140145
EI00060000000000000000B6 /* Objectively.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Objectively.xcframework; path = Frameworks/Objectively.xcframework; sourceTree = "<group>"; };
141-
FDEE3DD81E43E5CFE68E9519 /* Renderer.frag.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = Renderer.frag.hlsl; sourceTree = "<group>"; };
142-
SC00600000000000000000A0 /* Hello.vert.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Hello.vert.hlsl"; sourceTree = "<group>"; };
143-
SC00700000000000000000A0 /* Hello.frag.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Hello.frag.hlsl"; sourceTree = "<group>"; };
144-
SC00800000000000000000A0 /* HelloCompute.comp.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "HelloCompute.comp.hlsl"; sourceTree = "<group>"; };
145-
SC00900000000000000000A0 /* HelloCompute.vert.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "HelloCompute.vert.hlsl"; sourceTree = "<group>"; };
146-
SC00A00000000000000000A0 /* HelloCompute.frag.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "HelloCompute.frag.hlsl"; sourceTree = "<group>"; };
146+
SC00600000000000000000A0 /* Hello.vert.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = Hello.vert.hlsl; sourceTree = "<group>"; };
147+
SC00700000000000000000A0 /* Hello.frag.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = Hello.frag.hlsl; sourceTree = "<group>"; };
148+
SC00800000000000000000A0 /* HelloCompute.comp.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HelloCompute.comp.hlsl; sourceTree = "<group>"; };
149+
SC00900000000000000000A0 /* HelloCompute.vert.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HelloCompute.vert.hlsl; sourceTree = "<group>"; };
150+
SC00A00000000000000000A0 /* HelloCompute.frag.hlsl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HelloCompute.frag.hlsl; sourceTree = "<group>"; };
147151
/* End PBXFileReference section */
148152

149153
/* Begin PBXFrameworksBuildPhase section */
@@ -192,6 +196,7 @@
192196
8C4FDD7B635240BD562EBB49 = {
193197
isa = PBXGroup;
194198
children = (
199+
DOC00030000000000000001 /* Documentation */,
195200
EE00200000000000000000B1 /* Examples */,
196201
CE73E9F62FEEA53E0048BC24 /* Frameworks */,
197202
B23D89B2D2DF3745A003AEB1 /* Products */,
@@ -200,24 +205,17 @@
200205
CEEAAFF82FED833A00FFEBE6 /* Makefile.am */,
201206
CEEAAFFA2FED833A00FFEBE6 /* README.md */,
202207
CEEAAFFD2FED83E400FFEBE6 /* configure.ac */,
203-
DOC00030000000000000001 /* Documentation */,
204208
DOC00020000000000000001 /* Doxyfile */,
205209
);
206210
sourceTree = "<group>";
207211
};
208-
DOC00030000000000000001 /* Documentation */ = {
209-
isa = PBXGroup;
210-
children = (
211-
DOC00010000000000000001 /* index.md */,
212-
);
213-
path = Documentation;
214-
sourceTree = "<group>";
215-
};
216212
904A6003E847F129BD1EE63E /* Sources */ = {
217213
isa = PBXGroup;
218214
children = (
219215
AFF3775B279FC0FE4D348FBA /* ObjectivelyGPU */,
220216
C16D60B0E94469E649953EC5 /* ObjectivelyGPU.h */,
217+
CECF83962FEF65FF00CB0CCA /* ObjectivelyGPU.pc.in */,
218+
CECF83952FEF65FF00CB0CCA /* Makefile.am */,
221219
);
222220
path = Sources;
223221
sourceTree = "<group>";
@@ -232,25 +230,17 @@
232230
09B8DD26CDB7926D89445C91 /* ComputePass.h */,
233231
C862954A9DD435C1FF7CD31D /* CopyPass.c */,
234232
59334BDAED542AB6DE565EDD /* CopyPass.h */,
233+
CECF83972FEF6A7200CB0CCA /* Mathlib.h */,
235234
77315F9BC357C97B885E883C /* RenderDevice.c */,
236235
9220C57BBAA3C951D8083799 /* RenderDevice.h */,
237236
669BE73362E651792735CB1C /* RenderPass.c */,
238237
206D63692B601BD90F377BF5 /* RenderPass.h */,
239-
B0DCC202FC0DE3DD6AD6B538 /* Shaders */,
240238
38F069D0DBE26C7E00B5B5EE /* Types.h */,
239+
CECF83942FEF65EB00CB0CCA /* Makefile.am */,
241240
);
242241
path = ObjectivelyGPU;
243242
sourceTree = "<group>";
244243
};
245-
B0DCC202FC0DE3DD6AD6B538 /* Shaders */ = {
246-
isa = PBXGroup;
247-
children = (
248-
FDEE3DD81E43E5CFE68E9519 /* Renderer.frag.hlsl */,
249-
C510361664FA37CEC93731E8 /* Renderer.vert.hlsl */,
250-
);
251-
path = Shaders;
252-
sourceTree = "<group>";
253-
};
254244
B23D89B2D2DF3745A003AEB1 /* Products */ = {
255245
isa = PBXGroup;
256246
children = (
@@ -273,11 +263,19 @@
273263
name = Frameworks;
274264
sourceTree = "<group>";
275265
};
266+
DOC00030000000000000001 /* Documentation */ = {
267+
isa = PBXGroup;
268+
children = (
269+
DOC00010000000000000001 /* index.md */,
270+
);
271+
path = Documentation;
272+
sourceTree = "<group>";
273+
};
276274
EE00200000000000000000B1 /* Examples */ = {
277275
isa = PBXGroup;
278276
children = (
279-
SC00500000000000000000A0 /* Shaders */,
280277
EI00E00000000000000000B1 /* Hello-iOS */,
278+
SC00500000000000000000A0 /* Shaders */,
281279
EE00010000000000000000B1 /* Hello.c */,
282280
EE00020000000000000000B2 /* HelloCompute.c */,
283281
);
@@ -302,6 +300,7 @@
302300
SC00800000000000000000A0 /* HelloCompute.comp.hlsl */,
303301
SC00900000000000000000A0 /* HelloCompute.vert.hlsl */,
304302
SC00A00000000000000000A0 /* HelloCompute.frag.hlsl */,
303+
CECF83912FEF634300CB0CCA /* Makefile.am */,
305304
);
306305
path = Shaders;
307306
sourceTree = "<group>";
@@ -317,6 +316,7 @@
317316
2A17F0E01E5CC25A431FFBAD /* CommandBuffer.h in Headers */,
318317
034285033FECAB2D6BD6AE5B /* ComputePass.h in Headers */,
319318
DF73824CC25298378B451056 /* CopyPass.h in Headers */,
319+
CECF83982FEF6A7200CB0CCA /* Mathlib.h in Headers */,
320320
A09AD953AC672E0DE9D1E26D /* ObjectivelyGPU.h in Headers */,
321321
59897FC7BCC194032E971A9B /* RenderDevice.h in Headers */,
322322
683F683E23149C267D613EA0 /* RenderPass.h in Headers */,
@@ -477,31 +477,31 @@
477477
inputFileListPaths = (
478478
);
479479
inputPaths = (
480-
"$(SRCROOT)/Examples/Shaders/Hello.vert.hlsl",
481-
"$(SRCROOT)/Examples/Shaders/Hello.frag.hlsl",
482-
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.hlsl",
483-
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.hlsl",
484-
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.hlsl",
480+
"$(SRCROOT)/Examples/Shaders/Hello.vert.hlsl",
481+
"$(SRCROOT)/Examples/Shaders/Hello.frag.hlsl",
482+
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.hlsl",
483+
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.hlsl",
484+
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.hlsl",
485485
);
486486
name = "Compile Shaders";
487487
outputFileListPaths = (
488488
);
489489
outputPaths = (
490-
"$(SRCROOT)/Examples/Shaders/Hello.vert.msl",
491-
"$(SRCROOT)/Examples/Shaders/Hello.vert.spv",
492-
"$(SRCROOT)/Examples/Shaders/Hello.vert.dxil",
493-
"$(SRCROOT)/Examples/Shaders/Hello.frag.msl",
494-
"$(SRCROOT)/Examples/Shaders/Hello.frag.spv",
495-
"$(SRCROOT)/Examples/Shaders/Hello.frag.dxil",
496-
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.msl",
497-
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.spv",
498-
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.dxil",
499-
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.msl",
500-
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.spv",
501-
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.dxil",
502-
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.msl",
503-
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.spv",
504-
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.dxil",
490+
"$(SRCROOT)/Examples/Shaders/Hello.vert.msl",
491+
"$(SRCROOT)/Examples/Shaders/Hello.vert.spv",
492+
"$(SRCROOT)/Examples/Shaders/Hello.vert.dxil",
493+
"$(SRCROOT)/Examples/Shaders/Hello.frag.msl",
494+
"$(SRCROOT)/Examples/Shaders/Hello.frag.spv",
495+
"$(SRCROOT)/Examples/Shaders/Hello.frag.dxil",
496+
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.msl",
497+
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.spv",
498+
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.dxil",
499+
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.msl",
500+
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.spv",
501+
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.dxil",
502+
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.msl",
503+
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.spv",
504+
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.dxil",
505505
);
506506
runOnlyForDeploymentPostprocessing = 0;
507507
shellPath = /bin/sh;

Sources/ObjectivelyGPU.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323

2424
#pragma once
2525

26-
#include <math.h>
27-
2826
#include <ObjectivelyGPU/CommandBuffer.h>
2927
#include <ObjectivelyGPU/ComputePass.h>
3028
#include <ObjectivelyGPU/CopyPass.h>
31-
#include <ObjectivelyGPU/Math.h>
29+
#include <ObjectivelyGPU/Mathlib.h>
3230
#include <ObjectivelyGPU/RenderDevice.h>
3331
#include <ObjectivelyGPU/RenderPass.h>

Sources/ObjectivelyGPU/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pkginclude_HEADERS = \
1010
CommandBuffer.h \
1111
ComputePass.h \
1212
CopyPass.h \
13-
Math.h \
13+
Mathlib.h \
1414
RenderDevice.h \
1515
RenderPass.h \
1616
Types.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#pragma once
2525

26+
#include <math.h>
2627
#include <stdbool.h>
2728
#include <string.h>
2829

Sources/ObjectivelyGPU/Shaders/Renderer.frag.hlsl

Lines changed: 0 additions & 26 deletions
This file was deleted.

Sources/ObjectivelyGPU/Shaders/Renderer.vert.hlsl

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)