Commit: 59f09bb2efea630c3fea3d4a8d246d6dcec92b72
Parent: f8fe6b4856965e5098e27e15143617c2950230e1
Author: Randy Palamar
Date: Tue, 12 Nov 2024 10:59:21 -0700
change g_compute_shader_header text to a macro
This way msvc (cl) can parse the header which is needed by
matlab's library loader on windows. msvc can't handle the s8()
macro at all so the main program can't be compiled by it.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/beamformer_parameters.h b/beamformer_parameters.h
@@ -36,7 +36,7 @@ typedef struct {
f32 _pad[1];
} BeamformerParameters;
-static s8 g_compute_shader_header = s8("\
+#define COMPUTE_SHADER_HEADER "\
#version 460 core\n\
\n\
layout(std140, binding = 0) uniform parameters {\n\
@@ -59,4 +59,4 @@ layout(std140, binding = 0) uniform parameters {\n\
float time_offset; /* pulse length correction time [s] */\n\
float off_axis_pos; /* [m] Position on screen normal to beamform in 2D HERCULES */\n\
int beamform_plane; /* Plane to Beamform in 2D HERCULES */\n\
-};\n\n");
+};\n\n"
diff --git a/static.c b/static.c
@@ -183,7 +183,7 @@ static void
reload_shaders(BeamformerCtx *ctx, Arena a)
{
ComputeShaderCtx *csctx = &ctx->csctx;
- s8 header_in_arena = push_s8(&a, g_compute_shader_header);
+ s8 header_in_arena = push_s8(&a, s8(COMPUTE_SHADER_HEADER));
for (u32 i = 0; i < ARRAY_COUNT(csctx->programs); i++) {
if (!compute_shaders[i].path.len)
continue;