mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Add support for DirectX HLSL / FX files. The FX files are just HLSL files with some additional syntax to set render-states and define multiple shader stages in one file. Samples are either written by me, or taken from Chromium.
28 lines
745 B
HLSL
28 lines
745 B
HLSL
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// To compile these two shaders:
|
|
// fxc /E pixelMain /T ps_2_0 accelerated_surface_win.hlsl
|
|
// fxc /E vertexMain /T vs_2_0 accelerated_surface_win.hlsl
|
|
//
|
|
// fxc is in the DirectX SDK.
|
|
|
|
struct Vertex {
|
|
float4 position : POSITION;
|
|
float2 texCoord : TEXCOORD0;
|
|
};
|
|
|
|
texture t;
|
|
sampler s;
|
|
|
|
// Passes a position and texture coordinate to the pixel shader.
|
|
Vertex vertexMain(Vertex input) {
|
|
return input;
|
|
};
|
|
|
|
// Samples a texture at the given texture coordinate and returns the result.
|
|
float4 pixelMain(float2 texCoord : TEXCOORD0) : COLOR0 {
|
|
return tex2D(s, texCoord);
|
|
};
|