Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings #240

Merged
merged 2 commits into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: ci

on: [pull_request, push]

env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Cdebuginfo=0 --deny=warnings"

jobs:
build:
runs-on: macos-latest
Expand Down
46 changes: 23 additions & 23 deletions examples/reflection/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@
use metal::*;
use objc::rc::autoreleasepool;

const PROGRAM: &'static str = "
#include <metal_stdlib>\n\
const PROGRAM: &'static str = r"
#include <metal_stdlib>

using namespace metal;\n\
using namespace metal;

typedef struct {\n\
float2 position;\n\
float3 color;\n\
} vertex_t;\n\
typedef struct {
float2 position;
float3 color;
} vertex_t;

struct ColorInOut {\n\
float4 position [[position]];\n\
float4 color;\n\
};\n\
struct ColorInOut {
float4 position [[position]];
float4 color;
};

vertex ColorInOut vs(device vertex_t* vertex_array [[ buffer(0) ]],\n\
unsigned int vid [[ vertex_id ]])\n\
{\n\
ColorInOut out;\n\
vertex ColorInOut vs(device vertex_t* vertex_array [[ buffer(0) ]],
unsigned int vid [[ vertex_id ]])
{
ColorInOut out;

out.position = float4(float2(vertex_array[vid].position), 0.0, 1.0);\n\
out.color = float4(float3(vertex_array[vid].color), 1.0);\n\
out.position = float4(float2(vertex_array[vid].position), 0.0, 1.0);
out.color = float4(float3(vertex_array[vid].color), 1.0);

return out;\n\
}\n\
return out;
}

fragment float4 ps(ColorInOut in [[stage_in]])\n\
{\n\
return in.color;\n\
};\n\
fragment float4 ps(ColorInOut in [[stage_in]])
{
return in.color;
};
";

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/shader-dylib/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use winit::{
use std::mem;

struct App {
pub device: Device,
pub _device: Device,
pub command_queue: CommandQueue,
pub layer: MetalLayer,
pub image_fill_cps: ComputePipelineState,
Expand Down Expand Up @@ -98,7 +98,7 @@ impl App {
.unwrap();

Self {
device,
_device: device,
command_queue,
layer,
image_fill_cps,
Expand Down