Hash :
5b314268
Author :
Date :
2021-06-15T17:37:45
Vulkan: Support OVR_multiview and OVR_multiview2 Multiview is supported in Vulkan simply by specifying the number of views in the render pass, and creating the appropriate image views. A number of changes to the way image views and render targets are stored are made to support those that don't cover the entire range of layers. One particular detail that is not implemented in this change is the use of queries in combination with multiview. Vulkan specifies that N queries are actually produced (N being the number of views) which must be summed by the application, but this is not currently done. Bug: angleproject:6048 Change-Id: I1d4a9894c232d3a93d7a97c9fa0eedc334e57469 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2967625 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
//
// Copyright 2016 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.
//
// TranslatorVulkan:
// A GLSL-based translator that outputs shaders that fit GL_KHR_vulkan_glsl and feeds them into
// glslang to spit out SPIR-V.
// See: https://www.khronos.org/registry/vulkan/specs/misc/GL_KHR_vulkan_glsl.txt
//
#ifndef COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#define COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#include "compiler/translator/Compiler.h"
namespace sh
{
class TOutputVulkanGLSL;
class SpecConst;
class DriverUniform;
class TranslatorVulkan : public TCompiler
{
public:
TranslatorVulkan(sh::GLenum type, ShShaderSpec spec);
protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
// Subclass can call this method to transform the AST before writing the final output.
// See TranslatorMetal.cpp.
ANGLE_NO_DISCARD bool translateImpl(TInfoSinkBase &sink,
TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics,
SpecConst *specConst,
DriverUniform *driverUniforms);
void writeExtensionBehavior(ShCompileOptions compileOptions, TInfoSinkBase &sink);
// Give subclass such as TranslatorMetal a chance to do depth transform before
// TranslatorVulkan apply its own transform.
ANGLE_NO_DISCARD virtual bool transformDepthBeforeCorrection(
TIntermBlock *root,
const DriverUniform *driverUniforms)
{
return true;
}
// Generate SPIR-V out of intermediate GLSL through glslang.
ANGLE_NO_DISCARD bool compileToSpirv(const TInfoSinkBase &glsl);
};
} // namespace sh
#endif // COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_