blob: 8da7501fee1c0b43017f94f776f164a58d9ca47d [file] [log] [blame]
// Copyright (C) 2016 The Android Open Source Project
//
// 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.
package vertex
import "android.googlesource.com/platform/tools/gpu/framework/binary"
// Semantic is metadata describing the intended use of a vertex stream by shader
// programs.
//
// Semantics are exclusively used by some graphics APIs as the key for binding
// vertex streams to shader inputs.
//
// For graphics APIs that do not have the concept of Semantics, then a
// suitable Semantic may be inferred from the vertex stream and corresponding
// shader programs.
type Semantic struct {
binary.Generate
// Type is used to categorize the stream data. The type is only a usage hint,
// the shader is free to interpret the data in any way it likes.
Type SemanticType
// Index is used to uniquely identify vertex streams with the same semantic
// type. For example, blend shapes may use N streams of positions and normals
// to blend between.
Index uint8
}