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.
This commit is contained in:
Shotaro Uchida 2020-02-25 22:57:25 -08:00 committed by GitHub
parent f10bcfeabf
commit 219e7d0c20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ NSString* g_shadersSrc = @
"float4 position [[position]];\n" "float4 position [[position]];\n"
"};\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" "{\n"
"VertexOutput out;\n" "VertexOutput out;\n"