Hash :
a4f706b2
Author :
Date :
2020-08-04T12:08:00
Metal: Use compute to generate 3D texture's mipmap. - Metal's built-in blit based mipmap generator doesn't use box filtering. Hence manual generation using compute is needed. - Compute based mipmap gen can generate up to 4 mips per pass if the base level is power of 2. - This approach can be extended to 2D/cube texture's mipmap generation in future. Bug: angleproject:4921 Bug: angleproject:2634 Change-Id: I7f997669fe39afef075b2bca2406e9424cbb3016 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2336120 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
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 62 63 64 65 66 67 68 69 70
//
// Copyright 2019 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.
//
// FeaturesMtl.h: Optional features for the Metal renderer.
//
#ifndef ANGLE_PLATFORM_FEATURESMTL_H_
#define ANGLE_PLATFORM_FEATURESMTL_H_
#include "platform/Feature.h"
namespace angle
{
struct FeaturesMtl : FeatureSetBase
{
// BaseVertex/Instanced draw support:
Feature hasBaseVertexInstancedDraw = {
"has_base_vertex_instanced_draw", FeatureCategory::MetalFeatures,
"The renderer supports base vertex instanced draw", &members};
// Support depth texture filtering
Feature hasDepthTextureFiltering = {
"has_depth_texture_filtering", FeatureCategory::MetalFeatures,
"The renderer supports depth texture's filtering other than nearest", &members};
// Non-uniform compute shader dispatch support, i.e. Group size is not necessarily to be fixed:
Feature hasNonUniformDispatch = {
"has_non_uniform_dispatch", FeatureCategory::MetalFeatures,
"The renderer supports non uniform compute shader dispatch's group size", &members};
// fragment stencil output support
Feature hasStencilOutput = {"has_shader_stencil_output", FeatureCategory::MetalFeatures,
"The renderer supports stencil output from fragment shader",
&members};
// Texture swizzle support:
Feature hasTextureSwizzle = {"has_texture_swizzle", FeatureCategory::MetalFeatures,
"The renderer supports texture swizzle", &members};
Feature hasDepthAutoResolve = {
"has_msaa_depth_auto_resolve", FeatureCategory::MetalFeatures,
"The renderer supports MSAA depth auto resolve at the end of render pass", &members};
Feature hasStencilAutoResolve = {
"has_msaa_stencil_auto_resolve", FeatureCategory::MetalFeatures,
"The renderer supports MSAA stencil auto resolve at the end of render pass", &members};
// On macos, separate depth & stencil buffers are not supproted. However, on iOS devices,
// they are supproted:
Feature allowSeparatedDepthStencilBuffers = {
"allow_separate_depth_stencil_buffers", FeatureCategory::MetalFeatures,
"Some Apple platforms such as iOS allows separate depth & stencil buffers, "
"whereas others such as macOS don't",
&members};
Feature allowMultisampleStoreAndResolve = {
"allow_msaa_store_and_resolve", FeatureCategory::MetalFeatures,
"The renderer supports MSAA store and resolve in the same pass", &members};
Feature allowGenMultipleMipsPerPass = {
"gen_multiple_mips_per_pass", FeatureCategory::MetalFeatures,
"The renderer supports generating multiple mipmaps per pass", &members};
};
} // namespace angle
#endif // ANGLE_PLATFORM_FEATURESMTL_H_