mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Add BlendState to NXT API
This commit is contained in:
26
src/backend/opengl/BlendStateGL.cpp
Normal file
26
src/backend/opengl/BlendStateGL.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2017 The NXT Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "backend/opengl/BlendStateGL.h"
|
||||
|
||||
#include "backend/opengl/OpenGLBackend.h"
|
||||
|
||||
namespace backend {
|
||||
namespace opengl {
|
||||
|
||||
BlendState::BlendState(BlendStateBuilder* builder) : BlendStateBase(builder) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
31
src/backend/opengl/BlendStateGL.h
Normal file
31
src/backend/opengl/BlendStateGL.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2017 The NXT Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef BACKEND_OPENGL_BLENDSTATED3D12_H_
|
||||
#define BACKEND_OPENGL_BLENDSTATED3D12_H_
|
||||
|
||||
#include "backend/BlendState.h"
|
||||
|
||||
namespace backend {
|
||||
namespace opengl {
|
||||
|
||||
class BlendState : public BlendStateBase {
|
||||
public:
|
||||
BlendState(BlendStateBuilder* builder);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BACKEND_OPENGL_BLENDSTATED3D12_H_
|
||||
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "backend/opengl/OpenGLBackend.h"
|
||||
#include "backend/opengl/BlendStateGL.h"
|
||||
#include "backend/opengl/BufferGL.h"
|
||||
#include "backend/opengl/CommandBufferGL.h"
|
||||
#include "backend/opengl/ComputePipelineGL.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "backend/opengl/OpenGLBackend.h"
|
||||
|
||||
#include "backend/opengl/BlendStateGL.h"
|
||||
#include "backend/opengl/BufferGL.h"
|
||||
#include "backend/opengl/CommandBufferGL.h"
|
||||
#include "backend/opengl/ComputePipelineGL.h"
|
||||
@@ -49,6 +50,9 @@ namespace opengl {
|
||||
BindGroupLayoutBase* Device::CreateBindGroupLayout(BindGroupLayoutBuilder* builder) {
|
||||
return new BindGroupLayout(builder);
|
||||
}
|
||||
BlendStateBase* Device::CreateBlendState(BlendStateBuilder* builder) {
|
||||
return new BlendState(builder);
|
||||
}
|
||||
BufferBase* Device::CreateBuffer(BufferBuilder* builder) {
|
||||
return new Buffer(builder);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "nxt/nxtcpp.h"
|
||||
|
||||
#include "backend/Buffer.h"
|
||||
#include "backend/BlendState.h"
|
||||
#include "backend/BindGroup.h"
|
||||
#include "backend/BindGroupLayout.h"
|
||||
#include "backend/Device.h"
|
||||
@@ -35,6 +36,7 @@ namespace opengl {
|
||||
|
||||
class BindGroup;
|
||||
class BindGroupLayout;
|
||||
class BlendState;
|
||||
class Buffer;
|
||||
class BufferView;
|
||||
class CommandBuffer;
|
||||
@@ -57,6 +59,7 @@ namespace opengl {
|
||||
struct OpenGLBackendTraits {
|
||||
using BindGroupType = BindGroup;
|
||||
using BindGroupLayoutType = BindGroupLayout;
|
||||
using BlendStateType = BlendState;
|
||||
using BufferType = Buffer;
|
||||
using BufferViewType = BufferView;
|
||||
using CommandBufferType = CommandBuffer;
|
||||
@@ -86,6 +89,7 @@ namespace opengl {
|
||||
public:
|
||||
BindGroupBase* CreateBindGroup(BindGroupBuilder* builder) override;
|
||||
BindGroupLayoutBase* CreateBindGroupLayout(BindGroupLayoutBuilder* builder) override;
|
||||
BlendStateBase* CreateBlendState(BlendStateBuilder* builder) override;
|
||||
BufferBase* CreateBuffer(BufferBuilder* builder) override;
|
||||
BufferViewBase* CreateBufferView(BufferViewBuilder* builder) override;
|
||||
CommandBufferBase* CreateCommandBuffer(CommandBufferBuilder* builder) override;
|
||||
|
||||
Reference in New Issue
Block a user