Hash :
888081d5
        
        Author :
  
        
        Date :
2018-02-27T00:24:46
        
      
D3D11: Refactor dependent Framebuffer state changes. Previously, when a state change would cause a Texture to recreate its storage specific to D3D11, we would use a dependent notification from RenderTarget11 to Framebuffer11 to re-check internal dirty bits. In this new method, we instead set dirty bits on the gl::Frambuffer directly. This also means we use fewer internal objects for these notifications, because we share the same structures between the D3D11 back-end notifications and the top-level notifications we use for Robust init and Framebuffer completeness. This also allows us to get rid of one "if" that we check on every draw call in D3D11. This also introduces a dirty bits guard concept - a shadow set of dirty bits that is checked in dependent state changes to ensure that extra bits aren't set inside syncState. This also implements Framebuffer dirty bits for the D3D9 back-end. This has the side effect of cleaning up the "null colorbuffer" D3D9 workaround. Bug: angleproject:2372 Change-Id: Ie346d39030f4f6df583d735685b0babea4e745a8 Reviewed-on: https://chromium-review.googlesource.com/936691 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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
//
// Copyright (c) 2012-2015 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.
//
// RenderTargetD3D.h: Defines an abstract wrapper class to manage IDirect3DSurface9
// and ID3D11View objects belonging to renderbuffers and renderable textures.
#ifndef LIBANGLE_RENDERER_D3D_RENDERTARGETD3D_H_
#define LIBANGLE_RENDERER_D3D_RENDERTARGETD3D_H_
#include "common/angleutils.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/FramebufferAttachment.h"
namespace rx
{
class RenderTargetD3D : public FramebufferAttachmentRenderTarget
{
  public:
    RenderTargetD3D();
    ~RenderTargetD3D() override;
    virtual GLsizei getWidth() const = 0;
    virtual GLsizei getHeight() const = 0;
    virtual GLsizei getDepth() const = 0;
    virtual GLenum getInternalFormat() const = 0;
    virtual GLsizei getSamples() const = 0;
    gl::Extents getExtents() const { return gl::Extents(getWidth(), getHeight(), getDepth()); }
    bool isMultisampled() const { return getSamples() > 0; }
    virtual unsigned int getSerial() const;
    static unsigned int issueSerials(unsigned int count);
  private:
    const unsigned int mSerial;
    static unsigned int mCurrentSerial;
};
}
#endif // LIBANGLE_RENDERER_D3D_RENDERTARGETD3D_H_