Hash :
7cf9cd24
Author :
Date :
2018-10-09T15:27:32
Add flags to shader translator to emulate gl_DrawID Adds support for translating gl_DrawID for implementation of GL_ANGLE_multi_draw. Currently the change only supports and allows emulation of the draw id using a uniform variable named `gl_DrawID`. This uniform is mapped in the translated shader to a hashed name that does not use the gl_ namespace Bug: chromium:890539 Change-Id: I08a246ca911e88e733ccdf22f1ed69dcae948e05 Reviewed-on: https://chromium-review.googlesource.com/c/1271957 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// EmulateGLDrawID is an AST traverser to convert the gl_DrawID builtin
// to a uniform int
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_EMULATEGLDRAWID_H_
#define COMPILER_TRANSLATOR_TREEOPS_EMULATEGLDRAWID_H_
#include <GLSLANG/ShaderLang.h>
#include <vector>
#include "compiler/translator/HashNames.h"
namespace sh
{
struct Uniform;
class TIntermBlock;
class TSymbolTable;
void EmulateGLDrawID(TIntermBlock *root,
TSymbolTable *symbolTable,
std::vector<sh::Uniform> *uniforms,
bool shouldCollect);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_EMULATEGLDRAWID_H_