From 219e7d0c20ea162f74e123bba5a856809a9d6ac8 Mon Sep 17 00:00:00 2001 From: Shotaro Uchida Date: Tue, 25 Feb 2020 22:57:25 -0800 Subject: [PATCH] Fix shader warning for macOS Catalina (#30) In Catalina, shader creation will fail because of the following issue: ``` Compilation succeeded with: program_source:22:21: warning: writable resources in non-void vertex function vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], device Vertex *pos [[buffer(0)]]) ^ program_source:22:77: note: writable buffer defined here vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], device Vertex *pos [[buffer(0)]]) ^ ``` Adding const to ensure the buffer is read-only. --- src/macosx/MacMiniFB.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macosx/MacMiniFB.m b/src/macosx/MacMiniFB.m index 3f3c334..933f095 100644 --- a/src/macosx/MacMiniFB.m +++ b/src/macosx/MacMiniFB.m @@ -55,7 +55,7 @@ NSString* g_shadersSrc = @ "float4 position [[position]];\n" "};\n" - "vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], device Vertex *pos [[buffer(0)]])\n" + "vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], const device Vertex *pos [[buffer(0)]])\n" "{\n" "VertexOutput out;\n"