Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grammar / spelling in comments #100322

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/d3d12/rendering_device_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3830,7 +3830,7 @@ static void _add_descriptor_count_for_uniform(RenderingDevice::UniformType p_typ
}

RDD::UniformSetID RenderingDeviceDriverD3D12::uniform_set_create(VectorView<BoundUniform> p_uniforms, ShaderID p_shader, uint32_t p_set_index, int p_linear_pool_index) {
// p_linear_pool_index = -1; // TODO:? Linear pools not implemented or not supported by API backend.
//p_linear_pool_index = -1; // TODO:? Linear pools not implemented or not supported by API backend.

// Pre-bookkeep.
UniformSetInfo *uniform_set_info = VersatileResource::allocate<UniformSetInfo>(resources_allocator);
Expand Down
2 changes: 1 addition & 1 deletion drivers/metal/rendering_device_driver_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2570,7 +2570,7 @@ void deserialize(BufReader &p_reader) {
/*********************/

RDD::UniformSetID RenderingDeviceDriverMetal::uniform_set_create(VectorView<BoundUniform> p_uniforms, ShaderID p_shader, uint32_t p_set_index, int p_linear_pool_index) {
// p_linear_pool_index = -1; // TODO:? Linear pools not implemented or not supported by API backend.
//p_linear_pool_index = -1; // TODO:? Linear pools not implemented or not supported by API backend.

MDUniformSet *set = new MDUniformSet();
Vector<BoundUniform> bound_uniforms;
Expand Down
10 changes: 5 additions & 5 deletions drivers/vulkan/rendering_device_driver_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,9 @@ Error RenderingDeviceDriverVulkan::initialize(uint32_t p_device_index, uint32_t
vkGetPhysicalDeviceProperties(physical_device, &physical_device_properties);

// Workaround a driver bug on Adreno 730 GPUs that keeps leaking memory on each call to vkResetDescriptorPool.
// Which eventually run out of memory. in such case we should not be using linear allocated pools
// Bug introduced in driver 512.597.0 and fixed in 512.671.0
// Confirmed by Qualcomm
// Which eventually run out of memory. In such case we should not be using linear allocated pools
// Bug introduced in driver 512.597.0 and fixed in 512.671.0.
// Confirmed by Qualcomm.
if (linear_descriptor_pools_enabled) {
const uint32_t reset_descriptor_pool_broken_driver_begin = VK_MAKE_VERSION(512u, 597u, 0u);
const uint32_t reset_descriptor_pool_fixed_driver_begin = VK_MAKE_VERSION(512u, 671u, 0u);
Expand Down Expand Up @@ -1749,7 +1749,7 @@ RDD::TextureID RenderingDeviceDriverVulkan::texture_create(const TextureFormat &
// VUID-VkImageCreateInfo-usage-00963 :
// If usage includes VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,
// then bits other than VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
// and VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT must not be set
// and VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT must not be set.
create_info.usage &= (VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT);
} else {
alloc_create_info.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
Expand Down Expand Up @@ -5925,7 +5925,7 @@ RenderingDeviceDriverVulkan::~RenderingDeviceDriverVulkan() {
}
vmaDestroyAllocator(allocator);

// Destroy linearly allocated descriptor pools
// Destroy linearly allocated descriptor pools.
for (KeyValue<int, DescriptorSetPools> &pool_map : linear_descriptor_set_pools) {
for (KeyValue<DescriptorSetPoolKey, HashMap<VkDescriptorPool, uint32_t>> pools : pool_map.value) {
for (KeyValue<VkDescriptorPool, uint32_t> descriptor_pool : pools.value) {
Expand Down
22 changes: 11 additions & 11 deletions servers/rendering/rendering_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3829,7 +3829,7 @@ Error RenderingDevice::screen_create(DisplayServer::WindowID p_screen) {
Error RenderingDevice::screen_prepare_for_drawing(DisplayServer::WindowID p_screen) {
_THREAD_SAFE_METHOD_

// After submitting work, acquire the swapchain image(s)
// After submitting work, acquire the swapchain image(s).
HashMap<DisplayServer::WindowID, RDD::SwapChainID>::ConstIterator it = screen_swap_chains.find(p_screen);
ERR_FAIL_COND_V_MSG(it == screen_swap_chains.end(), ERR_CANT_CREATE, "A swap chain was not created for the screen.");

Expand Down Expand Up @@ -4432,18 +4432,18 @@ void RenderingDevice::draw_list_draw(DrawListID p_list, bool p_use_indices, uint
}

if (!dl->state.sets[i].bound) {
// Batch contiguous descriptor sets in a single call
// Batch contiguous descriptor sets in a single call.
if (descriptor_set_batching) {
// All good, see if this requires re-binding.
if (i - last_set_index > 1) {
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch.
draw_graph.add_draw_list_bind_uniform_sets(dl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);

first_set_index = i;
valid_set_count = 1;
valid_descriptor_ids[0] = dl->state.sets[i].uniform_set_driver_id;
} else {
// Otherwise, keep storing in the current batch
// Otherwise, keep storing in the current batch.
valid_descriptor_ids[valid_set_count] = dl->state.sets[i].uniform_set_driver_id;
valid_set_count++;
}
Expand All @@ -4460,7 +4460,7 @@ void RenderingDevice::draw_list_draw(DrawListID p_list, bool p_use_indices, uint
}
}

// Bind the remaining batch
// Bind the remaining batch.
if (descriptor_set_batching && valid_set_count > 0) {
draw_graph.add_draw_list_bind_uniform_sets(dl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);
}
Expand Down Expand Up @@ -5005,14 +5005,14 @@ void RenderingDevice::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_g
if (descriptor_set_batching) {
// All good, see if this requires re-binding.
if (i - last_set_index > 1) {
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch.
draw_graph.add_compute_list_bind_uniform_sets(cl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);

first_set_index = i;
valid_set_count = 1;
valid_descriptor_ids[0] = cl->state.sets[i].uniform_set_driver_id;
} else {
// Otherwise, keep storing in the current batch
// Otherwise, keep storing in the current batch.
valid_descriptor_ids[valid_set_count] = cl->state.sets[i].uniform_set_driver_id;
valid_set_count++;
}
Expand All @@ -5029,7 +5029,7 @@ void RenderingDevice::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_g
}
}

// Bind the remaining batch
// Bind the remaining batch.
if (valid_set_count > 0) {
draw_graph.add_compute_list_bind_uniform_sets(cl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);
}
Expand Down Expand Up @@ -5150,14 +5150,14 @@ void RenderingDevice::compute_list_dispatch_indirect(ComputeListID p_list, RID p
if (!cl->state.sets[i].bound) {
// All good, see if this requires re-binding.
if (i - last_set_index > 1) {
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch
// If the descriptor sets are not contiguous, bind the previous ones and start a new batch.
draw_graph.add_compute_list_bind_uniform_sets(cl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);

first_set_index = i;
valid_set_count = 1;
valid_descriptor_ids[0] = cl->state.sets[i].uniform_set_driver_id;
} else {
// Otherwise, keep storing in the current batch
// Otherwise, keep storing in the current batch.
valid_descriptor_ids[valid_set_count] = cl->state.sets[i].uniform_set_driver_id;
valid_set_count++;
}
Expand All @@ -5172,7 +5172,7 @@ void RenderingDevice::compute_list_dispatch_indirect(ComputeListID p_list, RID p
}
}

// Bind the remaining batch
// Bind the remaining batch.
if (valid_set_count > 0) {
draw_graph.add_compute_list_bind_uniform_sets(cl->state.pipeline_shader_driver_id, valid_descriptor_ids, first_set_index, valid_set_count);
}
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/rendering_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class RenderingDevice : public RenderingDeviceCommons {
Error _buffer_initialize(Buffer *p_buffer, const uint8_t *p_data, size_t p_data_size, uint32_t p_required_align = 32);

void update_perf_report();
// flag for batching descriptor sets
// Flag for batching descriptor sets.
bool descriptor_set_batching = true;
// When true, the final draw call that copies our offscreen result into the Swapchain is put into its
// own cmd buffer, so that the whole rendering can start early instead of having to wait for the
Expand Down