Hash :
b96d1955
Author :
Date :
2023-01-20T16:06:34
Implement GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch allows fragment shaders to read gl_LastFragColorARM. The extension is similar to GL_EXT_shader_framebuffer_fetch, but is more limited in its capabilities. GL_ARM_shader_framebuffer_fetch was removed from HasFramebufferFetch() because it acts differently from GL_EXT_shader_framebuffer_fetch in significant enough ways that it should not be included in that single-use function. Tests: FramebufferFetchES31.*_ARM Bug: b/242419750 Bug: angleproject:7882 Change-Id: Id3a25c8ee50ca3e2a4c30a2261f507b0b53511ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4083108 Commit-Queue: Sean Risser <srisser@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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
//
// Copyright 2020 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.
//
// ReplaceForShaderFramebufferFetch.h: Find any references to gl_LastFragData, and replace it with
// ANGLELastFragData.
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_VULKAN_REPLACEFORSHADERFRAMEBUFFERFETCH_H_
#define COMPILER_TRANSLATOR_TREEOPS_VULKAN_REPLACEFORSHADERFRAMEBUFFERFETCH_H_
#include "common/angleutils.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TSymbolTable;
struct ShaderVariable;
enum class FramebufferFetchReplaceTarget
{
LastFragData,
LastFragColor,
};
// Declare the global variable, "ANGLELastFragData", and at the begining of the main function,
// assign a subpassLoad value to it. Then replace every gl_LastFragData/Color to
// "ANGLELastFragData". This is to solve the problem GLSL for Vulkan can't process
// gl_LastFragData/Color variable.
[[nodiscard]] bool ReplaceLastFrag(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
std::vector<ShaderVariable> *uniforms,
FramebufferFetchReplaceTarget target);
// Similar to "ANGLELastFragData", but the difference is the variable for loading a framebuffer
// data. The variable decorated with a inout qualifier will be replaced to the variable decorated
// with a out qualifier. And this variable will be used to load the framebuffer data.
[[nodiscard]] bool ReplaceInOutVariables(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
std::vector<ShaderVariable> *uniforms);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_VULKAN_REPLACEFORSHADERFRAMEBUFFERFETCH_H_