Hash :
3b65b803
Author :
Date :
2022-04-27T11:04:22
Vulkan: Work around Qualcomm imprecision with dithering On qualcomm, sometimes the output is ceil()ed instead of round()ed. With ditering emulation affecting values, some dEQP tests fail due to the excessive change in value when dithering bumps the value slightly over to the next quantum. In this change, a workaround is added to round() the value before outputting it. Bug: angleproject:6953 Change-Id: Iae7df5ca20055b4db3185c6153f3c0bf4ba07f68 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3611064 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
//
// Copyright 2022 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.
//
// EmulateDithering: Adds dithering code to fragment shader outputs based on a specialization
// constant control value.
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_VULKAN_EMULATEDITHERING_H_
#define COMPILER_TRANSLATOR_TREEOPS_VULKAN_EMULATEDITHERING_H_
#include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TSymbolTable;
class SpecConst;
class DriverUniform;
ANGLE_NO_DISCARD bool EmulateDithering(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermBlock *root,
TSymbolTable *symbolTable,
SpecConst *specConst,
DriverUniform *driverUniforms);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_VULKAN_EMULATEDITHERING_H_