Hash :
671f55d8
Author :
Date :
2025-04-03T22:54:44
Vulkan: Fix texelFetch(externalSampler) behavior GLES expects YUV decoding to happen with texelFetch when an external sampler is used, but texelFetch's translation (OpImageFetch) does not do such a thing. A transformation is added to replace that with a texture call at the right coordinate. Bug: angleproject:405149439 Change-Id: I3a8d07a6399705ec07718b38085ee4bc1ad2af6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6431570 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
//
// Copyright 2025 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.
//
// RewriteSamplerExternalTexelFetch: Rewrite texelFetch() for external samplers to texture() so that
// yuv decoding happens according to the sampler.
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_SPIRV_REWRITESAMPLEREXTERNALTEXELFETCH_H_
#define COMPILER_TRANSLATOR_TREEOPS_SPIRV_REWRITESAMPLEREXTERNALTEXELFETCH_H_
#include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TSymbolTable;
[[nodiscard]] bool RewriteSamplerExternalTexelFetch(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_SPIRV_REWRITESAMPLEREXTERNALTEXELFETCH_H_