Rename AdapterGL -> PhysicalDeviceGL.
Bug: dawn:1774 Change-Id: Ic137524027eb519af4cb46396b9a8cea9e4cb7f4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/130420 Reviewed-by: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
parent
556147c333
commit
8076b2ad73
|
@ -620,8 +620,6 @@ source_set("sources") {
|
|||
]
|
||||
sources += get_target_outputs(":opengl_loader_gen")
|
||||
sources += [
|
||||
"opengl/AdapterGL.cpp",
|
||||
"opengl/AdapterGL.h",
|
||||
"opengl/BackendGL.cpp",
|
||||
"opengl/BackendGL.h",
|
||||
"opengl/BindGroupGL.cpp",
|
||||
|
@ -649,6 +647,8 @@ source_set("sources") {
|
|||
"opengl/OpenGLVersion.h",
|
||||
"opengl/PersistentPipelineStateGL.cpp",
|
||||
"opengl/PersistentPipelineStateGL.h",
|
||||
"opengl/PhysicalDeviceGL.cpp",
|
||||
"opengl/PhysicalDeviceGL.h",
|
||||
"opengl/PipelineGL.cpp",
|
||||
"opengl/PipelineGL.h",
|
||||
"opengl/PipelineLayoutGL.cpp",
|
||||
|
|
|
@ -488,8 +488,6 @@ if (DAWN_ENABLE_OPENGL)
|
|||
target_sources(dawn_native PRIVATE
|
||||
"${DAWN_INCLUDE_DIR}/dawn/native/OpenGLBackend.h"
|
||||
${DAWN_NATIVE_OPENGL_AUTOGEN_SOURCES}
|
||||
"opengl/AdapterGL.cpp"
|
||||
"opengl/AdapterGL.h"
|
||||
"opengl/BackendGL.cpp"
|
||||
"opengl/BackendGL.h"
|
||||
"opengl/BindGroupGL.cpp"
|
||||
|
@ -517,6 +515,8 @@ if (DAWN_ENABLE_OPENGL)
|
|||
"opengl/OpenGLVersion.h"
|
||||
"opengl/PersistentPipelineStateGL.cpp"
|
||||
"opengl/PersistentPipelineStateGL.h"
|
||||
"opengl/PhysicalDeviceGL.cpp"
|
||||
"opengl/PhysicalDeviceGL.h"
|
||||
"opengl/PipelineGL.cpp"
|
||||
"opengl/PipelineGL.h"
|
||||
"opengl/PipelineLayoutGL.cpp"
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include "dawn/common/SystemUtils.h"
|
||||
#include "dawn/native/Instance.h"
|
||||
#include "dawn/native/OpenGLBackend.h"
|
||||
#include "dawn/native/opengl/AdapterGL.h"
|
||||
#include "dawn/native/opengl/ContextEGL.h"
|
||||
#include "dawn/native/opengl/EGLFunctions.h"
|
||||
#include "dawn/native/opengl/PhysicalDeviceGL.h"
|
||||
|
||||
namespace dawn::native::opengl {
|
||||
|
||||
|
@ -97,7 +97,7 @@ ResultOrError<std::vector<Ref<PhysicalDeviceBase>>> Backend::DiscoverAdapters(
|
|||
|
||||
DAWN_INVALID_IF(options->getProc == nullptr, "AdapterDiscoveryOptions::getProc must be set");
|
||||
|
||||
Ref<Adapter> adapter = AcquireRef(new Adapter(
|
||||
Ref<PhysicalDevice> adapter = AcquireRef(new PhysicalDevice(
|
||||
GetInstance(), static_cast<wgpu::BackendType>(optionsBase->backendType), adapterToggles));
|
||||
DAWN_TRY(adapter->InitializeGLFunctions(options->getProc));
|
||||
DAWN_TRY(adapter->Initialize());
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
namespace dawn::native::opengl {
|
||||
|
||||
class Adapter;
|
||||
class BindGroup;
|
||||
class BindGroupLayout;
|
||||
class Buffer;
|
||||
|
@ -27,6 +26,7 @@ class CommandBuffer;
|
|||
class ComputePipeline;
|
||||
class Device;
|
||||
class PersistentPipelineState;
|
||||
class PhysicalDevice;
|
||||
class PipelineLayout;
|
||||
class QuerySet;
|
||||
class Queue;
|
||||
|
@ -38,7 +38,7 @@ class Texture;
|
|||
class TextureView;
|
||||
|
||||
struct OpenGLBackendTraits {
|
||||
using AdapterType = Adapter;
|
||||
using PhysicalDeviceType = PhysicalDevice;
|
||||
using BindGroupType = BindGroup;
|
||||
using BindGroupLayoutType = BindGroupLayout;
|
||||
using BufferType = Buffer;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "dawn/native/opengl/AdapterGL.h"
|
||||
#include "dawn/native/opengl/PhysicalDeviceGL.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
@ -53,23 +53,23 @@ uint32_t GetVendorIdFromVendors(const char* vendor) {
|
|||
|
||||
} // anonymous namespace
|
||||
|
||||
Adapter::Adapter(InstanceBase* instance,
|
||||
wgpu::BackendType backendType,
|
||||
const TogglesState& adapterToggle)
|
||||
PhysicalDevice::PhysicalDevice(InstanceBase* instance,
|
||||
wgpu::BackendType backendType,
|
||||
const TogglesState& adapterToggle)
|
||||
: PhysicalDeviceBase(instance, backendType, adapterToggle) {}
|
||||
|
||||
MaybeError Adapter::InitializeGLFunctions(void* (*getProc)(const char*)) {
|
||||
MaybeError PhysicalDevice::InitializeGLFunctions(void* (*getProc)(const char*)) {
|
||||
// Use getProc to populate the dispatch table
|
||||
mEGLFunctions.Init(getProc);
|
||||
return mFunctions.Initialize(getProc);
|
||||
}
|
||||
|
||||
bool Adapter::SupportsExternalImages() const {
|
||||
bool PhysicalDevice::SupportsExternalImages() const {
|
||||
// Via dawn::native::opengl::WrapExternalEGLImage
|
||||
return GetBackendType() == wgpu::BackendType::OpenGLES;
|
||||
}
|
||||
|
||||
MaybeError Adapter::InitializeImpl() {
|
||||
MaybeError PhysicalDevice::InitializeImpl() {
|
||||
if (mFunctions.GetVersion().IsES()) {
|
||||
ASSERT(GetBackendType() == wgpu::BackendType::OpenGLES);
|
||||
} else {
|
||||
|
@ -92,7 +92,7 @@ MaybeError Adapter::InitializeImpl() {
|
|||
return {};
|
||||
}
|
||||
|
||||
void Adapter::InitializeSupportedFeaturesImpl() {
|
||||
void PhysicalDevice::InitializeSupportedFeaturesImpl() {
|
||||
// TextureCompressionBC
|
||||
{
|
||||
// BC1, BC2 and BC3 are not supported in OpenGL or OpenGL ES core features.
|
||||
|
@ -149,12 +149,12 @@ void Adapter::InitializeSupportedFeaturesImpl() {
|
|||
}
|
||||
}
|
||||
|
||||
MaybeError Adapter::InitializeSupportedLimitsImpl(CombinedLimits* limits) {
|
||||
MaybeError PhysicalDevice::InitializeSupportedLimitsImpl(CombinedLimits* limits) {
|
||||
GetDefaultLimits(&limits->v1);
|
||||
return {};
|
||||
}
|
||||
|
||||
void Adapter::SetupBackendDeviceToggles(TogglesState* deviceToggles) const {
|
||||
void PhysicalDevice::SetupBackendDeviceToggles(TogglesState* deviceToggles) const {
|
||||
const OpenGLFunctions& gl = mFunctions;
|
||||
|
||||
bool supportsBaseVertex = gl.IsAtLeastGLES(3, 2) || gl.IsAtLeastGL(3, 2);
|
||||
|
@ -217,8 +217,8 @@ void Adapter::SetupBackendDeviceToggles(TogglesState* deviceToggles) const {
|
|||
gl.GetVersion().IsES());
|
||||
}
|
||||
|
||||
ResultOrError<Ref<DeviceBase>> Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor,
|
||||
const TogglesState& deviceToggles) {
|
||||
ResultOrError<Ref<DeviceBase>> PhysicalDevice::CreateDeviceImpl(const DeviceDescriptor* descriptor,
|
||||
const TogglesState& deviceToggles) {
|
||||
EGLenum api =
|
||||
GetBackendType() == wgpu::BackendType::OpenGL ? EGL_OPENGL_API : EGL_OPENGL_ES_API;
|
||||
std::unique_ptr<Device::Context> context;
|
||||
|
@ -226,8 +226,9 @@ ResultOrError<Ref<DeviceBase>> Adapter::CreateDeviceImpl(const DeviceDescriptor*
|
|||
return Device::Create(this, descriptor, mFunctions, std::move(context), deviceToggles);
|
||||
}
|
||||
|
||||
MaybeError Adapter::ValidateFeatureSupportedWithTogglesImpl(wgpu::FeatureName feature,
|
||||
const TogglesState& toggles) const {
|
||||
MaybeError PhysicalDevice::ValidateFeatureSupportedWithTogglesImpl(
|
||||
wgpu::FeatureName feature,
|
||||
const TogglesState& toggles) const {
|
||||
return {};
|
||||
}
|
||||
} // namespace dawn::native::opengl
|
|
@ -12,8 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef SRC_DAWN_NATIVE_OPENGL_ADAPTERGL_H_
|
||||
#define SRC_DAWN_NATIVE_OPENGL_ADAPTERGL_H_
|
||||
#ifndef SRC_DAWN_NATIVE_OPENGL_PHYSICALDEVICEGL_H_
|
||||
#define SRC_DAWN_NATIVE_OPENGL_PHYSICALDEVICEGL_H_
|
||||
|
||||
#include "dawn/native/PhysicalDevice.h"
|
||||
#include "dawn/native/opengl/EGLFunctions.h"
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
namespace dawn::native::opengl {
|
||||
|
||||
class Adapter : public PhysicalDeviceBase {
|
||||
class PhysicalDevice : public PhysicalDeviceBase {
|
||||
public:
|
||||
Adapter(InstanceBase* instance,
|
||||
wgpu::BackendType backendType,
|
||||
const TogglesState& adapterToggle);
|
||||
PhysicalDevice(InstanceBase* instance,
|
||||
wgpu::BackendType backendType,
|
||||
const TogglesState& adapterToggle);
|
||||
|
||||
MaybeError InitializeGLFunctions(void* (*getProc)(const char*));
|
||||
|
||||
~Adapter() override = default;
|
||||
~PhysicalDevice() override = default;
|
||||
|
||||
// PhysicalDeviceBase Implementation
|
||||
bool SupportsExternalImages() const override;
|
||||
|
@ -52,4 +52,4 @@ class Adapter : public PhysicalDeviceBase {
|
|||
|
||||
} // namespace dawn::native::opengl
|
||||
|
||||
#endif // SRC_DAWN_NATIVE_OPENGL_ADAPTERGL_H_
|
||||
#endif // SRC_DAWN_NATIVE_OPENGL_PHYSICALDEVICEGL_H_
|
Loading…
Reference in New Issue