GOOENGINE: Cleanup remove unused DRW functions
This commit is contained in:
@@ -164,14 +164,6 @@ GPUTexture *DRW_texture_create_2d(
|
||||
int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
|
||||
GPUTexture *DRW_texture_create_2d_array(
|
||||
int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
|
||||
GPUTexture *DRW_texture_create_3d(
|
||||
int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
|
||||
GPUTexture *DRW_texture_create_cube(int w,
|
||||
eGPUTextureFormat format,
|
||||
DRWTextureFlag flags,
|
||||
const float *fpixels);
|
||||
GPUTexture *DRW_texture_create_cube_array(
|
||||
int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
|
||||
|
||||
void DRW_texture_ensure_fullscreen_2d(GPUTexture **tex,
|
||||
eGPUTextureFormat format,
|
||||
@@ -315,9 +307,6 @@ GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat att
|
||||
DRWShadingGroup *DRW_shgroup_create(GPUShader *shader, DRWPass *pass);
|
||||
DRWShadingGroup *DRW_shgroup_create_sub(DRWShadingGroup *shgroup);
|
||||
DRWShadingGroup *DRW_shgroup_material_create(GPUMaterial *material, DRWPass *pass);
|
||||
DRWShadingGroup *DRW_shgroup_transform_feedback_create(GPUShader *shader,
|
||||
DRWPass *pass,
|
||||
blender::gpu::VertBuf *tf_target);
|
||||
|
||||
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, GPUMaterial *material);
|
||||
|
||||
@@ -339,12 +328,6 @@ void DRW_shgroup_call_ex(DRWShadingGroup *shgroup,
|
||||
#define DRW_shgroup_call(shgroup, geom, ob) \
|
||||
DRW_shgroup_call_ex(shgroup, ob, nullptr, geom, false, nullptr)
|
||||
|
||||
/**
|
||||
* Same as #DRW_shgroup_call but override the `obmat`. Not culled.
|
||||
*/
|
||||
#define DRW_shgroup_call_obmat(shgroup, geom, obmat) \
|
||||
DRW_shgroup_call_ex(shgroup, nullptr, obmat, geom, false, nullptr)
|
||||
|
||||
/* TODO(fclem): remove this when we have #DRWView */
|
||||
/* user_data is used by #DRWCallVisibilityFn defined in #DRWView. */
|
||||
#define DRW_shgroup_call_with_callback(shgroup, geom, ob, user_data) \
|
||||
@@ -356,33 +339,10 @@ void DRW_shgroup_call_ex(DRWShadingGroup *shgroup,
|
||||
#define DRW_shgroup_call_no_cull(shgroup, geom, ob) \
|
||||
DRW_shgroup_call_ex(shgroup, ob, nullptr, geom, true, nullptr)
|
||||
|
||||
void DRW_shgroup_call_range(
|
||||
DRWShadingGroup *shgroup, const Object *ob, blender::gpu::Batch *geom, uint v_sta, uint v_num);
|
||||
/**
|
||||
* A count of 0 instance will use the default number of instance in the batch.
|
||||
*/
|
||||
void DRW_shgroup_call_instance_range(
|
||||
DRWShadingGroup *shgroup, const Object *ob, blender::gpu::Batch *geom, uint i_sta, uint i_num);
|
||||
|
||||
void DRW_shgroup_call_compute(DRWShadingGroup *shgroup,
|
||||
int groups_x_len,
|
||||
int groups_y_len,
|
||||
int groups_z_len);
|
||||
/**
|
||||
* \warning this keeps the ref to groups_ref until it actually dispatch.
|
||||
*/
|
||||
void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3]);
|
||||
/**
|
||||
* \note No need for a barrier. \a indirect_buf is internally synchronized.
|
||||
*/
|
||||
void DRW_shgroup_call_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf);
|
||||
void DRW_shgroup_call_procedural_points(DRWShadingGroup *sh, const Object *ob, uint point_count);
|
||||
void DRW_shgroup_call_procedural_lines(DRWShadingGroup *sh, const Object *ob, uint line_count);
|
||||
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *sh, const Object *ob, uint tri_count);
|
||||
void DRW_shgroup_call_procedural_indirect(DRWShadingGroup *shgroup,
|
||||
GPUPrimType primitive_type,
|
||||
Object *ob,
|
||||
GPUStorageBuf *indirect_buf);
|
||||
/**
|
||||
* \warning Only use with Shaders that have `IN_PLACE_INSTANCES` defined.
|
||||
* TODO: Should be removed.
|
||||
@@ -391,35 +351,16 @@ void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
blender::gpu::Batch *geom,
|
||||
uint count);
|
||||
/**
|
||||
* \warning Only use with Shaders that have INSTANCED_ATTR defined.
|
||||
*/
|
||||
void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
blender::gpu::Batch *geom,
|
||||
blender::gpu::Batch *inst_attributes);
|
||||
|
||||
void DRW_shgroup_call_sculpt(DRWShadingGroup *shgroup,
|
||||
Object *ob,
|
||||
bool use_wire,
|
||||
bool use_mask,
|
||||
bool use_fset,
|
||||
bool use_color,
|
||||
bool use_uv);
|
||||
|
||||
void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups,
|
||||
GPUMaterial **gpumats,
|
||||
int num_shgroups,
|
||||
const Object *ob);
|
||||
|
||||
DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
|
||||
GPUVertFormat *format,
|
||||
GPUPrimType prim_type);
|
||||
DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
|
||||
GPUVertFormat *format,
|
||||
blender::gpu::Batch *geom);
|
||||
|
||||
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data);
|
||||
void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len);
|
||||
|
||||
#define DRW_buffer_add_entry(buffer, ...) \
|
||||
@@ -428,11 +369,6 @@ void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint
|
||||
DRW_buffer_add_entry_array(buffer, array, (sizeof(array) / sizeof(*array))); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Can only be called during iteration phase.
|
||||
*/
|
||||
uint32_t DRW_object_resource_id_get(Object *ob);
|
||||
|
||||
/**
|
||||
* State is added to #Pass.state while drawing.
|
||||
* Use to temporarily enable draw options.
|
||||
@@ -440,38 +376,11 @@ uint32_t DRW_object_resource_id_get(Object *ob);
|
||||
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state);
|
||||
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state);
|
||||
|
||||
/**
|
||||
* Reminders:
|
||||
* - (compare_mask & reference) is what is tested against (compare_mask & stencil_value)
|
||||
* stencil_value being the value stored in the stencil buffer.
|
||||
* - (write-mask & reference) is what gets written if the test condition is fulfilled.
|
||||
*/
|
||||
void DRW_shgroup_stencil_set(DRWShadingGroup *shgroup,
|
||||
uint write_mask,
|
||||
uint reference,
|
||||
uint compare_mask);
|
||||
/**
|
||||
* TODO: remove this function. Obsolete version. mask is actually reference value.
|
||||
*/
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, uint mask);
|
||||
|
||||
/**
|
||||
* Issue a barrier command.
|
||||
*/
|
||||
void DRW_shgroup_barrier(DRWShadingGroup *shgroup, eGPUBarrier type);
|
||||
|
||||
/**
|
||||
* Issue a clear command.
|
||||
*/
|
||||
void DRW_shgroup_clear_framebuffer(DRWShadingGroup *shgroup,
|
||||
eGPUFrameBufferBits channels,
|
||||
uchar r,
|
||||
uchar g,
|
||||
uchar b,
|
||||
uchar a,
|
||||
float depth,
|
||||
uchar stencil);
|
||||
|
||||
void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup,
|
||||
const char *name,
|
||||
const GPUTexture *tex,
|
||||
@@ -607,18 +516,11 @@ DRWPass *DRW_pass_create_instance(const char *name, DRWPass *original, DRWState
|
||||
* Link two passes so that they are both rendered if the first one is being drawn.
|
||||
*/
|
||||
void DRW_pass_link(DRWPass *first, DRWPass *second);
|
||||
void DRW_pass_foreach_shgroup(DRWPass *pass,
|
||||
void (*callback)(void *user_data, DRWShadingGroup *shgroup),
|
||||
void *user_data);
|
||||
/**
|
||||
* Sort Shading groups by decreasing Z of their first draw call.
|
||||
* This is useful for order dependent effect such as alpha-blending.
|
||||
*/
|
||||
void DRW_pass_sort_shgroup_z(DRWPass *pass);
|
||||
/**
|
||||
* Reverse Shading group submission order.
|
||||
*/
|
||||
void DRW_pass_sort_shgroup_reverse(DRWPass *pass);
|
||||
|
||||
bool DRW_pass_is_empty(DRWPass *pass);
|
||||
|
||||
@@ -672,7 +574,6 @@ void DRW_view_reset();
|
||||
* Set active view for rendering.
|
||||
*/
|
||||
void DRW_view_set_active(const DRWView *view);
|
||||
const DRWView *DRW_view_get_active();
|
||||
|
||||
/**
|
||||
* This only works if DRWPasses have been tagged with DRW_STATE_CLIP_PLANES,
|
||||
|
||||
@@ -791,16 +791,6 @@ static DRWResourceHandle drw_resource_handle_new(const float (*obmat)[4], const
|
||||
return handle;
|
||||
}
|
||||
|
||||
uint32_t DRW_object_resource_id_get(Object * /*ob*/)
|
||||
{
|
||||
DRWResourceHandle handle = DST.ob_handle;
|
||||
if (handle == 0) {
|
||||
/* Handle not yet allocated. Return next handle. */
|
||||
handle = DST.resource_handle;
|
||||
}
|
||||
return handle & ~(1u << 31);
|
||||
}
|
||||
|
||||
static DRWResourceHandle drw_resource_handle(DRWShadingGroup *shgroup,
|
||||
const float (*obmat)[4],
|
||||
const Object *ob)
|
||||
@@ -1073,54 +1063,6 @@ void DRW_shgroup_call_ex(DRWShadingGroup *shgroup,
|
||||
}
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_range(
|
||||
DRWShadingGroup *shgroup, const Object *ob, blender::gpu::Batch *geom, uint v_sta, uint v_num)
|
||||
{
|
||||
BLI_assert(geom != nullptr);
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
drw_command_set_select_id(shgroup, nullptr, DST.select_id);
|
||||
}
|
||||
DRWResourceHandle handle = drw_resource_handle(
|
||||
shgroup, ob ? ob->object_to_world().ptr() : nullptr, ob);
|
||||
drw_command_draw_range(shgroup, geom, handle, v_sta, v_num);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_instance_range(
|
||||
DRWShadingGroup *shgroup, const Object *ob, blender::gpu::Batch *geom, uint i_sta, uint i_num)
|
||||
{
|
||||
BLI_assert(geom != nullptr);
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
drw_command_set_select_id(shgroup, nullptr, DST.select_id);
|
||||
}
|
||||
DRWResourceHandle handle = drw_resource_handle(
|
||||
shgroup, ob ? ob->object_to_world().ptr() : nullptr, ob);
|
||||
drw_command_draw_intance_range(shgroup, geom, handle, i_sta, i_num);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_compute(DRWShadingGroup *shgroup,
|
||||
int groups_x_len,
|
||||
int groups_y_len,
|
||||
int groups_z_len)
|
||||
{
|
||||
BLI_assert(groups_x_len > 0 && groups_y_len > 0 && groups_z_len > 0);
|
||||
drw_command_compute(shgroup, groups_x_len, groups_y_len, groups_z_len);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3])
|
||||
{
|
||||
drw_command_compute_ref(shgroup, groups_ref);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf)
|
||||
{
|
||||
drw_command_compute_indirect(shgroup, indirect_buf);
|
||||
}
|
||||
|
||||
void DRW_shgroup_barrier(DRWShadingGroup *shgroup, eGPUBarrier type)
|
||||
{
|
||||
drw_command_barrier(shgroup, type);
|
||||
}
|
||||
|
||||
static void drw_shgroup_call_procedural_add_ex(DRWShadingGroup *shgroup,
|
||||
blender::gpu::Batch *geom,
|
||||
const Object *ob,
|
||||
@@ -1136,20 +1078,6 @@ static void drw_shgroup_call_procedural_add_ex(DRWShadingGroup *shgroup,
|
||||
drw_command_draw_procedural(shgroup, geom, handle, vert_count);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_procedural_points(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
uint point_count)
|
||||
{
|
||||
blender::gpu::Batch *geom = drw_cache_procedural_points_get();
|
||||
drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, point_count);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_procedural_lines(DRWShadingGroup *shgroup, const Object *ob, uint line_count)
|
||||
{
|
||||
blender::gpu::Batch *geom = drw_cache_procedural_lines_get();
|
||||
drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, line_count * 2);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
uint tri_count)
|
||||
@@ -1158,39 +1086,6 @@ void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup,
|
||||
drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, tri_count * 3);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_procedural_indirect(DRWShadingGroup *shgroup,
|
||||
GPUPrimType primitive_type,
|
||||
Object *ob,
|
||||
GPUStorageBuf *indirect_buf)
|
||||
{
|
||||
blender::gpu::Batch *geom = nullptr;
|
||||
switch (primitive_type) {
|
||||
case GPU_PRIM_POINTS:
|
||||
geom = drw_cache_procedural_points_get();
|
||||
break;
|
||||
case GPU_PRIM_LINES:
|
||||
geom = drw_cache_procedural_lines_get();
|
||||
break;
|
||||
case GPU_PRIM_TRIS:
|
||||
geom = drw_cache_procedural_triangles_get();
|
||||
break;
|
||||
case GPU_PRIM_TRI_STRIP:
|
||||
geom = drw_cache_procedural_triangle_strips_get();
|
||||
break;
|
||||
default:
|
||||
BLI_assert_msg(0,
|
||||
"Unsupported primitive type in DRW_shgroup_call_procedural_indirect. Add new "
|
||||
"one as needed.");
|
||||
break;
|
||||
}
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
drw_command_set_select_id(shgroup, nullptr, DST.select_id);
|
||||
}
|
||||
DRWResourceHandle handle = drw_resource_handle(
|
||||
shgroup, ob ? ob->object_to_world().ptr() : nullptr, ob);
|
||||
drw_command_draw_indirect(shgroup, geom, handle, indirect_buf);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
blender::gpu::Batch *geom,
|
||||
@@ -1205,23 +1100,6 @@ void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
|
||||
drw_command_draw_instance(shgroup, geom, handle, count, false);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
|
||||
const Object *ob,
|
||||
blender::gpu::Batch *geom,
|
||||
blender::gpu::Batch *inst_attributes)
|
||||
{
|
||||
BLI_assert(geom != nullptr);
|
||||
BLI_assert(inst_attributes != nullptr);
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
drw_command_set_select_id(shgroup, nullptr, DST.select_id);
|
||||
}
|
||||
DRWResourceHandle handle = drw_resource_handle(
|
||||
shgroup, ob ? ob->object_to_world().ptr() : nullptr, ob);
|
||||
blender::gpu::Batch *batch = DRW_temp_batch_instance_request(
|
||||
DST.vmempool->idatalist, nullptr, inst_attributes, geom);
|
||||
drw_command_draw_instance(shgroup, batch, handle, 0, true);
|
||||
}
|
||||
|
||||
#define SCULPT_DEBUG_BUFFERS (G.debug_value == 889)
|
||||
struct DRWSculptCallbackData {
|
||||
const Object *ob;
|
||||
@@ -1382,59 +1260,6 @@ static void drw_sculpt_generate_calls(DRWSculptCallbackData *scd)
|
||||
visible_nodes);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_sculpt(DRWShadingGroup *shgroup,
|
||||
Object *ob,
|
||||
bool use_wire,
|
||||
bool use_mask,
|
||||
bool use_fset,
|
||||
bool use_color,
|
||||
bool use_uv)
|
||||
{
|
||||
using namespace blender;
|
||||
using namespace blender::draw;
|
||||
DRWSculptCallbackData scd{};
|
||||
scd.ob = ob;
|
||||
scd.shading_groups = &shgroup;
|
||||
scd.num_shading_groups = 1;
|
||||
scd.use_wire = use_wire;
|
||||
scd.use_mats = false;
|
||||
scd.use_mask = use_mask;
|
||||
|
||||
Vector<pbvh::AttributeRequest, 16> attrs;
|
||||
|
||||
attrs.append(pbvh::CustomRequest::Position);
|
||||
attrs.append(pbvh::CustomRequest::Normal);
|
||||
if (use_mask) {
|
||||
attrs.append(pbvh::CustomRequest::Mask);
|
||||
}
|
||||
if (use_fset) {
|
||||
attrs.append(pbvh::CustomRequest::FaceSet);
|
||||
}
|
||||
|
||||
Mesh *mesh = BKE_object_get_original_mesh(ob);
|
||||
const bke::AttributeAccessor attributes = mesh->attributes();
|
||||
|
||||
if (use_color) {
|
||||
if (const char *name = mesh->active_color_attribute) {
|
||||
if (const std::optional<bke::AttributeMetaData> meta_data = attributes.lookup_meta_data(
|
||||
name))
|
||||
{
|
||||
attrs.append(pbvh::GenericRequest{name, meta_data->data_type, meta_data->domain});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (use_uv) {
|
||||
if (const char *name = CustomData_get_active_layer_name(&mesh->corner_data, CD_PROP_FLOAT2)) {
|
||||
attrs.append(pbvh::GenericRequest{name, CD_PROP_FLOAT2, bke::AttrDomain::Corner});
|
||||
}
|
||||
}
|
||||
|
||||
scd.attrs = attrs;
|
||||
|
||||
drw_sculpt_generate_calls(&scd);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups,
|
||||
GPUMaterial **gpumats,
|
||||
int num_shgroups,
|
||||
@@ -1490,37 +1315,6 @@ void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups,
|
||||
|
||||
static GPUVertFormat inst_select_format = {0};
|
||||
|
||||
DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
|
||||
GPUVertFormat *format,
|
||||
GPUPrimType prim_type)
|
||||
{
|
||||
BLI_assert(ELEM(prim_type, GPU_PRIM_POINTS, GPU_PRIM_LINES, GPU_PRIM_TRI_FAN));
|
||||
BLI_assert(format != nullptr);
|
||||
|
||||
DRWCallBuffer *callbuf = static_cast<DRWCallBuffer *>(
|
||||
BLI_memblock_alloc(DST.vmempool->callbuffers));
|
||||
callbuf->buf = DRW_temp_buffer_request(DST.vmempool->idatalist, format, &callbuf->count);
|
||||
callbuf->buf_select = nullptr;
|
||||
callbuf->count = 0;
|
||||
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
/* Not actually used for rendering but allocated in one chunk. */
|
||||
if (inst_select_format.attr_len == 0) {
|
||||
GPU_vertformat_attr_add(&inst_select_format, "selectId", GPU_COMP_I32, 1, GPU_FETCH_INT);
|
||||
}
|
||||
callbuf->buf_select = DRW_temp_buffer_request(
|
||||
DST.vmempool->idatalist, &inst_select_format, &callbuf->count);
|
||||
drw_command_set_select_id(shgroup, callbuf->buf_select, -1);
|
||||
}
|
||||
|
||||
DRWResourceHandle handle = drw_resource_handle(shgroup, nullptr, nullptr);
|
||||
blender::gpu::Batch *batch = DRW_temp_batch_request(
|
||||
DST.vmempool->idatalist, callbuf->buf, prim_type);
|
||||
drw_command_draw(shgroup, batch, handle);
|
||||
|
||||
return callbuf;
|
||||
}
|
||||
|
||||
DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
|
||||
GPUVertFormat *format,
|
||||
blender::gpu::Batch *geom)
|
||||
@@ -1552,27 +1346,6 @@ DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
|
||||
return callbuf;
|
||||
}
|
||||
|
||||
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data)
|
||||
{
|
||||
blender::gpu::VertBuf *buf = callbuf->buf;
|
||||
const bool resize = (callbuf->count == GPU_vertbuf_get_vertex_alloc(buf));
|
||||
|
||||
if (UNLIKELY(resize)) {
|
||||
GPU_vertbuf_data_resize(*buf, callbuf->count + DRW_BUFFER_VERTS_CHUNK);
|
||||
}
|
||||
|
||||
GPU_vertbuf_vert_set(buf, callbuf->count, data);
|
||||
|
||||
if (G.f & G_FLAG_PICKSEL) {
|
||||
if (UNLIKELY(resize)) {
|
||||
GPU_vertbuf_data_resize(*callbuf->buf_select, callbuf->count + DRW_BUFFER_VERTS_CHUNK);
|
||||
}
|
||||
GPU_vertbuf_attr_set(callbuf->buf_select, 0, callbuf->count, &DST.select_id);
|
||||
}
|
||||
|
||||
callbuf->count++;
|
||||
}
|
||||
|
||||
void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len)
|
||||
{
|
||||
blender::gpu::VertBuf *buf = callbuf->buf;
|
||||
@@ -1876,23 +1649,6 @@ DRWShadingGroup *DRW_shgroup_create(GPUShader *shader, DRWPass *pass)
|
||||
return shgroup;
|
||||
}
|
||||
|
||||
DRWShadingGroup *DRW_shgroup_transform_feedback_create(GPUShader *shader,
|
||||
DRWPass *pass,
|
||||
blender::gpu::VertBuf *tf_target)
|
||||
{
|
||||
BLI_assert(tf_target != nullptr);
|
||||
DRWShadingGroup *shgroup = drw_shgroup_create_ex(shader, pass);
|
||||
drw_shgroup_init(shgroup, shader);
|
||||
drw_shgroup_uniform_create_ex(shgroup,
|
||||
0,
|
||||
DRW_UNIFORM_TFEEDBACK_TARGET,
|
||||
tf_target,
|
||||
GPUSamplerState::default_sampler(),
|
||||
0,
|
||||
1);
|
||||
return shgroup;
|
||||
}
|
||||
|
||||
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
|
||||
{
|
||||
drw_command_set_mutable_state(shgroup, state, DRW_STATE_NO_DRAW);
|
||||
@@ -1903,31 +1659,11 @@ void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
|
||||
drw_command_set_mutable_state(shgroup, DRW_STATE_NO_DRAW, state);
|
||||
}
|
||||
|
||||
void DRW_shgroup_stencil_set(DRWShadingGroup *shgroup,
|
||||
uint write_mask,
|
||||
uint reference,
|
||||
uint compare_mask)
|
||||
{
|
||||
drw_command_set_stencil_mask(shgroup, write_mask, reference, compare_mask);
|
||||
}
|
||||
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, uint mask)
|
||||
{
|
||||
drw_command_set_stencil_mask(shgroup, 0xFF, mask, 0xFF);
|
||||
}
|
||||
|
||||
void DRW_shgroup_clear_framebuffer(DRWShadingGroup *shgroup,
|
||||
eGPUFrameBufferBits channels,
|
||||
uchar r,
|
||||
uchar g,
|
||||
uchar b,
|
||||
uchar a,
|
||||
float depth,
|
||||
uchar stencil)
|
||||
{
|
||||
drw_command_clear(shgroup, channels, r, g, b, a, depth, stencil);
|
||||
}
|
||||
|
||||
bool DRW_shgroup_is_empty(DRWShadingGroup *shgroup)
|
||||
{
|
||||
DRWCommandChunk *chunk = shgroup->cmd.first;
|
||||
@@ -2432,15 +2168,6 @@ bool DRW_pass_is_empty(DRWPass *pass)
|
||||
return true;
|
||||
}
|
||||
|
||||
void DRW_pass_foreach_shgroup(DRWPass *pass,
|
||||
void (*callback)(void *user_data, DRWShadingGroup *shgrp),
|
||||
void *user_data)
|
||||
{
|
||||
LISTBASE_FOREACH (DRWShadingGroup *, shgroup, &pass->shgroups) {
|
||||
callback(user_data, shgroup);
|
||||
}
|
||||
}
|
||||
|
||||
static int pass_shgroup_dist_sort(const void *a, const void *b)
|
||||
{
|
||||
const DRWShadingGroup *shgrp_a = (const DRWShadingGroup *)a;
|
||||
@@ -2522,11 +2249,4 @@ void DRW_pass_sort_shgroup_z(DRWPass *pass)
|
||||
pass->shgroups.last = last;
|
||||
}
|
||||
|
||||
void DRW_pass_sort_shgroup_reverse(DRWPass *pass)
|
||||
{
|
||||
pass->shgroups.last = pass->shgroups.first;
|
||||
/* WARNING: Assume that DRWShadingGroup->next is the first member. */
|
||||
BLI_linklist_reverse((LinkNode **)&pass->shgroups.first);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
@@ -349,11 +349,6 @@ void DRW_view_set_active(const DRWView *view)
|
||||
DST.view_active = (view != nullptr) ? ((DRWView *)view) : DST.view_default;
|
||||
}
|
||||
|
||||
const DRWView *DRW_view_get_active()
|
||||
{
|
||||
return DST.view_active;
|
||||
}
|
||||
|
||||
/* Return True if the given BoundSphere intersect the current view frustum */
|
||||
static bool draw_culling_sphere_test(const BoundSphere *frustum_bsphere,
|
||||
const float (*frustum_planes)[4],
|
||||
|
||||
@@ -124,12 +124,6 @@ GPUTexture *DRW_texture_create_3d_ex(int w,
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_create_3d(
|
||||
int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
|
||||
{
|
||||
return DRW_texture_create_3d_ex(w, h, d, format, GPU_TEXTURE_USAGE_GENERAL, flags, fpixels);
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_create_cube_ex(int w,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage,
|
||||
@@ -142,14 +136,6 @@ GPUTexture *DRW_texture_create_cube_ex(int w,
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_create_cube(int w,
|
||||
eGPUTextureFormat format,
|
||||
DRWTextureFlag flags,
|
||||
const float *fpixels)
|
||||
{
|
||||
return DRW_texture_create_cube_ex(w, format, GPU_TEXTURE_USAGE_GENERAL, flags, fpixels);
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_create_cube_array_ex(int w,
|
||||
int d,
|
||||
eGPUTextureFormat format,
|
||||
@@ -163,12 +149,6 @@ GPUTexture *DRW_texture_create_cube_array_ex(int w,
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_create_cube_array(
|
||||
int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
|
||||
{
|
||||
return DRW_texture_create_cube_array_ex(w, d, format, GPU_TEXTURE_USAGE_GENERAL, flags, fpixels);
|
||||
}
|
||||
|
||||
GPUTexture *DRW_texture_pool_query_2d_ex(
|
||||
int w, int h, eGPUTextureFormat format, eGPUTextureUsage usage, DrawEngineType *engine_type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user