Cleanup: comment block formatting
This commit is contained in:
@@ -535,7 +535,7 @@ static GHOST_TSuccess getGraphicQueueFamily(VkPhysicalDevice device, uint32_t *r
|
||||
for (const auto &queue_family : queue_families) {
|
||||
/* Every vulkan implementation by spec must have one queue family that support both graphics
|
||||
* and compute pipelines. We select this one; compute only queue family hints at async compute
|
||||
* implementations.*/
|
||||
* implementations. */
|
||||
if ((queue_family.queueFlags & VK_QUEUE_GRAPHICS_BIT) &&
|
||||
(queue_family.queueFlags & VK_QUEUE_COMPUTE_BIT)) {
|
||||
return GHOST_kSuccess;
|
||||
|
||||
@@ -162,9 +162,9 @@ void BKE_nlastrips_sort_strips(ListBase *strips);
|
||||
void BKE_nlastrips_add_strip_unsafe(ListBase *strips, struct NlaStrip *strip);
|
||||
|
||||
/**
|
||||
* NULL checks incoming strip and verifies no overlap / invalid
|
||||
* configuration against other strips in NLA Track before calling
|
||||
* #BKE_nlastrips_add_strip_unsafe.
|
||||
* NULL checks incoming strip and verifies no overlap / invalid
|
||||
* configuration against other strips in NLA Track before calling
|
||||
* #BKE_nlastrips_add_strip_unsafe.
|
||||
*/
|
||||
bool BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
|
||||
|
||||
|
||||
@@ -3287,7 +3287,7 @@ static bool is_action_track_evaluated_without_nla(const AnimData *adt,
|
||||
* sure why. Preferably, it would be as simple as checking for `(adt->act_Track == nlt)` but that
|
||||
* doesn't work either, neither does comparing indices.
|
||||
*
|
||||
* This function is a temporary work around. The first disabled track is always the tweaked track.
|
||||
* This function is a temporary work around. The first disabled track is always the tweaked track.
|
||||
*/
|
||||
static NlaTrack *nlatrack_find_tweaked(const AnimData *adt)
|
||||
{
|
||||
|
||||
@@ -211,7 +211,8 @@ void adapt_mesh_domain_corner_to_point_impl(const Mesh &mesh,
|
||||
|
||||
/* Deselect loose vertices without corners that are still selected from the 'true' default. */
|
||||
/* The record fact says that the value is true.
|
||||
*Writing to the array from different threads is okay because each thread sets the same value. */
|
||||
* Writing to the array from different threads is okay because each thread sets the same value.
|
||||
*/
|
||||
threading::parallel_for(loose_verts.index_range(), 2048, [&](const IndexRange range) {
|
||||
for (const int vert_index : range) {
|
||||
if (loose_verts[vert_index]) {
|
||||
|
||||
@@ -1015,12 +1015,14 @@ bool BKE_gpencil_stroke_smooth_point(bGPDstroke *gps,
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Overview of the algorithm here and in the following smooth functions:
|
||||
* The smooth functions return the new attribute in question for a single point.
|
||||
* The result is stored in r_gps->points[point_index], while the data is read from gps.
|
||||
* To get a correct result, duplicate the stroke point data and read from the copy,
|
||||
* while writing to the real stroke. Not doing that will result in acceptable, but
|
||||
* asymmetric results.
|
||||
/* - Overview of the algorithm here and in the following smooth functions:
|
||||
*
|
||||
* The smooth functions return the new attribute in question for a single point.
|
||||
* The result is stored in r_gps->points[point_index], while the data is read from gps.
|
||||
* To get a correct result, duplicate the stroke point data and read from the copy,
|
||||
* while writing to the real stroke. Not doing that will result in acceptable, but
|
||||
* asymmetric results.
|
||||
*
|
||||
* This algorithm works as long as all points are being smoothed. If there is
|
||||
* points that should not get smoothed, use the old repeat smooth pattern with
|
||||
* the parameter "iterations" set to 1 or 2. (2 matches the old algorithm).
|
||||
@@ -3237,7 +3239,7 @@ bGPDstroke *BKE_gpencil_stroke_delete_tagged_points(bGPdata *gpd,
|
||||
|
||||
pts = new_stroke->points;
|
||||
for (j = 0; j < new_stroke->totpoints; j++, pts++) {
|
||||
/* Some points have time = 0, so check to not get negative time values.*/
|
||||
/* Some points have time = 0, so check to not get negative time values. */
|
||||
pts->time = max_ff(pts->time - delta, 0.0f);
|
||||
/* set flag for select again later */
|
||||
if (select == true) {
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
/* NOTE: The implementation for Apple lives in storage_apple.mm. */
|
||||
#if !defined(__APPLE__)
|
||||
/* The implementation for Apple lives in storage_apple.mm.*/
|
||||
bool BLI_change_working_dir(const char *dir)
|
||||
{
|
||||
BLI_assert(BLI_thread_is_main());
|
||||
|
||||
@@ -189,7 +189,7 @@ const char *BLI_expand_tilde(const char *path_with_tilde)
|
||||
|
||||
char *BLI_current_working_dir(char *dir, const size_t maxncpy)
|
||||
{
|
||||
/* Can't just copy to the *dir pointer, as [path getCString gets grumpy.*/
|
||||
/* Can't just copy to the *dir pointer, as [path getCString gets grumpy. */
|
||||
char path_expanded[PATH_MAX];
|
||||
@autoreleasepool {
|
||||
NSString *path = [[NSFileManager defaultManager] currentDirectoryPath];
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
namespace blender::compositor {
|
||||
|
||||
/**
|
||||
* \brief The BokehImageOperation class is an operation that creates an image useful to mimic the
|
||||
*internals of a camera.
|
||||
* \brief The #BokehImageOperation class is an operation that creates an image useful to mimic the
|
||||
* internals of a camera.
|
||||
*
|
||||
* features:
|
||||
* - number of flaps
|
||||
@@ -19,20 +19,20 @@ namespace blender::compositor {
|
||||
* - simulate lens-shift
|
||||
*
|
||||
* Per pixel the algorithm determines the edge of the bokeh on the same line as the center of the
|
||||
*image and the pixel is evaluating.
|
||||
* image and the pixel is evaluating.
|
||||
*
|
||||
* The edge is detected by finding the closest point on the direct line between the two nearest
|
||||
*flap-corners. this edge is interpolated with a full circle. Result of this edge detection is
|
||||
*stored as the distance between the center of the image and the edge.
|
||||
* flap-corners. this edge is interpolated with a full circle. Result of this edge detection is
|
||||
* stored as the distance between the center of the image and the edge.
|
||||
*
|
||||
* catadioptric lenses are simulated to interpolate between the center of the image and the
|
||||
*distance of the edge. We now have three distances:
|
||||
* - distance between the center of the image and the pixel to be evaluated
|
||||
* - distance between the center of the image and the outer-edge
|
||||
* - distance between the center of the image and the inner-edge
|
||||
*
|
||||
* distance of the edge. We now have three distances:
|
||||
* - Distance between the center of the image and the pixel to be evaluated.
|
||||
* - Distance between the center of the image and the outer-edge.
|
||||
* - Distance between the center of the image and the inner-edge.
|
||||
|
||||
* With a simple compare it can be detected if the evaluated pixel is between the outer and inner
|
||||
*edge.
|
||||
* edge.
|
||||
*/
|
||||
class BokehImageOperation : public MultiThreadedOperation {
|
||||
private:
|
||||
@@ -105,7 +105,7 @@ class BokehImageOperation : public MultiThreadedOperation {
|
||||
void init_execution() override;
|
||||
|
||||
/**
|
||||
* \brief Deinitialize the execution
|
||||
* \brief De-initialize the execution
|
||||
*/
|
||||
void deinit_execution() override;
|
||||
|
||||
|
||||
@@ -1400,7 +1400,7 @@ struct GPUMaterial *EEVEE_material_get(
|
||||
case GPU_MAT_QUEUED: {
|
||||
vedata->stl->g_data->queued_shaders_count++;
|
||||
GPUMaterial *default_mat = EEVEE_material_default_get(scene, ma, options);
|
||||
/* Mark pending material with its default material for future cache warming.*/
|
||||
/* Mark pending material with its default material for future cache warming. */
|
||||
GPU_material_set_default(mat, default_mat);
|
||||
/* Return default material. */
|
||||
mat = default_mat;
|
||||
|
||||
@@ -440,7 +440,7 @@ void ShadowDirectional::cascade_tilemaps_distribution(Light &light, const Camera
|
||||
|
||||
/* The bias is applied in cascade_level_range().
|
||||
* Using clipmap_lod_min here simplify code in shadow_directional_level().
|
||||
* Minus 1 because of the ceil().*/
|
||||
* Minus 1 because of the ceil(). */
|
||||
light._clipmap_lod_bias = light.clipmap_lod_min - 1;
|
||||
|
||||
/* Scaling is handled by ShadowCoordinates.lod_relative. */
|
||||
|
||||
@@ -2337,7 +2337,7 @@ void uiTemplateModifiers(uiLayout * /*layout*/, bContext *C)
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Constraints Template
|
||||
*
|
||||
* Template for building the panel layout for the active object or bone's constraints.
|
||||
* Template for building the panel layout for the active object or bone's constraints.
|
||||
* \{ */
|
||||
|
||||
/** For building the panel UI for constraints. */
|
||||
|
||||
@@ -1896,12 +1896,13 @@ void SCULPT_ensure_valid_pivot(const Object *ob, Scene *scene);
|
||||
/* Ensures vertex island keys exist and are valid. */
|
||||
void SCULPT_topology_islands_ensure(Object *ob);
|
||||
|
||||
/* Mark vertex island keys as invalid. Call when adding or hiding
|
||||
* geometry.
|
||||
/**
|
||||
* Mark vertex island keys as invalid.
|
||||
* Call when adding or hiding geometry.
|
||||
*/
|
||||
void SCULPT_topology_islands_invalidate(SculptSession *ss);
|
||||
|
||||
/* Get vertex island key.*/
|
||||
/** Get vertex island key. */
|
||||
int SCULPT_vertex_island_get(SculptSession *ss, PBVHVertRef vertex);
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -593,7 +593,7 @@ static void draw_fcurve_curve(bAnimContext *ac,
|
||||
*
|
||||
* If the automatically determined sampling frequency is likely to cause an infinite
|
||||
* loop (i.e. too close to 0), then clamp it to a determined "safe" value. The value
|
||||
* chosen here is just the coarsest value which still looks reasonable...
|
||||
* chosen here is just the coarsest value which still looks reasonable.
|
||||
*/
|
||||
|
||||
/* TODO: perhaps we should have 1.0 frames
|
||||
|
||||
@@ -107,10 +107,8 @@ static void nearest_fcurve_vert_store(ListBase *matches,
|
||||
int screen_co[2], dist;
|
||||
|
||||
/* convert from data-space to screen coordinates
|
||||
* NOTE: hpoint+1 gives us 0,1,2 respectively for each handle,
|
||||
* needed to access the relevant vertex coordinates in the 3x3
|
||||
* 'vec' matrix
|
||||
*/
|
||||
* NOTE: `hpoint +1` gives us 0,1,2 respectively for each handle,
|
||||
* needed to access the relevant vertex coordinates in the 3x3 'vec' matrix */
|
||||
if (UI_view2d_view_to_region_clip(v2d,
|
||||
bezt->vec[hpoint + 1][0],
|
||||
(bezt->vec[hpoint + 1][1] + offset) * unit_scale,
|
||||
|
||||
@@ -3724,13 +3724,14 @@ using GeoUVPinIndex = struct GeoUVPinIndex {
|
||||
ParamKey reindex;
|
||||
};
|
||||
|
||||
/* Find a (mostly) unique ParamKey given a BMVert index and UV co-ordinates.
|
||||
* For each unique pinned UVs, return a unique ParamKey, starting with
|
||||
* a very large number, and decreasing steadily from there.
|
||||
* For non-pinned UVs which share a BMVert with a pinned UV,
|
||||
* return the index corresponding to the closest pinned UV.
|
||||
* For everything else, just return the BMVert index.
|
||||
* Note that ParamKeys will eventually be hashed, so they don't need to be contiguous.
|
||||
/**
|
||||
* Find a (mostly) unique #ParamKey given a #BMVert index and UV co-ordinates.
|
||||
* For each unique pinned UVs, return a unique #ParamKey, starting with
|
||||
* a very large number, and decreasing steadily from there.
|
||||
* For non-pinned UVs which share a #BMVert with a pinned UV,
|
||||
* return the index corresponding to the closest pinned UV.
|
||||
* For everything else, just return the #BMVert index.
|
||||
* Note that #ParamKeys will eventually be hashed, so they don't need to be contiguous.
|
||||
*/
|
||||
ParamKey GEO_uv_find_pin_index(ParamHandle *handle, const int bmvertindex, const float uv[2])
|
||||
{
|
||||
|
||||
@@ -254,9 +254,9 @@ void GPU_materials_free(struct Main *bmain);
|
||||
|
||||
struct Scene *GPU_material_scene(GPUMaterial *material);
|
||||
struct GPUPass *GPU_material_get_pass(GPUMaterial *material);
|
||||
/* Return the most optimal shader configuration for the given material .*/
|
||||
/** Return the most optimal shader configuration for the given material. */
|
||||
struct GPUShader *GPU_material_get_shader(GPUMaterial *material);
|
||||
/* Return the base un-optimized shader. */
|
||||
/** Return the base un-optimized shader. */
|
||||
struct GPUShader *GPU_material_get_shader_base(GPUMaterial *material);
|
||||
const char *GPU_material_get_name(GPUMaterial *material);
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ class GPUCodegen {
|
||||
bool should_optimize_heuristic() const
|
||||
{
|
||||
/* If each of the maximal attributes are exceeded, we can optimize, but we should also ensure
|
||||
* the baseline is met.*/
|
||||
* the baseline is met. */
|
||||
bool do_optimize = (nodes_total_ >= 60 || textures_total_ >= 4 || uniforms_total_ >= 64) &&
|
||||
(textures_total_ >= 1 && uniforms_total_ >= 8 && nodes_total_ >= 4);
|
||||
return do_optimize;
|
||||
|
||||
@@ -291,8 +291,10 @@ struct StageInterfaceInfo {
|
||||
};
|
||||
|
||||
StringRefNull name;
|
||||
/** Name of the instance of the block (used to access).
|
||||
* Can be empty string (i.e: "") only if not using geometry shader. */
|
||||
/**
|
||||
* Name of the instance of the block (used to access).
|
||||
* Can be empty string (i.e: "") only if not using geometry shader.
|
||||
*/
|
||||
StringRefNull instance_name;
|
||||
/** List of all members of the interface. */
|
||||
Vector<InOut> inouts;
|
||||
|
||||
@@ -155,7 +155,7 @@ static void gpu_viewport_textures_create(GPUViewport *viewport)
|
||||
|
||||
/* Can be shared with GPUOffscreen. */
|
||||
if (viewport->depth_tx == NULL) {
|
||||
/* Depth texture can be read back by gizmos #view3d_depths_create .*/
|
||||
/* Depth texture can be read back by gizmos #view3d_depths_create. */
|
||||
viewport->depth_tx = GPU_texture_create_2d("dtxl_depth",
|
||||
UNPACK2(size),
|
||||
1,
|
||||
|
||||
@@ -1527,7 +1527,7 @@ void MTLContext::ensure_texture_bindings(
|
||||
int compute_arg_buffer_bind_index = -1;
|
||||
|
||||
/* Argument buffers are used for samplers, when the limit of 16 is exceeded.
|
||||
* NOTE: Compute uses vertex argument for arg buffer bind index.*/
|
||||
* NOTE: Compute uses vertex argument for arg buffer bind index. */
|
||||
bool use_argument_buffer_for_samplers = shader_interface->uses_argument_buffer_for_samplers();
|
||||
compute_arg_buffer_bind_index = shader_interface->get_argument_buffer_bind_index(
|
||||
ShaderStage::COMPUTE);
|
||||
|
||||
@@ -252,31 +252,32 @@ struct CompareMTLBuffer {
|
||||
}
|
||||
};
|
||||
|
||||
/* An MTLSafeFreeList is a temporary list of gpu::MTLBuffers which have
|
||||
/**
|
||||
* An #MTLSafeFreeList is a temporary list of #gpu::MTLBuffers which have
|
||||
* been freed by the high level backend, but are pending GPU work execution before
|
||||
* the gpu::MTLBuffers can be returned to the Memory manager pools.
|
||||
* the #gpu::MTLBuffers can be returned to the Memory manager pools.
|
||||
* This list is implemented as a chunked linked-list.
|
||||
*
|
||||
* Only a single MTLSafeFreeList is active at one time and is associated with current command
|
||||
* buffer submissions. If an MTLBuffer is freed during the lifetime of a command buffer, it could
|
||||
* still possibly be in-use and as such, the MTLSafeFreeList will increment its reference count for
|
||||
* each command buffer submitted while the current pool is active.
|
||||
* Only a single #MTLSafeFreeList is active at one time and is associated with current command
|
||||
* buffer submissions. If an #MTLBuffer is freed during the lifetime of a command buffer, it could
|
||||
* still possibly be in-use and as such, the #MTLSafeFreeList will increment its reference count
|
||||
* for each command buffer submitted while the current pool is active.
|
||||
*
|
||||
* -- Reference count is incremented upon MTLCommandBuffer commit.
|
||||
* -- Reference count is decremented in the MTLCommandBuffer completion callback handler.
|
||||
* - Reference count is incremented upon #MTLCommandBuffer commit.
|
||||
* - Reference count is decremented in the #MTLCommandBuffer completion callback handler.
|
||||
*
|
||||
* A new MTLSafeFreeList will begin each render step (frame). This pooling of buffers, rather than
|
||||
* A new #MTLSafeFreeList will begin each render step (frame). This pooling of buffers, rather than
|
||||
* individual buffer resource tracking reduces performance overhead.
|
||||
*
|
||||
* * The reference count starts at 1 to ensure that the reference count cannot prematurely reach
|
||||
* zero until any command buffers have been submitted. This additional decrement happens
|
||||
* when the next MTLSafeFreeList is created, to allow the existing pool to be released once
|
||||
* the reference count hits zero after submitted command buffers complete.
|
||||
* - The reference count starts at 1 to ensure that the reference count cannot prematurely reach
|
||||
* zero until any command buffers have been submitted. This additional decrement happens
|
||||
* when the next #MTLSafeFreeList is created, to allow the existing pool to be released once
|
||||
* the reference count hits zero after submitted command buffers complete.
|
||||
*
|
||||
* NOTE: the Metal API independently tracks resources used by command buffers for the purpose of
|
||||
* keeping resources alive while in-use by the driver and CPU, however, this differs from the
|
||||
* MTLSafeFreeList mechanism in the Metal backend, which exists for the purpose of allowing
|
||||
* previously allocated MTLBuffer resources to be re-used. This allows us to save on the expensive
|
||||
* #MTLSafeFreeList mechanism in the Metal backend, which exists for the purpose of allowing
|
||||
* previously allocated #MTLBuffer resources to be re-used. This allows us to save on the expensive
|
||||
* cost of memory allocation.
|
||||
*/
|
||||
class MTLSafeFreeList {
|
||||
|
||||
@@ -788,7 +788,7 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format,
|
||||
}
|
||||
else if (shader_attrib_format == MTLVertexFormatUInt && component_length == 4) {
|
||||
/* Special case here, format has been specified as GPU_COMP_U8 with 4 components, which
|
||||
*is equivalent to a UInt-- so data will be compatible with shader interface. */
|
||||
* is equivalent to a UInt-- so data will be compatible with shader interface. */
|
||||
out_vert_format = MTLVertexFormatUInt;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1269,7 +1269,7 @@ bool MTLShader::bake_compute_pipeline_state(MTLContext *ctx)
|
||||
* specialization constant, customized per unique pipeline state permutation.
|
||||
*
|
||||
* For Compute shaders, this offset is always zero, but this needs setting as
|
||||
* it is expected as part of the common Metal shader header.*/
|
||||
* it is expected as part of the common Metal shader header. */
|
||||
int MTL_uniform_buffer_base_index = 0;
|
||||
[values setConstantValue:&MTL_uniform_buffer_base_index
|
||||
type:MTLDataTypeInt
|
||||
|
||||
@@ -353,8 +353,8 @@ class MTLTexture : public Texture {
|
||||
*
|
||||
* blender::map<INPUT DEFINES STRUCT, compute PSO> update_2d_array_kernel_psos;
|
||||
* - Generate compute shader with configured kernel below with variable parameters depending
|
||||
* on input/output format configurations. Do not need to keep source or descriptors around,
|
||||
* just PSO, as same input defines will always generate the same code.
|
||||
* on input/output format configurations. Do not need to keep source or descriptors around,
|
||||
* just PSO, as same input defines will always generate the same code.
|
||||
*
|
||||
* - IF datatype IS an exact match e.g. :
|
||||
* - Per-component size matches (e.g. GPU_DATA_UBYTE)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
void main()
|
||||
{
|
||||
/* NOTE(Metal): Declaring constant array in function scope to avoid increasing local shader
|
||||
* memory pressure.*/
|
||||
* memory pressure. */
|
||||
const vec2 cornervec[36] = vec2[36](vec2(0.0, 1.0),
|
||||
vec2(0.02, 0.805),
|
||||
vec2(0.067, 0.617),
|
||||
|
||||
@@ -6,7 +6,7 @@ void main()
|
||||
|
||||
/* transparent outside of point
|
||||
* --- 0 ---
|
||||
* smooth transition
|
||||
* smooth transition
|
||||
* --- 1 ---
|
||||
* pure point color
|
||||
* ...
|
||||
|
||||
@@ -73,7 +73,7 @@ void main()
|
||||
|
||||
if (interp_size == 1) {
|
||||
/* NOTE(Metal): Declaring constant array in function scope to avoid increasing local shader
|
||||
* memory pressure.*/
|
||||
* memory pressure. */
|
||||
const vec2 offsets4[4] = vec2[4](
|
||||
vec2(-0.5, 0.5), vec2(0.5, 0.5), vec2(-0.5, -0.5), vec2(-0.5, -0.5));
|
||||
|
||||
@@ -87,7 +87,7 @@ void main()
|
||||
}
|
||||
else {
|
||||
/* NOTE(Metal): Declaring constant array in function scope to avoid increasing local shader
|
||||
* memory pressure.*/
|
||||
* memory pressure. */
|
||||
const vec2 offsets16[16] = vec2[16](vec2(-1.5, 1.5),
|
||||
vec2(-0.5, 1.5),
|
||||
vec2(0.5, 1.5),
|
||||
|
||||
@@ -37,7 +37,7 @@ static void test_gpu_storage_buffer_create_update_read()
|
||||
read_data.resize(SIZE, 0);
|
||||
GPU_storagebuf_read(ssbo, read_data.data());
|
||||
|
||||
/* Check if data is the same.*/
|
||||
/* Check if data is the same. */
|
||||
for (int i : IndexRange(SIZE)) {
|
||||
EXPECT_EQ(data[i], read_data[i]);
|
||||
}
|
||||
@@ -47,4 +47,4 @@ static void test_gpu_storage_buffer_create_update_read()
|
||||
|
||||
GPU_TEST(gpu_storage_buffer_create_update_read);
|
||||
|
||||
} // namespace blender::gpu::tests
|
||||
} // namespace blender::gpu::tests
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace blender::gpu {
|
||||
class VKBuffer;
|
||||
class VKTexture;
|
||||
|
||||
/** Command buffer to keep track of the life-time of a command buffer.*/
|
||||
/** Command buffer to keep track of the life-time of a command buffer. */
|
||||
class VKCommandBuffer : NonCopyable, NonMovable {
|
||||
/** None owning handle to the command buffer and device. Handle is owned by `GHOST_ContextVK`.*/
|
||||
/** None owning handle to the command buffer and device. Handle is owned by `GHOST_ContextVK`. */
|
||||
VkDevice vk_device_ = VK_NULL_HANDLE;
|
||||
VkCommandBuffer vk_command_buffer_ = VK_NULL_HANDLE;
|
||||
VkQueue vk_queue_ = VK_NULL_HANDLE;
|
||||
|
||||
@@ -298,7 +298,7 @@ VkImageViewType to_vk_image_view_type(const eGPUTextureType type)
|
||||
VkComponentMapping to_vk_component_mapping(const eGPUTextureFormat /*format*/)
|
||||
{
|
||||
/* TODO: this should map to OpenGL defaults based on the eGPUTextureFormat. The implementation of
|
||||
* this function will be implemented when implementing other parts of VKTexture.*/
|
||||
* this function will be implemented when implementing other parts of VKTexture. */
|
||||
VkComponentMapping component_mapping;
|
||||
component_mapping.r = VK_COMPONENT_SWIZZLE_R;
|
||||
component_mapping.g = VK_COMPONENT_SWIZZLE_G;
|
||||
|
||||
@@ -36,7 +36,7 @@ VKContext::VKContext(void *ghost_window, void *ghost_context)
|
||||
VmaAllocatorCreateInfo info = {};
|
||||
/* Should use same vulkan version as GHOST (1.2), but set to 1.0 as 1.2 requires
|
||||
* correct extensions and functions to be found by VMA, which isn't working as expected and
|
||||
* requires more research. To continue development we lower the API to version 1.0.*/
|
||||
* requires more research. To continue development we lower the API to version 1.0. */
|
||||
info.vulkanApiVersion = VK_API_VERSION_1_0;
|
||||
info.physicalDevice = vk_physical_device_;
|
||||
info.device = vk_device_;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace blender::gpu {
|
||||
VKDescriptorSet::~VKDescriptorSet()
|
||||
{
|
||||
if (vk_descriptor_set_ != VK_NULL_HANDLE) {
|
||||
/* Handle should be given back to the pool.*/
|
||||
/* Handle should be given back to the pool. */
|
||||
VKContext &context = *VKContext::get();
|
||||
context.descriptor_pools_get().free(*this);
|
||||
BLI_assert(vk_descriptor_set_ == VK_NULL_HANDLE);
|
||||
|
||||
@@ -102,7 +102,7 @@ class VKDescriptorSet : NonCopyable {
|
||||
VkDescriptorPool vk_descriptor_pool_ = VK_NULL_HANDLE;
|
||||
VkDescriptorSet vk_descriptor_set_ = VK_NULL_HANDLE;
|
||||
|
||||
/** A list of bindings that needs to be updated.*/
|
||||
/** A list of bindings that needs to be updated. */
|
||||
Vector<Binding> bindings_;
|
||||
|
||||
public:
|
||||
|
||||
@@ -681,7 +681,7 @@ bool VKShader::finalize(const shader::ShaderCreateInfo *info)
|
||||
}
|
||||
|
||||
/* TODO we might need to move the actual pipeline construction to a later stage as the graphics
|
||||
* pipeline requires more data before it can be constructed.*/
|
||||
* pipeline requires more data before it can be constructed. */
|
||||
bool result;
|
||||
if (is_graphics_shader()) {
|
||||
BLI_assert((fragment_module_ != VK_NULL_HANDLE && info->tf_type_ == GPU_SHADER_TFB_NONE) ||
|
||||
|
||||
@@ -40,7 +40,7 @@ void VKShaderInterface::init(const shader::ShaderCreateInfo &info)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Make sure that the image slots don't overlap with the sampler slots.*/
|
||||
/* Make sure that the image slots don't overlap with the sampler slots. */
|
||||
image_offset_++;
|
||||
|
||||
int32_t input_tot_len = ubo_len_ + uniform_len_ + ssbo_len_;
|
||||
@@ -99,7 +99,7 @@ void VKShaderInterface::init(const shader::ShaderCreateInfo &info)
|
||||
builtin_blocks_[u] = (block != nullptr) ? block->binding : -1;
|
||||
}
|
||||
|
||||
/* Determine the descriptor set locations after the inputs have been sorted.*/
|
||||
/* Determine the descriptor set locations after the inputs have been sorted. */
|
||||
descriptor_set_locations_ = Array<VKDescriptorSet::Location>(input_tot_len);
|
||||
uint32_t descriptor_set_location = 0;
|
||||
for (ShaderCreateInfo::Resource &res : all_resources) {
|
||||
|
||||
@@ -52,7 +52,7 @@ void VKTexture::mip_range_set(int /*min*/, int /*max*/)
|
||||
|
||||
void *VKTexture::read(int mip, eGPUDataFormat format)
|
||||
{
|
||||
/* Vulkan images cannot be directly mapped to host memory and requires a staging buffer.*/
|
||||
/* Vulkan images cannot be directly mapped to host memory and requires a staging buffer. */
|
||||
VKContext &context = *VKContext::get();
|
||||
VKBuffer staging_buffer;
|
||||
|
||||
@@ -85,7 +85,7 @@ void *VKTexture::read(int mip, eGPUDataFormat format)
|
||||
|
||||
void *data = MEM_mallocN(host_memory_size, __func__);
|
||||
|
||||
/* TODO: add conversion when data format is different.*/
|
||||
/* TODO: add conversion when data format is different. */
|
||||
BLI_assert_msg(device_memory_size == host_memory_size,
|
||||
"Memory data conversions not implemented yet");
|
||||
|
||||
@@ -120,7 +120,7 @@ bool VKTexture::init_internal()
|
||||
{
|
||||
/* Initialization can only happen after the usage is known. By the current API this isn't set
|
||||
* at this moment, so we cannot initialize here. The initialization is postponed until the
|
||||
* allocation of the texture on the device.*/
|
||||
* allocation of the texture on the device. */
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ bool VKTexture::allocate()
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Promote image to the correct layout.*/
|
||||
/* Promote image to the correct layout. */
|
||||
VkImageMemoryBarrier barrier{};
|
||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||
barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
|
||||
@@ -58,7 +58,7 @@ class VKTexture : public Texture {
|
||||
bool init_internal(const GPUTexture *src, int mip_offset, int layer_offset) override;
|
||||
|
||||
private:
|
||||
/** Is this texture already allocated on device.*/
|
||||
/** Is this texture already allocated on device. */
|
||||
bool is_allocated();
|
||||
/**
|
||||
* Allocate the texture of the device. Result is `true` when texture is successfully allocated
|
||||
|
||||
@@ -117,7 +117,7 @@ struct TransformUserData {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Transform the src_crop to the destination buffer with a margin.*/
|
||||
/* Transform the src_crop to the destination buffer with a margin. */
|
||||
const int2 margin(2);
|
||||
rcti rect;
|
||||
BLI_rcti_init_minmax(&rect);
|
||||
@@ -133,7 +133,7 @@ struct TransformUserData {
|
||||
BLI_rcti_do_minmax_v(&rect, int2(dst_co) - margin);
|
||||
}
|
||||
|
||||
/* Clamp rect to fit inside the image buffer.*/
|
||||
/* Clamp rect to fit inside the image buffer. */
|
||||
rcti dest_rect;
|
||||
BLI_rcti_init(&dest_rect, 0, dst->x, 0, dst->y);
|
||||
BLI_rcti_isect(&rect, &dest_rect, &rect);
|
||||
|
||||
@@ -23,9 +23,9 @@ std::string get_id_name(const Object *const ob);
|
||||
std::string get_valid_abc_name(const char *name);
|
||||
/**
|
||||
* \brief get_object_dag_path_name returns the name under which the object
|
||||
* will be exported in the Alembic file. It is of the form
|
||||
* "[../grandparent/]parent/object" if dupli_parent is NULL, or
|
||||
* "dupli_parent/[../grandparent/]parent/object" otherwise.
|
||||
* will be exported in the Alembic file. It is of the form
|
||||
* "[../grandparent/]parent/object" if dupli_parent is NULL, or
|
||||
* "dupli_parent/[../grandparent/]parent/object" otherwise.
|
||||
* \param ob:
|
||||
* \param dupli_parent:
|
||||
* \return
|
||||
|
||||
@@ -173,9 +173,8 @@ void MaterialNode::set_alpha(COLLADAFW::EffectCommon::OpaqueMode mode,
|
||||
COLLADAFW::ColorOrTexture &cot,
|
||||
COLLADAFW::FloatOrParam &val)
|
||||
{
|
||||
/* Handling the alpha value according to the Collada 1.4 reference guide
|
||||
* see page 7-5 Determining Transparency (Opacity)
|
||||
*/
|
||||
/* Handling the alpha value according to the Collada 1.4 reference guide
|
||||
* see page 7-5 Determining Transparency (Opacity). */
|
||||
|
||||
if (effect == nullptr) {
|
||||
return;
|
||||
|
||||
@@ -248,7 +248,7 @@ void SkinInfo::link_armature(bContext *C,
|
||||
* ^ bone index can be -1 meaning weight toward bind shape, how to express this in Blender?
|
||||
*
|
||||
* for each vertex in weight indices
|
||||
* for each bone index in vertex
|
||||
* for each bone index in vertex
|
||||
* add vertex to group at group index
|
||||
* treat group index -1 specially
|
||||
*
|
||||
|
||||
@@ -213,7 +213,7 @@ static void export_startjob(void *customdata,
|
||||
/* Set the default prim if it doesn't exist */
|
||||
if (!usd_stage->GetDefaultPrim()) {
|
||||
/* Use TraverseAll since it's guaranteed to be depth first and will get the first top level
|
||||
* prim, and is less verbose than getting the PseudoRoot + iterating its children.*/
|
||||
* prim, and is less verbose than getting the PseudoRoot + iterating its children. */
|
||||
for (auto prim : usd_stage->TraverseAll()) {
|
||||
usd_stage->SetDefaultPrim(prim);
|
||||
break;
|
||||
|
||||
@@ -146,8 +146,8 @@ void build_material_map(const Main *bmain, std::map<std::string, Material *> *r_
|
||||
* Returns null if no such material exists.
|
||||
*
|
||||
* \param mat_map Map a material name to a Blender material. Note that the name key
|
||||
* might be the Blender material name modified to be a valid USD identifier,
|
||||
* to match the material names in the imported USD.
|
||||
* might be the Blender material name modified to be a valid USD identifier,
|
||||
* to match the material names in the imported USD.
|
||||
* \param usd_path_to_mat_name Map a USD material path to the imported Blender material name.
|
||||
*
|
||||
* The usd_path_to_mat_name is needed to determine the name of the Blender
|
||||
|
||||
@@ -381,9 +381,9 @@ void USDGenericMeshWriter::assign_materials(const HierarchyContext &context,
|
||||
}
|
||||
|
||||
if (mesh_material_bound) {
|
||||
/* USD will require that prims with material bindings have the MaterialBindingAPI applied
|
||||
/* USD will require that prims with material bindings have the #MaterialBindingAPI applied
|
||||
* schema. While Bind() above will create the binding attribute, Apply() needs to be called as
|
||||
* well to add the MaterialBindingAPI schema to the prim itself.*/
|
||||
* well to add the #MaterialBindingAPI schema to the prim itself. */
|
||||
material_binding_api.Apply(mesh_prim);
|
||||
}
|
||||
else {
|
||||
@@ -416,7 +416,7 @@ void USDGenericMeshWriter::assign_materials(const HierarchyContext &context,
|
||||
auto subset_prim = usd_face_subset.GetPrim();
|
||||
auto subset_material_api = pxr::UsdShadeMaterialBindingAPI(subset_prim);
|
||||
subset_material_api.Bind(usd_material);
|
||||
/* Apply the MaterialBindingAPI applied schema, as required by USD.*/
|
||||
/* Apply the #MaterialBindingAPI applied schema, as required by USD. */
|
||||
subset_material_api.Apply(subset_prim);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,11 +175,11 @@ static const char *parse_vertex_index(const char *p, const char *end, size_t n_e
|
||||
/**
|
||||
* Parse a polyline and add its line segments as loose edges.
|
||||
* We support the following polyline specifications:
|
||||
* - "l v1/vt1 v2/vt2 ..."
|
||||
* - "l v1 v2 ..."
|
||||
* If a line only has one vertex (technically not allowed by the spec),
|
||||
* no line is created, but the vertex will be added to
|
||||
* the mesh even if it is unconnected.
|
||||
* - "l v1/vt1 v2/vt2 ..."
|
||||
* - "l v1 v2 ..."
|
||||
* If a line only has one vertex (technically not allowed by the spec),
|
||||
* no line is created, but the vertex will be added to
|
||||
* the mesh even if it is unconnected.
|
||||
*/
|
||||
static void geom_add_polyline(Geometry *geom,
|
||||
const char *p,
|
||||
|
||||
@@ -272,8 +272,10 @@ enum {
|
||||
/** User cannot change that override operation. */
|
||||
IDOVERRIDE_LIBRARY_FLAG_LOCKED = 1 << 1,
|
||||
|
||||
/** For overrides of ID pointers: this override still matches (follows) the hierarchy of the
|
||||
* reference linked data. */
|
||||
/**
|
||||
* For overrides of ID pointers: this override still matches (follows) the hierarchy of the
|
||||
* reference linked data.
|
||||
*/
|
||||
IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE = 1 << 8,
|
||||
};
|
||||
|
||||
|
||||
@@ -678,8 +678,10 @@ typedef struct bAction {
|
||||
int idroot;
|
||||
char _pad[4];
|
||||
|
||||
/** Start and end of the manually set intended playback frame range. Used by UI and
|
||||
* some editing tools, but doesn't directly affect animation evaluation in any way. */
|
||||
/**
|
||||
* Start and end of the manually set intended playback frame range. Used by UI and
|
||||
* some editing tools, but doesn't directly affect animation evaluation in any way.
|
||||
*/
|
||||
float frame_start, frame_end;
|
||||
|
||||
PreviewImage *preview;
|
||||
|
||||
@@ -374,8 +374,10 @@ typedef enum eDriverTarget_RotationMode {
|
||||
|
||||
DTAR_ROTMODE_QUATERNION,
|
||||
|
||||
/** Implements the very common Damped Track + child trick to decompose
|
||||
* rotation into bending followed by twist around the remaining axis. */
|
||||
/**
|
||||
* Implements the very common Damped Track + child trick to decompose
|
||||
* rotation into bending followed by twist around the remaining axis.
|
||||
*/
|
||||
DTAR_ROTMODE_SWING_TWIST_X,
|
||||
DTAR_ROTMODE_SWING_TWIST_Y,
|
||||
DTAR_ROTMODE_SWING_TWIST_Z,
|
||||
|
||||
@@ -2075,7 +2075,7 @@ static bool get_uv_index_and_layer(const PointerRNA *ptr,
|
||||
}
|
||||
}
|
||||
/* This can happen if the Customdata arrays were re-allocated between obtaining the
|
||||
* python object and accessing it.*/
|
||||
* Python object and accessing it. */
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,11 +105,15 @@ struct SDefBindPoly {
|
||||
float weight_dist_proj;
|
||||
float weight_dist;
|
||||
float weight;
|
||||
/** Distances from the centroid to edges flanking the corner vertex, used to penalize
|
||||
* small or long and narrow faces in favor of bigger and more square ones. */
|
||||
/**
|
||||
* Distances from the centroid to edges flanking the corner vertex, used to penalize
|
||||
* small or long and narrow faces in favor of bigger and more square ones.
|
||||
*/
|
||||
float scales[2];
|
||||
/** Distance weight from the corner vertex to the chord line, used to penalize
|
||||
* cases with the three consecutive vertices being nearly in line. */
|
||||
/**
|
||||
* Distance weight from the corner vertex to the chord line, used to penalize
|
||||
* cases with the three consecutive vertices being nearly in line.
|
||||
*/
|
||||
float scale_mid;
|
||||
/** Center of `coords` */
|
||||
float centroid[3];
|
||||
@@ -119,18 +123,24 @@ struct SDefBindPoly {
|
||||
* The calculated normal of coords (could be shared between faces).
|
||||
*/
|
||||
float normal[3];
|
||||
/** Vectors pointing from the centroid to the midpoints of the two edges
|
||||
* flanking the corner vertex. */
|
||||
/**
|
||||
* Vectors pointing from the centroid to the midpoints of the two edges
|
||||
* flanking the corner vertex.
|
||||
*/
|
||||
float cent_edgemid_vecs_v2[2][2];
|
||||
/** Angle between the cent_edgemid_vecs_v2 vectors. */
|
||||
float edgemid_angle;
|
||||
/** Angles between the centroid-to-point and cent_edgemid_vecs_v2 vectors.
|
||||
* Positive values measured towards the corner; clamped non-negative. */
|
||||
/**
|
||||
* Angles between the centroid-to-point and cent_edgemid_vecs_v2 vectors.
|
||||
* Positive values measured towards the corner; clamped non-negative.
|
||||
*/
|
||||
float point_edgemid_angles[2];
|
||||
/** Angles between the centroid-to-corner and cent_edgemid_vecs_v2 vectors. */
|
||||
float corner_edgemid_angles[2];
|
||||
/** Weight of the bind mode based on the corner and two adjacent vertices,
|
||||
* versus the one based on the centroid and the dominant edge. */
|
||||
/**
|
||||
* Weight of the bind mode based on the corner and two adjacent vertices,
|
||||
* versus the one based on the centroid and the dominant edge.
|
||||
*/
|
||||
float dominant_angle_weight;
|
||||
/** Index of the input polygon. */
|
||||
uint index;
|
||||
|
||||
@@ -574,7 +574,7 @@ static void generate_margin(ImBuf *ibuf,
|
||||
|
||||
char *tmpmask = (char *)MEM_dupallocN(mask);
|
||||
/* Extend (with averaging) by 2 pixels. Those will be overwritten, but it
|
||||
* helps linear interpolations on the edges of polygons. */
|
||||
* helps linear interpolations on the edges of polygons. */
|
||||
IMB_filter_extend(ibuf, tmpmask, 2);
|
||||
MEM_freeN(tmpmask);
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ void WM_window_set_dpi(const wmWindow *win)
|
||||
U.inv_dpi_fac = 1.0f / U.dpi_fac;
|
||||
|
||||
/* Widget unit is 20 pixels at 1X scale. This consists of 18 user-scaled units plus
|
||||
* left and right borders of line-width (pixelsize). */
|
||||
* left and right borders of line-width (pixel-size). */
|
||||
U.widget_unit = (int)roundf(18.0f * U.dpi_fac) + (2 * pixelsize);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user