From f8088ef0eff2c27789511701f554965db8296459 Mon Sep 17 00:00:00 2001 From: manunio Date: Wed, 30 Nov 2022 06:17:32 +0530 Subject: [PATCH] naga: initial integration (#9025) Hi, [naga](https://github.com/gfx-rs/naga) The shader translation library for the needs of [wgpu](https://github.com/gfx-rs/wgpu). - It has 1 million+ downloads as per [crates.io](https://crates.io/crates/naga). - It is being used by projects like: - [wgpu](https://github.com/gfx-rs/wgpu) - [bevy](https://github.com/bevyengine/bevy) - [gfx](https://github.com/gfx-rs/gfx) Co-authored-by: Navidem --- projects/naga/Dockerfile | 21 +++++++++++++++++++++ projects/naga/build.sh | 21 +++++++++++++++++++++ projects/naga/project.yaml | 10 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 projects/naga/Dockerfile create mode 100755 projects/naga/build.sh create mode 100644 projects/naga/project.yaml diff --git a/projects/naga/Dockerfile b/projects/naga/Dockerfile new file mode 100644 index 000000000..83499a781 --- /dev/null +++ b/projects/naga/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder-rust +RUN apt-get update && apt-get install -y make autoconf automake libtool +RUN git clone --depth 1 https://github.com/gfx-rs/naga naga +WORKDIR naga +COPY build.sh $SRC/ diff --git a/projects/naga/build.sh b/projects/naga/build.sh new file mode 100755 index 000000000..8a13a58e4 --- /dev/null +++ b/projects/naga/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash -eu +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +cargo fuzz build -O +fuzz_release=fuzz/target/x86_64-unknown-linux-gnu/release +cp $fuzz_release/spv_parser $OUT/ +cp $fuzz_release/wgsl_parser $OUT/ diff --git a/projects/naga/project.yaml b/projects/naga/project.yaml new file mode 100644 index 000000000..17374e2d3 --- /dev/null +++ b/projects/naga/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/gfx-rs/naga" +language: rust +main_repo: "https://github.com/gfx-rs/naga" +primary_contact: "jblandy@mozilla.com" +sanitizers: + - address +fuzzing_engines: + - libfuzzer +vendor_ccs: + - maxnair.dev@gmail.com