Files
linguist/samples/HLSL/accelerated_surface_win.hlsl
Erik Faye-Lund 6b001cf861 add support for HLSL/FX
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.
2016-02-19 11:32:46 +01:00

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);
};