Skip to content

Commit

Permalink
Add Rgb9e5Ufloat
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald committed Jul 22, 2021
1 parent 5c28684 commit 683d03a
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 91 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- new `Features::SPIRV_SHADER_PASSTHROUGH` run-time feature allows providing pass-through SPIR-V (orthogonal to the compile feature)
- several bitflag names are renamed to plural: `TextureUsage`, `BufferUsage`, `ColorWrite`.
- renamed `InputStepMode` to `VertexStepMode`
- Implemented `Rgb9e5Ufloat` format.
- Fixed:
- `Device::create_query_set` would return an error when creating exactly `QUERY_SET_MAX_QUERIES` (8192) queries. Now it only returns an error when trying to create *more* than `QUERY_SET_MAX_QUERIES` queries.

Expand Down
1 change: 1 addition & 0 deletions wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ impl NumericType {
Tf::Depth32Float | Tf::Depth24Plus | Tf::Depth24PlusStencil8 => {
panic!("Unexpected depth format")
}
Tf::Rgb9e5Ufloat => (NumericDimension::Vector(Vs::Tri), Sk::Float),
Tf::Bc1RgbaUnorm
| Tf::Bc1RgbaUnormSrgb
| Tf::Bc2RgbaUnorm
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/dx12/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub(super) fn map_texture_format(format: wgt::TextureFormat) -> dxgiformat::DXGI
Tf::Depth32Float => DXGI_FORMAT_D32_FLOAT,
Tf::Depth24Plus => DXGI_FORMAT_D24_UNORM_S8_UINT,
Tf::Depth24PlusStencil8 => DXGI_FORMAT_D24_UNORM_S8_UINT,
Tf::Rgb9e5Ufloat => DXGI_FORMAT_R9G9B9E5_SHAREDEXP,
Tf::Bc1RgbaUnorm => DXGI_FORMAT_BC1_UNORM,
Tf::Bc1RgbaUnormSrgb => DXGI_FORMAT_BC1_UNORM_SRGB,
Tf::Bc2RgbaUnorm => DXGI_FORMAT_BC2_UNORM,
Expand Down
3 changes: 2 additions & 1 deletion wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ impl crate::Adapter<super::Api> for super::Adapter {
Tf::Depth32Float => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT,
Tf::Depth24Plus => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT,
Tf::Depth24PlusStencil8 => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT,
Tf::Bc1RgbaUnorm
Tf::Rgb9e5Ufloat
| Tf::Bc1RgbaUnorm
| Tf::Bc1RgbaUnormSrgb
| Tf::Bc2RgbaUnorm
| Tf::Bc2RgbaUnormSrgb
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/gles/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl super::AdapterShared {
glow::DEPTH_COMPONENT,
glow::UNSIGNED_INT,
),
Tf::Rgb9e5Ufloat => (glow::RGB9_E5, glow::RGB, glow::UNSIGNED_INT_5_9_9_9_REV),
Tf::Bc1RgbaUnorm
| Tf::Bc1RgbaUnormSrgb
| Tf::Bc2RgbaUnorm
Expand Down
2 changes: 2 additions & 0 deletions wgpu-hal/src/metal/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl crate::Adapter<super::Api> for super::Adapter {
Tf::Depth24Plus | Tf::Depth24PlusStencil8 => {
Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::SAMPLED_LINEAR
}
Tf::Rgb9e5Ufloat => Tfc::SAMPLED_LINEAR,
Tf::Bc1RgbaUnorm
| Tf::Bc1RgbaUnormSrgb
| Tf::Bc2RgbaUnorm
Expand Down Expand Up @@ -988,6 +989,7 @@ impl super::PrivateCapabilities {
Depth32Float_Stencil8
}
}
Tf::Rgb9e5Ufloat => RGB9E5Float,
Tf::Bc1RgbaUnorm => BC1_RGBA,
Tf::Bc1RgbaUnormSrgb => BC1_RGBA_sRGB,
Tf::Bc2RgbaUnorm => BC2_RGBA,
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl super::PrivateCapabilities {
F::D32_SFLOAT_S8_UINT
}
}
Tf::Rgb9e5Ufloat => F::E5B9G9R9_UFLOAT_PACK32,
Tf::Bc1RgbaUnorm => F::BC1_RGBA_UNORM_BLOCK,
Tf::Bc1RgbaUnormSrgb => F::BC1_RGBA_SRGB_BLOCK,
Tf::Bc2RgbaUnorm => F::BC2_UNORM_BLOCK,
Expand Down
Loading

0 comments on commit 683d03a

Please sign in to comment.