-
Notifications
You must be signed in to change notification settings - Fork 25
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
Port to the new swapchain model #210
Changes from all commits
c1e8594
d47e1e7
cee0c05
5c6b344
7aed54c
0c7e6fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,47 +14,110 @@ pub fn limits_from_hal(limits: Limits) -> VkPhysicalDeviceLimits { | |||||||||||||
maxImageDimension2D: limits.max_image_2d_size, | ||||||||||||||
maxImageDimension3D: limits.max_image_3d_size, | ||||||||||||||
maxImageDimensionCube: limits.max_image_cube_size, | ||||||||||||||
maxFramebufferWidth: limits.max_framebuffer_extent.width, | ||||||||||||||
maxFramebufferHeight: limits.max_framebuffer_extent.height, | ||||||||||||||
maxImageArrayLayers: limits.max_image_array_layers as _, | ||||||||||||||
maxTexelBufferElements: limits.max_texel_elements as _, | ||||||||||||||
maxTessellationPatchSize: limits.max_patch_size as _, | ||||||||||||||
maxUniformBufferRange: limits.max_uniform_buffer_range as _, | ||||||||||||||
maxStorageBufferRange: limits.max_storage_buffer_range as _, | ||||||||||||||
maxPushConstantsSize: limits.max_push_constants_size as _, | ||||||||||||||
maxViewports: limits.max_viewports as _, | ||||||||||||||
maxViewportDimensions: limits.max_viewport_dimensions, | ||||||||||||||
maxMemoryAllocationCount: limits.max_memory_allocation_count as _, | ||||||||||||||
maxSamplerAllocationCount: limits.max_sampler_allocation_count as _, | ||||||||||||||
bufferImageGranularity: limits.buffer_image_granularity, | ||||||||||||||
sparseAddressSpaceSize: 0, | ||||||||||||||
maxBoundDescriptorSets: limits.max_bound_descriptor_sets as _, | ||||||||||||||
maxPerStageDescriptorSamplers: limits.max_per_stage_descriptor_samplers as _, | ||||||||||||||
maxPerStageDescriptorUniformBuffers: limits.max_per_stage_descriptor_uniform_buffers as _, | ||||||||||||||
maxPerStageDescriptorStorageBuffers: limits.max_per_stage_descriptor_storage_buffers as _, | ||||||||||||||
maxPerStageDescriptorSampledImages: limits.max_per_stage_descriptor_sampled_images as _, | ||||||||||||||
maxPerStageDescriptorStorageImages: limits.max_per_stage_descriptor_storage_images as _, | ||||||||||||||
maxPerStageDescriptorInputAttachments: limits.max_per_stage_descriptor_input_attachments as _, | ||||||||||||||
maxPerStageResources: limits.max_per_stage_resources as _, | ||||||||||||||
maxDescriptorSetSamplers: limits.max_descriptor_set_samplers as _, | ||||||||||||||
maxDescriptorSetUniformBuffers: limits.max_descriptor_set_uniform_buffers as _, | ||||||||||||||
maxFragmentInputComponents: limits.max_fragment_input_components as _, | ||||||||||||||
maxFramebufferLayers: limits.max_framebuffer_layers as _, | ||||||||||||||
maxMemoryAllocationCount: limits.max_memory_allocation_count as _, | ||||||||||||||
maxUniformBufferRange: limits.max_uniform_buffer_range as _, | ||||||||||||||
// Warning: spec violation | ||||||||||||||
// "The x/y rectangle of the viewport must lie entirely within the current attachment size." | ||||||||||||||
viewportBoundsRange: [0.0, viewport_size as f32], | ||||||||||||||
maxDescriptorSetUniformBuffersDynamic: limits.max_descriptor_set_uniform_buffers_dynamic.max(1) as _, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This comment was generated by: rustfmt |
||||||||||||||
maxDescriptorSetStorageBuffers: limits.max_descriptor_set_storage_buffers as _, | ||||||||||||||
maxDescriptorSetStorageBuffersDynamic: limits.max_descriptor_set_storage_buffers_dynamic.max(1) as _, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This comment was generated by: rustfmt |
||||||||||||||
maxDescriptorSetSampledImages: limits.max_descriptor_set_sampled_images as _, | ||||||||||||||
maxDescriptorSetStorageImages: limits.max_descriptor_set_storage_images as _, | ||||||||||||||
maxDescriptorSetInputAttachments: limits.max_descriptor_set_input_attachments as _, | ||||||||||||||
maxVertexInputAttributes: limits.max_vertex_input_attributes as _, | ||||||||||||||
maxVertexInputBindings: limits.max_vertex_input_bindings as _, | ||||||||||||||
maxVertexInputAttributeOffset: limits.max_vertex_input_attribute_offset as _, | ||||||||||||||
maxVertexInputBindingStride: limits.max_vertex_input_binding_stride as _, | ||||||||||||||
maxVertexOutputComponents: limits.max_vertex_output_components as _, | ||||||||||||||
maxTessellationGenerationLevel: 0, | ||||||||||||||
maxTessellationPatchSize: limits.max_patch_size as _, | ||||||||||||||
maxTessellationControlPerVertexInputComponents: 0, | ||||||||||||||
maxTessellationControlPerVertexOutputComponents: 0, | ||||||||||||||
maxTessellationControlPerPatchOutputComponents: 0, | ||||||||||||||
maxTessellationControlTotalOutputComponents: 0, | ||||||||||||||
maxTessellationEvaluationInputComponents: 0, | ||||||||||||||
maxTessellationEvaluationOutputComponents: 0, | ||||||||||||||
maxGeometryShaderInvocations: limits.max_geometry_shader_invocations as _, | ||||||||||||||
maxGeometryInputComponents: limits.max_geometry_input_components as _, | ||||||||||||||
maxGeometryOutputComponents: limits.max_geometry_output_components as _, | ||||||||||||||
maxGeometryOutputVertices: limits.max_geometry_output_vertices as _, | ||||||||||||||
maxGeometryTotalOutputComponents: limits.max_geometry_total_output_components as _, | ||||||||||||||
maxFragmentInputComponents: limits.max_fragment_input_components as _, | ||||||||||||||
maxFragmentOutputAttachments: limits.max_fragment_output_attachments as _, | ||||||||||||||
maxFragmentDualSrcAttachments: limits.max_fragment_dual_source_attachments as _, | ||||||||||||||
maxFragmentCombinedOutputResources: limits.max_fragment_combined_output_resources as _, | ||||||||||||||
maxComputeSharedMemorySize: limits.max_compute_shared_memory_size as _, | ||||||||||||||
maxComputeWorkGroupCount: limits.max_compute_work_group_count, | ||||||||||||||
maxComputeWorkGroupInvocations: limits.max_compute_work_group_invocations as _, | ||||||||||||||
maxComputeWorkGroupSize: limits.max_compute_work_group_size, | ||||||||||||||
bufferImageGranularity: limits.buffer_image_granularity, | ||||||||||||||
subPixelPrecisionBits: 0, | ||||||||||||||
subTexelPrecisionBits: 0, | ||||||||||||||
mipmapPrecisionBits: 0, | ||||||||||||||
maxDrawIndexedIndexValue: limits.max_draw_indexed_index_value, | ||||||||||||||
maxDrawIndirectCount: limits.max_draw_indirect_count, | ||||||||||||||
maxSamplerLodBias: limits.max_sampler_lod_bias, | ||||||||||||||
maxSamplerAnisotropy: limits.max_sampler_anisotropy, | ||||||||||||||
maxViewports: limits.max_viewports as _, | ||||||||||||||
maxViewportDimensions: limits.max_viewport_dimensions, | ||||||||||||||
// Warning: spec violation | ||||||||||||||
// "The x/y rectangle of the viewport must lie entirely within the current attachment size." | ||||||||||||||
viewportBoundsRange: [0.0, viewport_size as f32], | ||||||||||||||
viewportSubPixelBits: 0, | ||||||||||||||
minMemoryMapAlignment: limits.min_memory_map_alignment.max(1), | ||||||||||||||
minTexelBufferOffsetAlignment: limits.min_texel_buffer_offset_alignment, | ||||||||||||||
minUniformBufferOffsetAlignment: limits.min_uniform_buffer_offset_alignment, | ||||||||||||||
minStorageBufferOffsetAlignment: limits.min_storage_buffer_offset_alignment, | ||||||||||||||
minTexelOffset: 0, | ||||||||||||||
maxTexelOffset: 0, | ||||||||||||||
minTexelGatherOffset: 0, | ||||||||||||||
maxTexelGatherOffset: 0, | ||||||||||||||
minInterpolationOffset: 0.0, | ||||||||||||||
maxInterpolationOffset: 0.0, | ||||||||||||||
subPixelInterpolationOffsetBits: 0, | ||||||||||||||
maxFramebufferWidth: limits.max_framebuffer_extent.width, | ||||||||||||||
maxFramebufferHeight: limits.max_framebuffer_extent.height, | ||||||||||||||
maxFramebufferLayers: limits.max_framebuffer_layers as _, | ||||||||||||||
framebufferColorSampleCounts: limits.framebuffer_color_sample_counts as _, | ||||||||||||||
framebufferDepthSampleCounts: limits.framebuffer_depth_sample_counts as _, | ||||||||||||||
framebufferStencilSampleCounts: limits.framebuffer_stencil_sample_counts as _, | ||||||||||||||
framebufferNoAttachmentsSampleCounts: 0, //TODO | ||||||||||||||
maxColorAttachments: limits.max_color_attachments as _, | ||||||||||||||
nonCoherentAtomSize: limits.non_coherent_atom_size as _, | ||||||||||||||
maxSamplerAnisotropy: limits.max_sampler_anisotropy, | ||||||||||||||
sampledImageColorSampleCounts: 0, | ||||||||||||||
sampledImageIntegerSampleCounts: 0, | ||||||||||||||
sampledImageDepthSampleCounts: 0, | ||||||||||||||
sampledImageStencilSampleCounts: 0, | ||||||||||||||
storageImageSampleCounts: 0, | ||||||||||||||
maxSampleMaskWords: 0, | ||||||||||||||
timestampComputeAndGraphics: 0, | ||||||||||||||
timestampPeriod: 0.0, | ||||||||||||||
maxClipDistances: 0, | ||||||||||||||
maxCullDistances: 0, | ||||||||||||||
maxCombinedClipAndCullDistances: 0, | ||||||||||||||
discreteQueuePriorities: 0, | ||||||||||||||
pointSizeRange: [0.0; 2], | ||||||||||||||
lineWidthRange: [0.0; 2], | ||||||||||||||
pointSizeGranularity: 0.0, | ||||||||||||||
lineWidthGranularity: 0.0, | ||||||||||||||
strictLines: 0, | ||||||||||||||
standardSampleLocations: if limits.standard_sample_locations { VK_TRUE } else { VK_FALSE }, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This comment was generated by: rustfmt |
||||||||||||||
optimalBufferCopyOffsetAlignment: limits.optimal_buffer_copy_offset_alignment, | ||||||||||||||
optimalBufferCopyRowPitchAlignment: limits.optimal_buffer_copy_pitch_alignment, | ||||||||||||||
maxPerStageDescriptorSampledImages: limits.max_per_stage_descriptor_sampled_images as _, | ||||||||||||||
maxPerStageDescriptorSamplers: limits.max_per_stage_descriptor_samplers as _, | ||||||||||||||
maxDescriptorSetSampledImages: limits.max_descriptor_set_sampled_images as _, | ||||||||||||||
maxDescriptorSetSamplers: limits.max_descriptor_set_samplers as _, | ||||||||||||||
..unsafe { mem::zeroed() } //TODO | ||||||||||||||
nonCoherentAtomSize: limits.non_coherent_atom_size as _, | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
|
@@ -355,7 +418,7 @@ pub fn map_image_usage(usage: VkImageUsageFlags) -> image::Usage { | |||||||||||||
image::Usage::from_bits_truncate(usage) | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
pub fn map_image_usage_from_hal(usage: image::Usage) -> VkImageUsageFlags { | ||||||||||||||
pub fn _map_image_usage_from_hal(usage: image::Usage) -> VkImageUsageFlags { | ||||||||||||||
usage.bits() | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was generated by: rustfmt