Hash :
611bbaab
Author :
Date :
2018-12-06T01:59:53
Vulkan: Convert vertex attributes in compute In this commit, VertexArrayVk::convertVertexBuffer() is renamed to VertexArrayVk::convertVertexBufferCpu() to explicitly show it does a CPU readback. A new VertexArrayVk::convertVertexBuffer() function is added that has the same functionality in gpu (with some assumptions, where the CPU fallback is used should those assumptions fail). Currently, the only requirement is that buffer offset/stride are divided by the component size. ConvertVertex.comp is the shader responsible for this conversion, and it implements the functionality in renderer/copyvertex.inc, minus a few functions that are not used in the Vulkan backend. Bug: angleproject:2958, angleproject:3009 Change-Id: I8ec9a5f4672509bcf7b9e352cd27663970ad4653 Reviewed-on: https://chromium-review.googlesource.com/c/1364451 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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
//
// Copyright 2018 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.
//
// FeaturesVk.h: Optional features for the Vulkan renderer.
//
#ifndef ANGLE_PLATFORM_FEATURESVK_H_
#define ANGLE_PLATFORM_FEATURESVK_H_
namespace angle
{
struct FeaturesVk
{
// Line segment rasterization must follow OpenGL rules. This means using an algorithm similar
// to Bresenham's. Vulkan uses a different algorithm. This feature enables the use of pixel
// shader patching to implement OpenGL basic line rasterization rules. This feature will
// normally always be enabled. Exposing it as an option enables performance testing.
bool basicGLLineRasterization = false;
// Flips the viewport to render upside-down. This has the effect to render the same way as
// OpenGL. If this feature gets enabled, we enable the KHR_MAINTENANCE_1 extension to allow
// negative viewports. We inverse rendering to the backbuffer by reversing the height of the
// viewport and increasing Y by the height. So if the viewport was (0,0,width,height), it
// becomes (0, height, width, -height). Unfortunately, when we start doing this, we also need
// to adjust a lot of places since the rendering now happens upside-down. Affected places so
// far:
// -readPixels
// -copyTexImage
// -framebuffer blit
// -generating mipmaps
// -Point sprites tests
// -texStorage
bool flipViewportY = false;
// Add an extra copy region when using vkCmdCopyBuffer as the Windows Intel driver seems
// to have a bug where the last region is ignored.
bool extraCopyBufferRegion = false;
// This flag is added for the sole purpose of end2end tests, to test the correctness
// of various algorithms when a fallback format is used, such as using a packed format to
// emulate a depth- or stencil-only format.
bool forceFallbackFormat = false;
// On some NVIDIA drivers the point size range reported from the API is inconsistent with the
// actual behavior. Clamp the point size to the value from the API to fix this.
// Tracked in http://anglebug.com/2970.
bool clampPointSize = false;
// On some android devices, the memory barrier between the compute shader that converts vertex
// attributes and the vertex shader that reads from it is ineffective. Only known workaround is
// to perform a flush after the conversion. http://anglebug.com/3016
bool flushAfterVertexConversion = false;
};
} // namespace angle
#endif // ANGLE_PLATFORM_FEATURESVK_H_