Hash :
83a369bb
Author :
Date :
2019-08-14T10:39:34
Vulkan: Improve cubemap emulation seam handling Changes seamful cubemap emulation to always compute the derivative, emulating the bias parameter by scaling the provided derivatives. This results in more accurate mipmap levels for seams within primitives. There are some artifacts as a result of how derivatives are calculated, but this matches the native driver. Bug: angleproject:3243 Bug: angleproject:3732 Change-Id: Icb976e2a7e14cb4210645571edc037d4e607bd0d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754383 Commit-Queue: James Dong <dongja@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@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 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.
//
// ShaderVk.cpp:
// Implements the class methods for ShaderVk.
//
#include "libANGLE/renderer/vulkan/ShaderVk.h"
#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "platform/FeaturesVk.h"
namespace rx
{
ShaderVk::ShaderVk(const gl::ShaderState &data) : ShaderImpl(data) {}
ShaderVk::~ShaderVk() {}
std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *context,
gl::ShCompilerInstance *compilerInstance,
ShCompileOptions options)
{
ShCompileOptions compileOptions = SH_INITIALIZE_UNINITIALIZED_LOCALS;
ContextVk *contextVk = vk::GetImpl(context);
bool isWebGL = context->getExtensions().webglCompatibility;
if (isWebGL && mData.getShaderType() != gl::ShaderType::Compute)
{
compileOptions |= SH_INIT_OUTPUT_VARIABLES;
}
if (contextVk->getFeatures().clampPointSize.enabled)
{
compileOptions |= SH_CLAMP_POINT_SIZE;
}
if (contextVk->emulateSeamfulCubeMapSampling())
{
compileOptions |= SH_EMULATE_SEAMFUL_CUBE_MAP_SAMPLING;
}
if (contextVk->useOldRewriteStructSamplers())
{
compileOptions |= SH_USE_OLD_REWRITE_STRUCT_SAMPLERS;
}
return compileImpl(context, compilerInstance, mData.getSource(), compileOptions | options);
}
std::string ShaderVk::getDebugInfo() const
{
return mData.getTranslatedSource();
}
} // namespace rx