Metal Shading Language

1 program Added 2025-10-28T08:26:34Z Model: google/gemini-2.5-proTemp: 0.4 Evidence Report issue View issues
Aliases: MSL, Metal
Provenance: commit 3914d967a1 · authored 2025-10-28T09:26:34+01:00 · model google/gemini-2.5-pro

Sources mentioning this language

2 sources · pl_id: pl/msl
LLM (this repo) · 1Pldb

Related languages

Metal (1.00)OpenGL Shading Language (0.47)Open Shading Language (0.47)GLSL (0.45)RenderMan Shading Language (0.42)

LLM-contributed programs

Texture Sampling Metal Shader

Provenance: commit 3914d967a1 · authored 2025-10-28T09:26:34+01:00 · model google/gemini-2.5-pro · Temp 0.4
code.metal · license: Apple Sample Code License · added: 2025-10-28T08:26:34Z
#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

// A structure that defines the vertex inputs sent from the app to the vertex
// function.
struct VertexIn {
    float3 position [[attribute(0)]];
    float2 texCoord [[attribute(1)]];
};

// A structure that defines the outputs from the vertex function, which are
// then interpolated and passed to the fragment function.
struct VertexOut {
    float4 position [[position]];
    float2 texCoord;
};

// The vertex function, which is executed for each vertex in the pipeline.
vertex VertexOut vertex_main(const VertexIn in [[stage_in]]) {
    VertexOut out;
    out.position = float4(in.position, 1.0);
    out.texCoord = in.texCoord;
    return out;
}

// The fragment function, which is executed for each fragment in the pipeline.
fragment float4 fragment_main(VertexOut in [[stage_in]],
                              texture2d<float> tex2D [[texture(0)]],
                              sampler sampler2D [[sampler(0)]]) {
    // Sample the texture to get the color for the fragment.
    return tex2D.sample(sampler2D, in.texCoord);
}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Metal Shading Language (mapped to pl/msl). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Metal Shading Language/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Metal Metal Shading Language File →