Hash :
9ff063e9
Author :
Date :
2020-10-25T03:08:25
Metal: fix max varyings, copyImage between mips, depth fmt - GLSLTest_ES3.MaxVaryingWithFeedbackAndGLline failed before because gl_Position takes up one slot from max varyings on Metal back-end. FIXED - Previously, copyImage() between mips of the same texture would fail. Due to the read RenderTargetMtl is released before the copy happens. FIXED - GL_DEPTH_COMPONENT24 texture data upload didn't work due to the source 32 bit depth data wasn't handled properly. FIXED - D24S8 format will be disabled on AMD for now, it will be converted to D32S8 instead. Bug: angleproject:2634 Bug: angleproject:5235 Bug: angleproject:5242 Change-Id: Ie7082f0545c0885ce5ec72df8a7ec4ee5d5de4b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494525 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@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 62 63 64 65 66 67
//
// 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.
//
// RenderTargetMtl.h:
// Defines the class interface for RenderTargetMtl.
//
#ifndef LIBANGLE_RENDERER_METAL_RENDERTARGETMTL_H_
#define LIBANGLE_RENDERER_METAL_RENDERTARGETMTL_H_
#import <Metal/Metal.h>
#include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/renderer/metal/mtl_format_utils.h"
#include "libANGLE/renderer/metal/mtl_resources.h"
#include "libANGLE/renderer/metal/mtl_state_cache.h"
namespace rx
{
// This is a very light-weight class that does not own to the resources it points to.
// It's meant only to copy across some information from a FramebufferAttachment to the
// business rendering logic.
class RenderTargetMtl final : public FramebufferAttachmentRenderTarget
{
public:
RenderTargetMtl();
~RenderTargetMtl() override;
// Used in std::vector initialization.
RenderTargetMtl(RenderTargetMtl &&other);
void set(const mtl::TextureRef &texture,
const mtl::MipmapNativeLevel &level,
uint32_t layer,
const mtl::Format &format);
void setWithImplicitMSTexture(const mtl::TextureRef &texture,
const mtl::TextureRef &implicitMSTexture,
const mtl::MipmapNativeLevel &level,
uint32_t layer,
const mtl::Format &format);
void setTexture(const mtl::TextureRef &texture);
void setImplicitMSTexture(const mtl::TextureRef &implicitMSTexture);
void duplicateFrom(const RenderTargetMtl &src);
void reset();
mtl::TextureRef getTexture() const { return mTexture.lock(); }
mtl::TextureRef getImplicitMSTexture() const { return mImplicitMSTexture.lock(); }
const mtl::MipmapNativeLevel &getLevelIndex() const { return mLevelIndex; }
uint32_t getLayerIndex() const { return mLayerIndex; }
uint32_t getRenderSamples() const;
const mtl::Format *getFormat() const { return mFormat; }
void toRenderPassAttachmentDesc(mtl::RenderPassAttachmentDesc *rpaDescOut) const;
private:
mtl::TextureWeakRef mTexture;
mtl::TextureWeakRef mImplicitMSTexture;
mtl::MipmapNativeLevel mLevelIndex = mtl::kZeroNativeMipLevel;
uint32_t mLayerIndex = 0;
const mtl::Format *mFormat = nullptr;
};
} // namespace rx
#endif /* LIBANGLE_RENDERER_METAL_RENDERTARGETMTL_H */