Hash :
be42f20b
Author :
Date :
2024-03-22T05:45:46
Start implementing glClear Currently, because both SurfaceWgpu::getAttachmentRenderTarget() and TextureWgpu::getAttachmentRenderTarget() are unimplemented, there is no actual RenderTargetWgpu in the RenderTargetCache to clear. Bug: angleproject:8582 Change-Id: I9ad33c57d533d81178d7d2a802d35b106ece5848 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388076 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
//
// Copyright 2024 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.
//
// SurfaceWgpu.cpp:
// Implements the class methods for SurfaceWgpu.
//
#include "libANGLE/renderer/wgpu/SurfaceWgpu.h"
#include "common/debug.h"
#include "libANGLE/renderer/wgpu/FramebufferWgpu.h"
namespace rx
{
SurfaceWgpu::SurfaceWgpu(const egl::SurfaceState &surfaceState) : SurfaceImpl(surfaceState) {}
SurfaceWgpu::~SurfaceWgpu() {}
egl::Error SurfaceWgpu::initialize(const egl::Display *display)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::swap(const gl::Context *context)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::postSubBuffer(const gl::Context *context,
EGLint x,
EGLint y,
EGLint width,
EGLint height)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::querySurfacePointerANGLE(EGLint attribute, void **value)
{
UNREACHABLE();
return egl::NoError();
}
egl::Error SurfaceWgpu::bindTexImage(const gl::Context *context,
gl::Texture *texture,
EGLint buffer)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::releaseTexImage(const gl::Context *context, EGLint buffer)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
{
UNIMPLEMENTED();
return egl::EglBadAccess();
}
egl::Error SurfaceWgpu::getMscRate(EGLint *numerator, EGLint *denominator)
{
UNIMPLEMENTED();
return egl::EglBadAccess();
}
void SurfaceWgpu::setSwapInterval(EGLint interval) {}
EGLint SurfaceWgpu::getWidth() const
{
// TODO(geofflang): Read from an actual window?
return 100;
}
EGLint SurfaceWgpu::getHeight() const
{
// TODO(geofflang): Read from an actual window?
return 100;
}
EGLint SurfaceWgpu::isPostSubBufferSupported() const
{
return EGL_TRUE;
}
EGLint SurfaceWgpu::getSwapBehavior() const
{
return EGL_BUFFER_PRESERVED;
}
angle::Result SurfaceWgpu::initializeContents(const gl::Context *context,
GLenum binding,
const gl::ImageIndex &imageIndex)
{
return angle::Result::Continue;
}
egl::Error SurfaceWgpu::attachToFramebuffer(const gl::Context *context,
gl::Framebuffer *framebuffer)
{
return egl::NoError();
}
egl::Error SurfaceWgpu::detachFromFramebuffer(const gl::Context *context,
gl::Framebuffer *framebuffer)
{
return egl::NoError();
}
angle::Result SurfaceWgpu::getAttachmentRenderTarget(const gl::Context *context,
GLenum binding,
const gl::ImageIndex &imageIndex,
GLsizei samples,
FramebufferAttachmentRenderTarget **rtOut)
{
UNIMPLEMENTED();
return angle::Result::Stop;
}
} // namespace rx