25 return supports_offscreen_msaa_;
36 return supports_texture_to_texture_blits_;
41 return supports_framebuffer_fetch_;
49 return supports_compute_subgroups_;
54 return supports_read_from_resolve_;
59 return supports_decal_sampler_address_mode_;
67 return default_color_format_;
72 return default_stencil_format_;
77 return default_depth_stencil_format_;
82 return supports_device_transient_textures_;
87 return default_glyph_atlas_format_;
92 return default_maximum_render_pass_attachment_size_;
106 return supports_extended_range_formats_;
117 return supports_texture_compression_bc_;
119 return supports_texture_compression_etc2_;
121 return supports_texture_compression_astc_;
123 return supports_texture_compression_astc_hdr_;
130 return max_sampler_anisotropy_;
135 return minimum_uniform_alignment_;
140 return needs_partitioned_host_buffer_;
146 bool supports_texture_to_texture_blits,
147 bool supports_framebuffer_fetch,
148 bool supports_compute,
149 bool supports_compute_subgroups,
150 bool supports_read_from_resolve,
151 bool supports_decal_sampler_address_mode,
152 bool supports_device_transient_textures,
153 bool supports_triangle_fan,
154 bool supports_extended_range_formats,
159 ISize default_maximum_render_pass_attachment_size,
160 uint32_t max_sampler_anisotropy,
161 size_t minimum_uniform_alignment,
162 bool needs_partitioned_host_buffer,
163 bool supports_texture_compression_bc,
164 bool supports_texture_compression_etc2,
165 bool supports_texture_compression_astc,
166 bool supports_texture_compression_astc_hdr)
167 : supports_offscreen_msaa_(supports_offscreen_msaa),
168 supports_ssbo_(supports_ssbo),
169 supports_texture_to_texture_blits_(supports_texture_to_texture_blits),
170 supports_framebuffer_fetch_(supports_framebuffer_fetch),
171 supports_compute_(supports_compute),
172 supports_compute_subgroups_(supports_compute_subgroups),
173 supports_read_from_resolve_(supports_read_from_resolve),
174 supports_decal_sampler_address_mode_(
175 supports_decal_sampler_address_mode),
176 supports_device_transient_textures_(supports_device_transient_textures),
177 supports_triangle_fan_(supports_triangle_fan),
178 supports_extended_range_formats_(supports_extended_range_formats),
179 needs_partitioned_host_buffer_(needs_partitioned_host_buffer),
180 default_color_format_(default_color_format),
181 default_stencil_format_(default_stencil_format),
182 default_depth_stencil_format_(default_depth_stencil_format),
183 default_glyph_atlas_format_(default_glyph_atlas_format),
184 default_maximum_render_pass_attachment_size_(
185 default_maximum_render_pass_attachment_size),
186 max_sampler_anisotropy_(max_sampler_anisotropy),
187 minimum_uniform_alignment_(minimum_uniform_alignment),
188 supports_texture_compression_bc_(supports_texture_compression_bc),
189 supports_texture_compression_etc2_(supports_texture_compression_etc2),
190 supports_texture_compression_astc_(supports_texture_compression_astc),
191 supports_texture_compression_astc_hdr_(
192 supports_texture_compression_astc_hdr) {}
196 bool supports_offscreen_msaa_ =
false;
197 bool supports_ssbo_ =
false;
198 bool supports_texture_to_texture_blits_ =
false;
199 bool supports_framebuffer_fetch_ =
false;
200 bool supports_compute_ =
false;
201 bool supports_compute_subgroups_ =
false;
202 bool supports_read_from_resolve_ =
false;
203 bool supports_decal_sampler_address_mode_ =
false;
204 bool supports_device_transient_textures_ =
false;
205 bool supports_triangle_fan_ =
false;
206 bool supports_extended_range_formats_ =
false;
207 bool needs_partitioned_host_buffer_ =
false;
212 ISize default_maximum_render_pass_attachment_size_ =
ISize(1, 1);
213 uint32_t max_sampler_anisotropy_ = 1;
214 size_t minimum_uniform_alignment_ = 256;
215 bool supports_texture_compression_bc_ =
false;
216 bool supports_texture_compression_etc2_ =
false;
217 bool supports_texture_compression_astc_ =
false;
218 bool supports_texture_compression_astc_hdr_ =
false;
230 supports_offscreen_msaa_ =
value;
235 supports_ssbo_ =
value;
241 supports_texture_to_texture_blits_ =
value;
247 supports_framebuffer_fetch_ =
value;
252 supports_compute_ =
value;
258 supports_compute_subgroups_ =
value;
264 default_color_format_ =
value;
270 default_stencil_format_ =
value;
276 default_depth_stencil_format_ =
value;
281 bool read_from_resolve) {
282 supports_read_from_resolve_ = read_from_resolve;
288 supports_decal_sampler_address_mode_ =
value;
294 supports_device_transient_textures_ =
value;
300 default_glyph_atlas_format_ =
value;
305 supports_triangle_fan_ =
value;
311 default_maximum_render_pass_attachment_size_ = size;
317 supports_extended_range_formats_ =
value;
326 supports_texture_compression_bc_ =
value;
329 supports_texture_compression_etc2_ =
value;
332 supports_texture_compression_astc_ =
value;
335 supports_texture_compression_astc_hdr_ =
value;
343 max_sampler_anisotropy_ =
value;
349 minimum_uniform_alignment_ =
value;
355 needs_partitioned_host_buffer_ =
value;
362 supports_offscreen_msaa_,
364 supports_texture_to_texture_blits_,
365 supports_framebuffer_fetch_,
367 supports_compute_subgroups_,
368 supports_read_from_resolve_,
369 supports_decal_sampler_address_mode_,
370 supports_device_transient_textures_,
371 supports_triangle_fan_,
372 supports_extended_range_formats_,
377 default_maximum_render_pass_attachment_size_.value_or(
ISize{1, 1}),
378 max_sampler_anisotropy_,
379 minimum_uniform_alignment_,
380 needs_partitioned_host_buffer_,
381 supports_texture_compression_bc_,
382 supports_texture_compression_etc2_,
383 supports_texture_compression_astc_,
384 supports_texture_compression_astc_hdr_
CapabilitiesBuilder & SetDefaultColorFormat(PixelFormat value)
CapabilitiesBuilder & SetSupportsComputeSubgroups(bool value)
CapabilitiesBuilder & SetMinimumUniformAlignment(size_t value)
CapabilitiesBuilder & SetSupportsTextureToTextureBlits(bool value)
CapabilitiesBuilder & SetDefaultStencilFormat(PixelFormat value)
CapabilitiesBuilder & SetSupportsDeviceTransientTextures(bool value)
CapabilitiesBuilder & SetSupportsTriangleFan(bool value)
CapabilitiesBuilder & SetMaxSamplerAnisotropy(uint32_t value)
CapabilitiesBuilder & SetNeedsPartitionedHostBuffer(bool value)
CapabilitiesBuilder & SetSupportsFramebufferFetch(bool value)
CapabilitiesBuilder & SetSupportsDecalSamplerAddressMode(bool value)
CapabilitiesBuilder & SetSupportsTextureCompression(CompressedTextureFamily family, bool value)
CapabilitiesBuilder & SetSupportsOffscreenMSAA(bool value)
CapabilitiesBuilder & SetSupportsSSBO(bool value)
CapabilitiesBuilder & SetMaximumRenderPassAttachmentSize(ISize size)
CapabilitiesBuilder & SetSupportsExtendedRangeFormats(bool value)
CapabilitiesBuilder & SetDefaultGlyphAtlasFormat(PixelFormat value)
CapabilitiesBuilder & SetSupportsCompute(bool value)
std::unique_ptr< Capabilities > Build()
CapabilitiesBuilder & SetDefaultDepthStencilFormat(PixelFormat value)
CapabilitiesBuilder & SetSupportsReadFromResolve(bool value)
virtual size_t GetMinimumUniformAlignment() const =0
The minimum alignment of uniform value offsets in bytes.
virtual size_t GetMinimumStorageBufferAlignment() const
The minimum alignment of storage buffer value offsets in bytes.
~StandardCapabilities() override=default
bool SupportsManuallyMippedTextures() const override
Whether a texture whose mip levels were uploaded by hand (rather than produced by BlitPass::GenerateM...
bool SupportsReadFromResolve() const override
Whether the context backend supports binding the current RenderPass attachments. This is supported if...
bool NeedsPartitionedHostBuffer() const override
Whether the host buffer should use separate device buffers for indexes from other data.
PixelFormat GetDefaultDepthStencilFormat() const override
Returns a supported PixelFormat for textures that store both a stencil and depth component....
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
ISize GetMaximumRenderPassAttachmentSize() const override
Return the maximum size of a render pass attachment.
bool SupportsTextureToTextureBlits() const override
Whether the context backend supports blitting from one texture region to another texture region (via ...
bool SupportsFramebufferFetch() const override
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
PixelFormat GetDefaultGlyphAtlasFormat() const override
Returns the default pixel format for the alpha bitmap glyph atlas.
PixelFormat GetDefaultStencilFormat() const override
Returns a supported PixelFormat for textures that store stencil information. May include a depth chan...
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
size_t GetMinimumUniformAlignment() const override
The minimum alignment of uniform value offsets in bytes.
bool Supports32BitPrimitiveIndices() const override
Whether 32-bit values are supported in index buffers used to draw primitives.
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
bool SupportsFramebufferRenderMipmap() const override
Whether a non-zero mip level of a texture can be attached as a render target. Rendering into a cube m...
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
uint32_t GetMaxSamplerAnisotropy() const override
The maximum anisotropy clamp supported by device samplers.
bool SupportsPrimitiveRestart() const override
Whether primitive restart is supported.
PixelFormat GetDefaultColorFormat() const override
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
bool SupportsExtendedRangeFormats() const override
Whether the XR formats are supported on this device.
bool SupportsTextureCompression(CompressedTextureFamily family) const override
Whether the given family of block-compressed texture formats is supported by this device....
bool SupportsTriangleFan() const override
Whether the primitive type TriangleFan is supported by the backend.
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
CompressedTextureFamily
The family of a block-compressed pixel format. GPUs support compressed formats on a per-family basis,...
@ kASTCHDR
ASTC HDR. A separate device feature from ASTC LDR.
@ kBC
S3TC, RGTC, and BPTC (BC1 through BC7). Desktop GPUs.
@ kETC2
ETC2 and EAC. Mobile, OpenGL ES 3.0, and WebGL2.
@ kASTC
ASTC LDR. Modern mobile and some desktop.