-
Notifications
You must be signed in to change notification settings - Fork 88
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
Crashes with texture_format: wgpu::TextureFormat::Rgba16Float
#109
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Ok instead of just converting the data I made the font atlas texture and surface texture different, this solution is way cleaner: diff --git a/src/lib.rs b/src/lib.rs
index 992856c..1757e61 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -277,6 +277,7 @@ impl Texture {
pub struct RendererConfig<'s> {
pub texture_format: TextureFormat,
pub depth_format: Option<TextureFormat>,
+ pub font_atlas_format: Option<TextureFormat>,
pub sample_count: u32,
pub shader: Option<ShaderModuleDescriptor<'s>>,
pub vertex_shader_entry_point: Option<&'s str>,
@@ -289,6 +290,7 @@ impl<'s> RendererConfig<'s> {
RendererConfig {
texture_format: TextureFormat::Rgba8Unorm,
depth_format: None,
+ font_atlas_format: None,
sample_count: 1,
shader: Some(shader),
vertex_shader_entry_point: Some(VS_ENTRY_POINT),
@@ -362,6 +364,7 @@ impl Renderer {
let RendererConfig {
texture_format,
depth_format,
+ font_atlas_format,
sample_count,
shader,
vertex_shader_entry_point,
@@ -505,6 +508,7 @@ impl Renderer {
config: RendererConfig {
texture_format,
depth_format,
+ font_atlas_format,
sample_count,
shader: None,
vertex_shader_entry_point: None,
@@ -785,6 +789,7 @@ impl Renderer {
height: handle.height,
..Default::default()
},
+ format: self.config.font_atlas_format,
..Default::default()
}; In this fork I have a working version and also updated wgpu to 22.1.0: https://github.com/julcst/imgui-wgpu-rs.git. /// Create a new GPU texture width the specified `config`.
pub fn new(device: &Device, renderer: &Renderer, config: TextureConfig) -> Self {
// Create the wgpu texture.
let texture = Arc::new(device.create_texture(&TextureDescriptor {
label: config.label,
size: config.size,
mip_level_count: config.mip_level_count,
sample_count: config.sample_count,
dimension: config.dimension,
format: config.format.unwrap_or(renderer.config.texture_format),
usage: config.usage,
view_formats: &[config.format.unwrap_or(renderer.config.texture_format)],
}));
...
} |
Description
When building a
RendererConfig
withtexture_format: wgpu::TextureFormat::Rgba16Float
(to output to HDR):wgpu panics:
The panic occurs in this method:
I am using:
The text was updated successfully, but these errors were encountered: