Add Chromium-only Blender WebEngine parity work

This commit is contained in:
mes123456
2026-08-12 04:47:48 -04:00
commit 9fd26010f6
18225 changed files with 11622124 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_backend.hh"
#include "gpu_platform_private.hh"
#include "dummy_batch.hh"
#include "dummy_context.hh"
#include "dummy_framebuffer.hh"
#include "dummy_vertex_buffer.hh"
namespace blender::gpu {
class DummyBackend : public GPUBackend {
public:
DummyBackend()
{
GPG.init(GPU_DEVICE_ANY,
GPU_OS_ANY,
GPU_DRIVER_ANY,
GPU_SUPPORT_LEVEL_UNSUPPORTED,
GPU_BACKEND_NONE,
"Unknown",
"",
"",
GPU_ARCHITECTURE_IMR);
}
void init_resources() override {}
void delete_resources() override {}
void compute_dispatch(int /*groups_x_len*/, int /*groups_y_len*/, int /*groups_z_len*/) override
{
}
void compute_dispatch_indirect(StorageBuf * /*indirect_buf*/) override {}
Context *context_alloc(GHOST_IWindow * /*ghost_window*/,
GHOST_IContext * /*ghost_context*/) override
{
return new DummyContext;
}
Batch *batch_alloc() override
{
return new DummyBatch;
}
Fence *fence_alloc() override
{
return nullptr;
}
FrameBuffer *framebuffer_alloc(const char *name) override
{
return new DummyFrameBuffer(name);
}
IndexBuf *indexbuf_alloc() override
{
return nullptr;
}
PixelBuffer *pixelbuf_alloc(size_t /*size*/) override
{
return nullptr;
}
QueryPool *querypool_alloc() override
{
return nullptr;
}
Shader *shader_alloc(const char * /*name*/) override
{
return nullptr;
}
Texture *texture_alloc(const char * /*name*/) override
{
return nullptr;
}
TexturePool *texturepool_alloc() override
{
return nullptr;
}
UniformBuf *uniformbuf_alloc(size_t /*size*/, const char * /*name*/) override
{
return nullptr;
}
StorageBuf *storagebuf_alloc(size_t /*size*/,
GPUUsageType /*usage*/,
const char * /*name*/) override
{
return nullptr;
}
VertBuf *vertbuf_alloc() override
{
return new DummyVertexBuffer;
}
void shader_cache_dir_clear_old() override {}
void render_begin() override {}
void render_end() override {}
void render_step(bool /*force_resource_release*/) override {}
};
} // namespace blender::gpu

View File

@@ -0,0 +1,32 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "GPU_batch.hh"
namespace blender::gpu {
class DummyBatch : public Batch {
public:
void draw(int /*vertex_first*/,
int /*vertex_count*/,
int /*instance_first*/,
int /*instance_count*/) override
{
}
void draw_indirect(StorageBuf * /*indirect_buf*/, intptr_t /*offset*/) override {}
void multi_draw_indirect(StorageBuf * /*indirect_buf*/,
int /*count*/,
intptr_t /*offset*/,
intptr_t /*stride*/) override
{
}
};
} // namespace blender::gpu

View File

@@ -0,0 +1,58 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_context_private.hh"
#include "dummy_framebuffer.hh"
namespace blender::gpu {
class DummyContext : public Context {
public:
DummyContext()
{
back_left = active_fb = new DummyFrameBuffer("DummyFramebuffer");
}
~DummyContext() override
{
free_resources();
}
void activate() override {}
void deactivate() override {}
void begin_frame() override {}
void end_frame() override {}
void flush() override {}
void finish() override {}
void memory_statistics_get(int * /*r_total_mem*/, int * /*r_free_mem*/) override {}
void debug_group_begin(const char * /*unused*/, int /*unused*/) override {}
void debug_group_end() override {}
bool debug_capture_begin(const char * /*title*/) override
{
return false;
}
void debug_capture_end() override {}
void *debug_capture_scope_create(const char * /*name*/) override
{
return nullptr;
}
bool debug_capture_scope_begin(void * /*scope*/) override
{
return false;
}
void debug_capture_scope_end(void * /*scope*/) override {}
void debug_unbind_all_ubo() override {}
void debug_unbind_all_ssbo() override {}
};
} // namespace blender::gpu

View File

@@ -0,0 +1,56 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_framebuffer_private.hh"
namespace blender::gpu {
class DummyFrameBuffer : public FrameBuffer {
public:
DummyFrameBuffer(const char *name) : FrameBuffer(name) {}
void bind(bool /*enabled_srgb*/) override {}
bool check(char /*err_out*/[256]) override
{
return true;
}
void clear(GPUFrameBufferBits /*buffers*/,
const double4 /*clear_color*/,
float /*clear_depth*/,
uint /*clear_stencil*/) override
{
}
void clear_multi(Span<double4> /*clear_cols*/) override {}
void clear_attachment(GPUAttachmentType /*type*/, const double4 /*clear_value*/) override {}
void attachment_set_loadstore_op(GPUAttachmentType /*type*/, GPULoadStore /*ls*/) override {}
void subpass_transition_impl(const GPUAttachmentState /*depth_attachment_state*/,
Span<GPUAttachmentState> /*color_attachment_states*/) override {};
void read(GPUFrameBufferBits /*planes*/,
eGPUDataFormat /*format*/,
const int /*area*/[4],
int /*channel_len*/,
int /*slot*/,
void * /*r_data*/) override
{
}
void blit_to(GPUFrameBufferBits /*planes*/,
int /*src_slot*/,
FrameBuffer * /*dst*/,
int /*dst_slot*/,
int /*dst_offset_x*/,
int /*dst_offset_y*/) override
{
}
};
} // namespace blender::gpu

View File

@@ -0,0 +1,41 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "BLI_sys_types.h"
#include "GPU_vertex_buffer.hh"
namespace blender::gpu {
class DummyVertexBuffer : public VertBuf {
public:
void bind_as_ssbo(uint /*binding*/) override {}
void bind_as_texture(uint /*binding*/) override {}
void wrap_handle(uint64_t /*handle*/) override {}
void update_sub(uint /*start*/, uint /*len*/, const void * /*data*/) override {}
void read(void * /*data*/) const override {}
protected:
void acquire_data() override
{
MEM_SAFE_DELETE(data_);
data_ = MEM_new_array_uninitialized<uchar>(this->size_alloc_get(), __func__);
}
void resize_data() override {}
void release_data() override
{
MEM_SAFE_DELETE(data_);
}
void upload_data() override {}
};
} // namespace blender::gpu