Cleanup: comment block formatting

This commit is contained in:
Campbell Barton
2024-01-08 11:24:38 +11:00
parent 0ba83fde1f
commit 617f7b76df
65 changed files with 104 additions and 102 deletions
+1 -1
View File
@@ -444,7 +444,7 @@ bool MetalDeviceQueue::enqueue(DeviceKernel kernel,
work_size];
}
/* this relies on IntegratorStateGPU layout being contiguous device_ptrs */
/* this relies on IntegratorStateGPU layout being contiguous device_ptrs. */
const size_t pointer_block_end = offsetof(KernelParamsMetal, integrator_state) +
offsetof(IntegratorStateGPU, sort_partition_divisor);
for (size_t offset = 0; offset < pointer_block_end; offset += sizeof(device_ptr)) {
@@ -792,7 +792,7 @@ ccl_device void bsdf_microfacet_setup_fresnel_generalized_schlick(
s = saturatef(inverse_lerp(real_F0, 1.0f, real_Fss));
}
else {
/* Integral of 2*cosI * (1 - cosI)^exponent over 0...1*/
/* Integral of 2*cosI * (1 - cosI)^exponent over 0...1. */
s = 2.0f / ((fresnel->exponent + 3.0f) * fresnel->exponent + 2.0f);
}
/* Due to the linearity of the generalized model, this ends up working. */
+1 -1
View File
@@ -181,7 +181,7 @@ void kernel_gpu_##name::run(thread MetalKernelContext& context, \
#define ccl_gpu_kernel_call(x) context.x
#define ccl_gpu_kernel_within_bounds(i,n) true
/* define a function object where "func" is the lambda body, and additional parameters are used to specify captured state */
/* define a function object where "func" is the lambda body, and additional parameters are used to specify captured state. */
#define ccl_gpu_kernel_lambda(func, ...) \
struct KernelLambda \
{ \
+1 -1
View File
@@ -8,7 +8,7 @@
CCL_NAMESPACE_BEGIN
/* Fractal Brownian motion*/
/* Fractal Brownian motion. */
ccl_device_noinline float noise_fbm(
float p, float detail, float roughness, float lacunarity, bool normalize)
@@ -453,7 +453,7 @@ void ANIM_armature_bonecoll_active_runtime_refresh(struct bArmature *armature)
index++;
}
/* No bone collection with the name was found, so better to clear everything.*/
/* No bone collection with the name was found, so better to clear everything. */
armature_bonecoll_active_clear(armature);
}
@@ -1007,10 +1007,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child0 to become 1st child of root_1, before r1_child0. */
EXPECT_EQ(2,
armature_bonecoll_move_to_parent(&arm,
3, /* From index.*/
0, /* To child number.*/
3, /* From index. */
0, /* To child number. */
0, /* From parent. */
1 /* To parent.*/
1 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
@@ -1042,10 +1042,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child1 to become the 2nd child of root_1. */
EXPECT_EQ(3,
armature_bonecoll_move_to_parent(&arm,
4, /* From index.*/
1, /* To child number.*/
4, /* From index. */
1, /* To child number. */
0, /* From parent. */
1 /* To parent.*/
1 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
@@ -1077,10 +1077,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child3 to become the last child of root_1. */
EXPECT_EQ(5,
armature_bonecoll_move_to_parent(&arm,
6, /* From index.*/
3, /* To child number.*/
6, /* From index. */
3, /* To child number. */
0, /* From parent. */
1 /* To parent.*/
1 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
@@ -1115,10 +1115,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child3 to become the first child of root_0. */
EXPECT_EQ(5,
armature_bonecoll_move_to_parent(&arm,
5, /* From index.*/
0, /* To child number.*/
5, /* From index. */
0, /* To child number. */
1, /* From parent. */
0 /* To parent.*/
0 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
@@ -1150,10 +1150,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child0 to become the last child of root_0. */
EXPECT_EQ(6,
armature_bonecoll_move_to_parent(&arm,
2, /* From index.*/
2, /* To child number.*/
2, /* From index. */
2, /* To child number. */
1, /* From parent. */
0 /* To parent.*/
0 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
@@ -1185,10 +1185,10 @@ TEST_F(ANIM_armature_bone_collections, bcoll_move_to_parent__within_siblings)
/* Move r0_child1 to become the 3nd child of root_0. */
EXPECT_EQ(5,
armature_bonecoll_move_to_parent(&arm,
2, /* From index.*/
2, /* To child number.*/
2, /* From index. */
2, /* To child number. */
1, /* From parent. */
0 /* To parent.*/
0 /* To parent. */
));
ASSERT_EQ(2, arm.collection_root_count);
+2 -2
View File
@@ -371,7 +371,7 @@ void BKE_main_merge(Main *bmain_dst, Main **r_bmain_src, MainMergeReport &report
reports.num_merged_ids = int(ids_to_move.size());
/* Rebase relative filepaths in `bmain_src` using `bmain_dst` path as new reference, or make them
* absolute if destination bmain has no filepath. */
* absolute if destination bmain has no filepath. */
if (bmain_src->filepath[0] != '\0') {
char dir_src[FILE_MAXDIR];
BLI_path_split_dir_part(bmain_src->filepath, dir_src, sizeof(dir_src));
@@ -404,7 +404,7 @@ void BKE_main_merge(Main *bmain_dst, Main **r_bmain_src, MainMergeReport &report
/* The other data has to be remapped once all IDs are in `bmain_dst`, to ensure that additional
* update process (e.g. collection hierarchy handling) happens as expected with the correct set
* of data. */
* of data. */
BKE_libblock_relink_multiple(bmain_dst, ids_to_move, ID_REMAP_TYPE_REMAP, id_remapper, 0);
BKE_reportf(
@@ -176,7 +176,7 @@ TEST_F(BMainMergeTest, linked_data)
EXPECT_EQ(nullptr, bmain_src);
/* Try another merge, with the same library path - second library should be skipped, destination
* merge should still have only one library ID.*/
* merge should still have only one library ID. */
bmain_src = BKE_main_new();
STRNCPY(bmain_src->filepath, SRC_PATH);
@@ -682,7 +682,7 @@ static std::optional<MeshMismatch> construct_vertex_mapping(const Mesh &mesh1,
}
/* Since we are not yet able to distinguish all vertices based on their attributes alone, we
need to use the edge topology. */
* need to use the edge topology. */
Array<int> vert_to_edge_offsets1;
Array<int> vert_to_edge_indices1;
const GroupedSpan<int> vert_to_edge_map1 = mesh::build_vert_to_edge_map(
@@ -1388,7 +1388,7 @@ static BMVert *find_outer_flap_vert(BMFace &face)
BM_ITER_ELEM (vert, &bm_iter, &face, BM_VERTS_OF_FACE) {
if (BM_vert_face_count_at_most(vert, 2) == 1) {
if (flap_vert) {
/* There are multiple vertices which become loose on removing the face and its edges.*/
/* There are multiple vertices which become loose on removing the face and its edges. */
return nullptr;
}
flap_vert = vert;
+1 -1
View File
@@ -219,7 +219,7 @@ fnmatch (const char *pattern, const char *string, int flags)
return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;
return FNM_NOMATCH;
@@ -144,7 +144,7 @@ Array<KeyingScreenOperation::MarkerPoint> *KeyingScreenOperation::compute_marker
return marker_points;
}
void *KeyingScreenOperation::initialize_tile_data(rcti * /* rect*/)
void *KeyingScreenOperation::initialize_tile_data(rcti * /*rect*/)
{
if (movie_clip_ == nullptr) {
return nullptr;
@@ -9,7 +9,7 @@ shared vec2 cached_marker_positions[CACHE_SIZE];
shared vec4 cached_marker_colors[CACHE_SIZE];
/* Cache the initial part of the marker SSBOs in shared memory to make the interpolation loop
* faster. */
* faster. */
void populate_cache()
{
if (int(gl_LocalInvocationIndex) < number_of_markers) {
@@ -45,8 +45,8 @@
/* -------------- Utils ------------- */
/* For performance on macOS, constants declared within function scope utilize constant uniform
register space rather than per-thread, reducing spill and increasing
thread execution width - and thus performance */
* register space rather than per-thread, reducing spill and increasing
* thread execution width - and thus performance. */
#define DEFINE_DOF_QUAD_OFFSETS \
const vec2 quad_offsets[4] = vec2[4]( \
vec2(-0.5, 0.5), vec2(0.5, 0.5), vec2(0.5, -0.5), vec2(-0.5, -0.5));
@@ -214,7 +214,7 @@ void IrradianceCache::set_view(View & /*view*/)
return _a.z < _b.z;
}
else {
/* Fallback to memory address, since there's no good alternative.*/
/* Fallback to memory address, since there's no good alternative. */
return a < b;
}
});
@@ -636,7 +636,7 @@ void IrradianceBake::init(const Object &probe_object)
capture_indirect_ = (lightprobe->grid_flag & LIGHTPROBE_GRID_CAPTURE_INDIRECT);
capture_emission_ = (lightprobe->grid_flag & LIGHTPROBE_GRID_CAPTURE_EMISSION);
/* Initialize views data, since they're used by other modules.*/
/* Initialize views data, since they're used by other modules. */
surfel_raster_views_sync(float3(0.0f), float3(1.0f), float4x4::identity());
}
@@ -203,7 +203,7 @@ MaterialPass MaterialModule::material_pass_get(Object *ob,
if (GPU_material_recalc_flag_get(matpass.gpumat)) {
/* TODO(Miguel Pozo): This is broken, it consumes the flag,
* but GPUMats can be shared across viewports.*/
* but GPUMats can be shared across viewports. */
inst_.sampling.reset();
}
@@ -136,11 +136,11 @@ class RayTraceModule {
Texture tile_raytrace_tracing_tx_ = {"tile_raytrace_tracing_tx_"};
Texture tile_horizon_denoise_tx_ = {"tile_horizon_denoise_tx_"};
Texture tile_horizon_tracing_tx_ = {"tile_horizon_tracing_tx_"};
/** Indirect dispatch rays. Avoid dispatching work-groups that will not trace anything.*/
/** Indirect dispatch rays. Avoid dispatching work-groups that will not trace anything. */
DispatchIndirectBuf raytrace_tracing_dispatch_buf_ = {"raytrace_tracing_dispatch_buf_"};
/** Indirect dispatch denoise full-resolution tiles. */
DispatchIndirectBuf raytrace_denoise_dispatch_buf_ = {"raytrace_denoise_dispatch_buf_"};
/** Indirect dispatch horizon scan. Avoid dispatching work-groups that will not scan anything.*/
/** Indirect dispatch horizon scan. Avoid dispatching work-groups that will not scan anything. */
DispatchIndirectBuf horizon_tracing_dispatch_buf_ = {"horizon_tracing_dispatch_buf_"};
/** Indirect dispatch denoise full-resolution tiles. */
DispatchIndirectBuf horizon_denoise_dispatch_buf_ = {"horizon_denoise_dispatch_buf_"};
@@ -523,7 +523,7 @@ void ReflectionProbeModule::set_view(View & /*view*/)
return _a.z < _b.z;
}
else {
/* Fallback to memory address, since there's no good alternative.*/
/* Fallback to memory address, since there's no good alternative. */
return a < b;
}
});
@@ -1300,7 +1300,7 @@ void ShadowModule::set_view(View &view, GPUTexture *depth_tx)
render_fb_.ensure(fb_size);
}
else if (shadow_technique == ShadowTechnique::TILE_COPY) {
/* Create memoryless depth attachment for on-tile surface depth accumulation.*/
/* Create memoryless depth attachment for on-tile surface depth accumulation. */
shadow_depth_fb_tx_.ensure_2d_array(GPU_DEPTH_COMPONENT32F, fb_size, fb_layers, usage);
shadow_depth_accum_tx_.ensure_2d_array(GPU_R32F, fb_size, fb_layers, usage);
render_fb_.ensure(GPU_ATTACHMENT_TEXTURE(shadow_depth_fb_tx_),
@@ -1327,7 +1327,7 @@ void ShadowModule::set_view(View &view, GPUTexture *depth_tx)
statistics_buf_.current().async_flush_to_host();
/* Isolate shadow update into own command buffer.
* If parameter buffer exceeds limits, then other work will not be impacted. */
* If parameter buffer exceeds limits, then other work will not be impacted. */
bool use_flush = (shadow_technique == ShadowTechnique::TILE_COPY) &&
(GPU_backend_get_type() == GPU_BACKEND_METAL);
@@ -292,8 +292,8 @@ class ShadowModule {
Framebuffer render_fb_ = {"shadow_write_framebuffer"};
/* NOTE(Metal): Metal requires memoryless textures to be created which represent attachments in
* the shadow write framebuffer. These textures do not occupy any physical memory, but require a
* Texture object containing its parameters.*/
* the shadow write frame-buffer. These textures do not occupy any physical memory, but require a
* Texture object containing its parameters. */
Texture shadow_depth_fb_tx_ = {"shadow_depth_fb_tx_"};
Texture shadow_depth_accum_tx_ = {"shadow_depth_accum_tx_"};
@@ -94,7 +94,7 @@ vec3 sample_ggx(vec3 rand, float alpha, vec3 Vt)
* \param N: Normal vector.
* \param T: Tangent vector.
* \param B: Bitangent vector.
*
* \return pdf: the pdf of sampling the reflected ray. 0 if ray is invalid.
*/
vec3 sample_ggx_reflect(vec3 rand, float alpha, vec3 V, vec3 N, vec3 T, vec3 B, out float pdf)
@@ -125,7 +125,7 @@ vec3 sample_ggx_reflect(vec3 rand, float alpha, vec3 V, vec3 N, vec3 T, vec3 B,
* \param N: Normal vector.
* \param T: Tangent vector.
* \param B: Bitangent vector.
*
* \return pdf: the pdf of sampling the refracted ray. 0 if ray is invalid.
*/
vec3 sample_ggx_refract(
@@ -63,7 +63,7 @@ void main()
entry = occupancy_or(entry, occupancy_bit_from_depth(1.0 / 32.0, 32));
/* Second entry at the same depth. Should not change anything. */
entry = occupancy_or(entry, occupancy_bit_from_depth(1.1 / 32.0, 32));
/* Exit 2 bits later.*/
/* Exit 2 bits later. */
exit = occupancy_or(exit, occupancy_bit_from_depth(3.0 / 32.0, 32));
/* Second exit. Should not change anything. */
exit = occupancy_or(exit, occupancy_bit_from_depth(5.0 / 32.0, 32));
@@ -43,7 +43,7 @@
void main()
{
/* The tile clear pass writes out to tile attachment to ensure raster order groups are satisfied,
* allowing the clear to be guaranteed to happen first, as it is first in submission order. */
* allowing the clear to be guaranteed to happen first, as it is first in submission order. */
out_tile_depth = FLT_MAX;
}
@@ -58,7 +58,7 @@ void main()
/* Write result to atlas. */
# ifdef GPU_METAL
/* NOTE: Use the fastest possible write function without any parameter wrapping or conversion.*/
/* NOTE: Use the fastest possible write function without any parameter wrapping or conversion. */
shadow_atlas_img.texture->write(
u_depth, ushort2(interp_noperspective.out_texel_xy), interp_flat.out_page_z);
# else
@@ -22,7 +22,7 @@ void main()
#ifdef PASS_DEPTH_STORE
/* Load where fragment should write the tile data. */
uvec3 dst_page_co = shadow_page_unpack(dst_coord_buf[tile_id]);
/* Interpolate output texel */
/* Interpolate output texel. */
interp_noperspective.out_texel_xy = (vec2(dst_page_co.xy) + tile_corner) * vec2(SHADOW_PAGE_RES);
interp_flat.out_page_z = dst_page_co.z;
#endif
@@ -109,7 +109,7 @@ struct ShadowTracingSample {
void shadow_map_trace_hit_check(inout ShadowMapTracingState state, ShadowTracingSample samp)
{
/* Skip empty tiles since they do not contain actual depth information.
* Not doing so would change the z gradient history. */
* Not doing so would change the z gradient history. */
if (samp.skip_sample) {
return;
}
@@ -26,8 +26,8 @@ uint outline_colorid_get(void)
/* Replace top 2 bits (of the 16bit output) by outlineId.
* This leaves 16K different IDs to create outlines between objects.
vec3 world_pos = point_object_to_world(pos);
* SHIFT = (32 - (16 - 2)) */
* `vec3 world_pos = point_object_to_world(pos);`
* `SHIFT = (32 - (16 - 2))`. */
#define SHIFT 18u
void main()
@@ -156,7 +156,7 @@ class Instance {
if (is_object_data_visible) {
if (object_state.sculpt_pbvh) {
/* Disable frustum culling for sculpt meshes. */
/* TODO(@pragma37): Implement a cleaner way to disable frustum culling. */
/* TODO(@pragma37): Implement a cleaner way to disable frustum culling. */
ResourceHandle handle = manager.resource_handle(float4x4(ob_ref.object->object_to_world));
handle = ResourceHandle(handle.resource_index(), ob_ref.object->transflag & OB_NEG_SCALE);
sculpt_sync(ob_ref, handle, object_state);
@@ -56,7 +56,7 @@ struct SurfaceReconstructResult {
/**
* Reconstruct surface information from the depth buffer.
* Use adjacent pixel info to reconstruct normals.
*
* \a extent is the valid region of depth_tx.
* \a texel is the pixel coordinate [0..extent-1] to reconstruct.
*/
@@ -1133,7 +1133,7 @@ static void move_to_collection_menu_create(bContext *C, uiLayout *layout, void *
}
/* Loop over the children. There should be at least one, otherwise this parent
* bone collection wouldn't have been drawn as a menu.*/
* bone collection wouldn't have been drawn as a menu. */
for (int index = child_index; index < child_index + child_count; index++) {
const BoneCollection *bcoll = arm->collection_array[index];
@@ -2880,10 +2880,10 @@ void uiItemPointerR(uiLayout *layout,
int icon);
/**
* Create a list of enum items.
* Create a list of enum items.
*
* \param active: an optional item to highlight.
*/
*/
void uiItemsFullEnumO(uiLayout *layout,
const char *opname,
const char *propname,
@@ -2897,7 +2897,7 @@ static eVGroupSelect normalize_vertex_group_target(Object *ob)
eVGroupSelect target_group = WT_VGROUP_ALL;
/* If armature is present, and armature is actively deforming the object
(i.e armature modifier isn't disabled) use BONE DEFORM. */
* (i.e armature modifier isn't disabled) use BONE DEFORM. */
if (BKE_modifiers_is_deformed_by_armature(ob)) {
int defgroup_tot = BKE_object_defgroup_count(ob);
+1 -1
View File
@@ -2992,7 +2992,7 @@ static void ed_panel_draw(const bContext *C,
h = -yco;
h += style->panelspace;
if (!ends_with_layout_panel_header) {
/* Last layout panel header ends together with the panel.*/
/* Last layout panel header ends together with the panel. */
h += style->panelspace;
}
}
@@ -225,7 +225,7 @@ static void partialvis_update_mesh(Object &object,
Mesh &mesh = *static_cast<Mesh *>(object.data);
bke::MutableAttributeAccessor attributes = mesh.attributes_for_write();
if (action == VisAction::Show && !attributes.contains(".hide_vert")) {
/* If everything is already visible, don't do anything.*/
/* If everything is already visible, don't do anything. */
return;
}
@@ -123,7 +123,7 @@ static int console_delete_editable_selection(SpaceConsole *sc)
int del_end = sc->sel_end;
if (del_end > cl->len) {
/* Adjust range to only editable portion. */
/* Adjust range to only editable portion. */
del_end = cl->len;
}
@@ -28,7 +28,7 @@ class SeqQuadsBatch {
SeqQuadsBatch();
~SeqQuadsBatch();
/** Draw all the previously added primitives. */
/** Draw all the previously added primitives. */
void draw();
/** Add an axis-aligned quad. */
void add_quad(float x1, float y1, float x2, float y2, const uchar color[4])
+1 -1
View File
@@ -540,7 +540,7 @@ typedef enum eGPUTextureUsage {
/* Whether a texture is used as an attachment in a frame-buffer. */
GPU_TEXTURE_USAGE_ATTACHMENT = (1 << 2),
/* Whether a texture is used to create a texture view utilizing a different texture format to the
* source textures format. This includes the use of stencil views. */
* source textures format. This includes the use of stencil views. */
GPU_TEXTURE_USAGE_FORMAT_VIEW = (1 << 3),
/* Whether the texture needs to be read from by the CPU. */
GPU_TEXTURE_USAGE_HOST_READ = (1 << 4),
@@ -906,7 +906,7 @@ struct ShaderCreateInfo {
Self &push_constant(Type type, StringRefNull name, int array_size = 0)
{
/* We don't have support for UINT push constants yet, use INT instead.*/
/* We don't have support for UINT push constants yet, use INT instead. */
BLI_assert(type != Type::UINT);
BLI_assert_msg(name.find("[") == -1,
"Array syntax is forbidden for push constants."
@@ -385,8 +385,8 @@ void MTLStorageBuf::read(void *data)
this->init();
}
/* Device-only storage buffers cannot be read directly and require staging. This path should only
be used for unit testing. */
/* Device-only storage buffers cannot be read directly and require staging.
* This path should only be used for unit testing. */
bool device_only = (usage_ == GPU_USAGE_DEVICE_ONLY);
if (device_only) {
/** Read storage buffer contents via staging buffer. */
+1 -1
View File
@@ -169,7 +169,7 @@ struct MTLSamplerState {
}
};
const MTLSamplerState DEFAULT_SAMPLER_STATE = {GPUSamplerState::default_sampler() /*, 0, 9999*/};
const MTLSamplerState DEFAULT_SAMPLER_STATE = {GPUSamplerState::default_sampler() /*, 0, 9999 */};
class MTLTexture : public Texture {
friend class MTLContext;
+1 -1
View File
@@ -2355,7 +2355,7 @@ void gpu::MTLTexture::ensure_baked()
/** Atomic texture fallback.
* If texture atomic operations are required and are not natively supported, we instead
* allocate a buffer-backed 2D texture and perform atomic operations on this instead. Support
* for 2D Array textures and 3D textures is achieved via packing layers into the 2D texture.*/
* for 2D Array textures and 3D textures is achieved via packing layers into the 2D texture. */
bool native_texture_atomics = MTLBackend::get_capabilities().supports_texture_atomics;
if ((gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_ATOMIC) && !native_texture_atomics) {
+2 -2
View File
@@ -314,9 +314,9 @@ static void detect_workarounds()
GLContext::framebuffer_fetch_support = false;
GLContext::texture_barrier_support = false;
#if 0
/* Do not alter OpenGL 4.3 features.
* These code paths should be removed. */
/*
GCaps.shader_image_load_store_support = false;
GLContext::base_instance_support = false;
GLContext::copy_image_support = false;
@@ -327,7 +327,7 @@ static void detect_workarounds()
GLContext::texture_gather_support = false;
GLContext::texture_storage_support = false;
GLContext::vertex_attrib_binding_support = false;
*/
#endif
return;
}
+1 -1
View File
@@ -276,7 +276,7 @@ void GLFrameBuffer::subpass_transition(const GPUAttachmentState depth_attachment
* to unbind the textures and update the frame-buffer. This is a slow operation but that's all
* we can do to emulate the sub-pass input. */
/* TODO(@fclem): Could avoid the frame-buffer reconfiguration by creating multiple
* frame-buffers internally. */
* frame-buffers internally. */
for (int i : color_attachment_states.index_range()) {
GPUAttachmentType type = GPU_FB_COLOR_ATTACHMENT0 + i;
@@ -45,7 +45,8 @@ class VKCommandBuffers : public NonCopyable, NonMovable {
VKFrameBuffer *framebuffer_ = nullptr;
bool framebuffer_bound_ = false;
/* TODO: General command buffer should not be used, but is added to help during the transition.*/
/* TODO: General command buffer should not be used, but is added to help during the transition.
*/
VKCommandBuffer buffers_[(int)Type::Max];
VKSubmissionID submission_id_;
@@ -254,7 +254,7 @@ const ShaderInput *VKShaderInterface::shader_input_get(
case shader::ShaderCreateInfo::Resource::BindType::IMAGE:
/* Not really nice, but the binding namespace between OpenGL and Vulkan don't match. To fix
* this we need to check if one of both cases return a binding.
* TODO: we might want to introduce a different API to fix this. */
* TODO: we might want to introduce a different API to fix this. */
return texture_get((binding >= image_offset_) ? binding : binding + image_offset_);
case shader::ShaderCreateInfo::Resource::BindType::SAMPLER:
return texture_get(binding);
@@ -214,7 +214,7 @@ static void initialize_posetree(Object * /*ob*/, bPoseChannel *pchan_tip)
pchan_root->flag |= POSE_IKTREE;
/* Per bone only one active IK constraint is supported. Inactive constraints still need to be
* added for the depsgraph to evaluate properly.*/
* added for the depsgraph to evaluate properly. */
if (constraint->enforce != 0.0 && !(constraint->flag & CONSTRAINT_OFF)) {
break;
}
@@ -533,7 +533,7 @@ TEST_F(ply_exporter_ply_data_test, CubesVertexAttrs)
PlyData plyData = load_ply_data_from_blendfile(
"io_tests/blend_geometry/cubes_vertex_attrs.blend", params);
EXPECT_EQ(plyData.vertices.size(), 28);
EXPECT_EQ(plyData.vertex_custom_attr.size(), 11); /* Float 1 + Color 4 + ByteColor 4 + Int2D 2*/
EXPECT_EQ(plyData.vertex_custom_attr.size(), 11); /* Float 1 + Color 4 + ByteColor 4 + Int2D 2 */
EXPECT_EQ(plyData.vertex_custom_attr[0].data.size(), 28);
}
@@ -104,7 +104,7 @@ static void rna_NodeSocket_draw_color_simple(const bNodeSocketType *socket_type,
void *ret;
func = &rna_NodeSocket_draw_color_simple_func; /* RNA_struct_find_function(&ptr,
"draw_color_simple"); */
* "draw_color_simple"); */
PointerRNA ptr = RNA_pointer_create(nullptr, socket_type->ext_socket.srna, nullptr);
RNA_parameter_list_create(&list, &ptr, func);
@@ -64,7 +64,7 @@ struct EffectInfo {
int inputs;
};
/* These wrap strangely, disable formatting for fixed indentation and wrapping. */
/* These wrap strangely, disable formatting for fixed indentation and wrapping. */
/* clang-format off */
#define RNA_ENUM_SEQUENCER_VIDEO_MODIFIER_TYPE_ITEMS \
{seqModifierType_BrightContrast, "BRIGHT_CONTRAST", ICON_NONE, "Brightness/Contrast", ""}, \
@@ -42,7 +42,7 @@ static int gpu_shader_bevel(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node isn't supported by MaterialX.*/
/* NOTE: This node isn't supported by MaterialX. */
return get_input_link("Normal", NodeItem::Type::Vector3);
}
#endif
@@ -50,13 +50,14 @@ NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* TODO: This node doesn't have an implementation in MaterialX 1.38.6.
* It's added in MaterialX 1.38.8. Uncomment this code after switching to 1.38.8.
*
* NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
* It's added in MaterialX 1.38.8. Uncomment this code after switching to 1.38.8. */
# if 0
NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
* NodeItem res = create_node("blackbody", NodeItem::Type::Color3);
* res.set_input("temperature", temperature);
* return res; */
NodeItem res = create_node("blackbody", NodeItem::Type::Color3);
res.set_input("temperature", temperature);
return res;
# endif
NodeItem res = empty();
return res;
}
@@ -29,7 +29,7 @@ static int gpu_shader_camera(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node doesn't have an implementation in MaterialX.*/
/* NOTE: This node doesn't have an implementation in MaterialX. */
return get_output_default(socket_out_->name, NodeItem::Type::Any);
}
#endif
@@ -40,7 +40,7 @@ static int gpu_shader_displacement(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Normal input and Space feature don't have an implementation in MaterialX.*/
/* NOTE: Normal input and Space feature don't have an implementation in MaterialX. */
NodeItem midlevel = get_input_value("Midlevel", NodeItem::Type::Float);
NodeItem height = get_input_value("Height", NodeItem::Type::Float) - midlevel;
NodeItem scale = get_input_value("Scale", NodeItem::Type::Float);
@@ -61,7 +61,7 @@ static int node_shader_gpu_geometry(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Some outputs aren't supported by MaterialX.*/
/* NOTE: Some outputs aren't supported by MaterialX. */
NodeItem res = empty();
std::string name = socket_out_->name;
@@ -32,7 +32,7 @@ static int node_shader_gpu_hair_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node doesn't have an implementation in MaterialX.*/
/* NOTE: This node doesn't have an implementation in MaterialX. */
return get_output_default(socket_out_->name, NodeItem::Type::Any);
}
#endif
@@ -33,7 +33,7 @@ static int node_shader_gpu_object_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Some outputs isn't supported by MaterialX.*/
/* NOTE: Some outputs isn't supported by MaterialX. */
NodeItem res = empty();
std::string name = socket_out_->name;
@@ -37,7 +37,7 @@ static int gpu_shader_particle_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node isn't supported by MaterialX.*/
/* NOTE: This node isn't supported by MaterialX. */
return get_output_default(socket_out_->name, NodeItem::Type::Any);
}
#endif
@@ -25,7 +25,7 @@ static int node_shader_gpu_point_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node isn't supported by MaterialX.*/
/* NOTE: This node isn't supported by MaterialX. */
return get_output_default(socket_out_->name, NodeItem::Type::Any);
}
#endif
@@ -74,7 +74,7 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Some outputs aren't supported by MaterialX.*/
/* NOTE: Some outputs aren't supported by MaterialX. */
NodeItem res = empty();
std::string name = socket_out_->name;
@@ -410,7 +410,7 @@ static void sh_node_noise_build_multi_function(NodeMultiFunctionBuilder &builder
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Some inputs aren't supported by MaterialX.*/
/* NOTE: Some inputs aren't supported by MaterialX. */
NodeItem scale = get_input_value("Scale", NodeItem::Type::Float);
NodeItem detail = get_input_default("Detail", NodeItem::Type::Float);
NodeItem lacunarity = get_input_value("Lacunarity", NodeItem::Type::Float);
@@ -44,7 +44,7 @@ static int gpu_shader_vector_displacement(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: Midlevel input and Space feature don't have an implementation in MaterialX.*/
/* NOTE: Mid-level input and Space feature don't have an implementation in MaterialX. */
// NodeItem midlevel = get_input_value("midlevel", NodeItem::Type::Float);
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector3);
NodeItem scale = get_input_value("Scale", NodeItem::Type::Float);
@@ -155,7 +155,7 @@ NODE_SHADER_MATERIALX_BEGIN
fromspace = "object";
break;
default:
/* NOTE: SHD_VECT_TRANSFORM_SPACE_CAMERA don't have an implementation in MaterialX.*/
/* NOTE: SHD_VECT_TRANSFORM_SPACE_CAMERA don't have an implementation in MaterialX. */
BLI_assert_unreachable();
return vector;
}
@@ -168,7 +168,7 @@ NODE_SHADER_MATERIALX_BEGIN
tospace = "object";
break;
default:
/* NOTE: SHD_VECT_TRANSFORM_SPACE_CAMERA don't have an implementation in MaterialX.*/
/* NOTE: SHD_VECT_TRANSFORM_SPACE_CAMERA don't have an implementation in MaterialX. */
BLI_assert_unreachable();
return vector;
}
@@ -43,7 +43,7 @@ static int node_shader_gpu_wireframe(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX
{
/* NOTE: This node isn't supported by MaterialX.*/
/* NOTE: This node isn't supported by MaterialX. */
return get_output_default(socket_out_->name, NodeItem::Type::Float);
}
#endif
@@ -507,13 +507,13 @@ static int seq_retiming_clamp_create_offset(SeqRetimingKey *key, int offset)
return min_iii(offset, prev_dist - 1, next_dist - 1);
}
/* First offset old key, then add new key to original place with same fac
This is not great way to do things, but it's done in order to be able to freeze last key. */
SeqRetimingKey *SEQ_retiming_add_freeze_frame(const Scene *scene,
Sequence *seq,
SeqRetimingKey *key,
const int offset)
{
/* First offset old key, then add new key to original place with same fac
* This is not great way to do things, but it's done in order to be able to freeze last key. */
if (SEQ_retiming_key_is_transition_type(key)) {
return nullptr;
}
@@ -1066,7 +1066,7 @@ static void playanim_change_frame(PlayState *ps)
int sizex, sizey;
playanim_window_get_size(ps->ghost_data.window, &sizex, &sizey);
const int i_last = static_cast<PlayAnimPict *>(ps->picsbase.last)->frame;
/* Without this the frame-indicator location isn't closest to the cursor. */
/* Without this the frame-indicator location isn't closest to the cursor. */
const int correct_rounding = (sizex / i_last) / 2;
const int i = clamp_i((i_last * (ps->frame_cursor_x + correct_rounding)) / sizex, 0, i_last);
@@ -1731,7 +1731,7 @@ static bool wm_window_timers_process(const bContext *C, int *sleep_us_p)
bool has_event = false;
const int sleep_us = *sleep_us_p;
/* The nearest time an active timer is scheduled to run. */
/* The nearest time an active timer is scheduled to run. */
double ntime_min = DBL_MAX;
/* Mutable in case the timer gets removed. */