Hash :
c0c938af
Author :
Date :
2020-05-11T00:50:00
Metal: draw 1 triangle instead of 2 for fullscreen shaders. Reference article in favour of one big triangle instead of 2: https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/ According to this article, the performance could be increased by ~10% for fullscreen shaders. Bug: angleproject:2634 Change-Id: Ia5b04c40f0587e3cb8680c0f30f7b68d9d7a3efe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2193192 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
//
// Copyright 2019 The ANGLE Project. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// common.h: Common header for other metal source code.
#ifndef LIBANGLE_RENDERER_METAL_SHADERS_COMMON_H_
#define LIBANGLE_RENDERER_METAL_SHADERS_COMMON_H_
#ifndef SKIP_STD_HEADERS
# include <simd/simd.h>
# include <metal_stdlib>
#endif
#define ANGLE_KERNEL_GUARD(IDX, MAX_COUNT) \
if (IDX >= MAX_COUNT) \
{ \
return; \
}
using namespace metal;
// Full screen triangle's vertices
constant float2 gCorners[3] = {float2(-1.0f, -1.0f), float2(3.0f, -1.0f), float2(-1.0f, 3.0f)};
fragment float4 dummyFS()
{
return float4(0, 0, 0, 0);
}
#endif /* LIBANGLE_RENDERER_METAL_SHADERS_COMMON_H_ */