Hash :
9d519ab1
Author :
Date :
2019-05-09T23:09:46
Vulkan: Rework layout block storage conversion Previously, a pass over the shader was made, converting shared and packed interface blocks with block storage to std140. This resulted in link success between interface blocks with different storage as they were all translated to std140. With this change, this pass is removed. The link step proceeds with the block storage specifiers as seen by GLES, and only upon Vulkan GLSL shader generation "shared" and "packed" are converted to std140. Bug: angleproject:3199 Change-Id: I069415ab9c9b4e1034bc00f64cd2d9e2d73f5956 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1605262 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> 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 50 51
//
// 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;
}
return compileImpl(context, compilerInstance, mData.getSource(), compileOptions | options);
}
std::string ShaderVk::getDebugInfo() const
{
return mData.getTranslatedSource();
}
} // namespace rx