mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Use Custom Mesa for Building (#4977)
This commit is contained in:
parent
ad37e923e8
commit
b989e56874
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@ -8,6 +8,9 @@ on:
|
||||
merge_group:
|
||||
|
||||
env:
|
||||
MESA_VERSION: "23.3.1"
|
||||
CI_BINARY_BUILD: "build18"
|
||||
|
||||
CARGO_INCREMENTAL: false
|
||||
CARGO_TERM_COLOR: always
|
||||
WGPU_DX12_COMPILER: dxc
|
||||
@ -329,9 +332,8 @@ jobs:
|
||||
os: [self-hosted, macOS]
|
||||
|
||||
# Linux
|
||||
# https://github.com/gfx-rs/wgpu/issues/4961
|
||||
# - name: Linux x86_64
|
||||
# os: ubuntu-22.04
|
||||
- name: Linux x86_64
|
||||
os: ubuntu-22.04
|
||||
|
||||
name: Test ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -385,7 +387,7 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
|
||||
curl.exe -L https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z -o mesa.7z
|
||||
curl.exe -L --retry 5 https://github.com/pal1000/mesa-dist-win/releases/download/$MESA_VERSION/mesa3d-$MESA_VERSION-release-msvc.7z -o mesa.7z
|
||||
7z.exe e mesa.7z -omesa x64/{opengl32.dll,libgallium_wgl.dll,libglapi.dll,vulkan_lvp.dll,lvp_icd.x86_64.json}
|
||||
|
||||
cp -v mesa/* target/llvm-cov-target/debug/
|
||||
@ -394,7 +396,7 @@ jobs:
|
||||
echo "VK_DRIVER_FILES=$PWD/mesa/lvp_icd.x86_64.json" >> "$GITHUB_ENV"
|
||||
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
|
||||
|
||||
- name: (linux) install llvmpipe, lavapipe, vulkan sdk
|
||||
- name: (linux) install vulkan sdk
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
shell: bash
|
||||
run: |
|
||||
@ -406,10 +408,32 @@ jobs:
|
||||
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
|
||||
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
|
||||
|
||||
# sudo add-apt-repository ppa:oibaf/graphics-drivers
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt install -y libegl-mesa0 libgl1-mesa-dri libxcb-xfixes0-dev vulkan-sdk mesa-vulkan-drivers
|
||||
sudo apt install -y vulkan-sdk
|
||||
|
||||
- name: (linux) install mesa
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
|
||||
curl -L --retry 5 https://github.com/gfx-rs/ci-build/releases/download/$CI_BINARY_BUILD/mesa-$MESA_VERSION-linux-x86_64.tar.xz -o mesa.tar.xz
|
||||
mkdir mesa
|
||||
tar xpf mesa.tar.xz -C mesa
|
||||
|
||||
cat <<- EOF > icd.json
|
||||
{
|
||||
"ICD": {
|
||||
"api_version": "1.1.255",
|
||||
"library_path": "$PWD/mesa/lib/x86_64-linux-gnu/libvulkan_lvp.so"
|
||||
},
|
||||
"file_format_version": "1.0.0"
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "VK_DRIVER_FILES=$PWD/icd.json" >> "$GITHUB_ENV"
|
||||
echo "LD_LIBRARY_PATH=$PWD/mesa/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
|
||||
echo "LIBGL_DRIVERS_PATH=$PWD/mesa/lib/x86_64-linux-gnu/dri" >> "$GITHUB_ENV"
|
||||
|
||||
- name: disable debug
|
||||
shell: bash
|
||||
|
||||
@ -3230,7 +3230,10 @@ impl<A: HalApi> Device<A> {
|
||||
.contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES);
|
||||
// If we're running downlevel, we need to manually ask the backend what
|
||||
// we can use as we can't trust WebGPU.
|
||||
let downlevel = !self.downlevel.is_webgpu_compliant();
|
||||
let downlevel = !self
|
||||
.downlevel
|
||||
.flags
|
||||
.contains(wgt::DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT);
|
||||
|
||||
if using_device_features || downlevel {
|
||||
Ok(self.get_texture_format_features(adapter, format))
|
||||
|
||||
@ -1072,7 +1072,7 @@ impl crate::Adapter<super::Api> for super::Adapter {
|
||||
| Tf::Depth32FloatStencil8
|
||||
| Tf::Depth24Plus
|
||||
| Tf::Depth24PlusStencil8 => depth,
|
||||
Tf::NV12 => unreachable!(),
|
||||
Tf::NV12 => empty,
|
||||
Tf::Rgb9e5Ufloat => filterable,
|
||||
Tf::Bc1RgbaUnorm
|
||||
| Tf::Bc1RgbaUnormSrgb
|
||||
|
||||
@ -1711,7 +1711,17 @@ impl crate::Adapter<super::Api> for super::Adapter {
|
||||
.framebuffer_stencil_sample_counts
|
||||
.min(limits.sampled_image_stencil_sample_counts)
|
||||
} else {
|
||||
match format.sample_type(None, None).unwrap() {
|
||||
let first_aspect = format_aspect
|
||||
.iter()
|
||||
.next()
|
||||
.expect("All texture should at least one aspect")
|
||||
.map();
|
||||
|
||||
// We should never get depth or stencil out of this, due to the above.
|
||||
assert_ne!(first_aspect, wgt::TextureAspect::DepthOnly);
|
||||
assert_ne!(first_aspect, wgt::TextureAspect::StencilOnly);
|
||||
|
||||
match format.sample_type(Some(first_aspect), None).unwrap() {
|
||||
wgt::TextureSampleType::Float { .. } => limits
|
||||
.framebuffer_color_sample_counts
|
||||
.min(limits.sampled_image_color_sample_counts),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Lets keep these on one line
|
||||
#[rustfmt::skip]
|
||||
pub const TEXTURE_FORMAT_LIST: [wgpu::TextureFormat; 115] = [
|
||||
pub const TEXTURE_FORMAT_LIST: [wgpu::TextureFormat; 119] = [
|
||||
wgpu::TextureFormat::R8Unorm,
|
||||
wgpu::TextureFormat::R8Snorm,
|
||||
wgpu::TextureFormat::R8Uint,
|
||||
@ -50,6 +50,10 @@ pub const TEXTURE_FORMAT_LIST: [wgpu::TextureFormat; 115] = [
|
||||
wgpu::TextureFormat::Depth24Plus,
|
||||
wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
wgpu::TextureFormat::Rgb9e5Ufloat,
|
||||
wgpu::TextureFormat::Rgb10a2Uint,
|
||||
wgpu::TextureFormat::Rgb10a2Unorm,
|
||||
wgpu::TextureFormat::Rg11b10Float,
|
||||
wgpu::TextureFormat::NV12,
|
||||
wgpu::TextureFormat::Bc1RgbaUnorm,
|
||||
wgpu::TextureFormat::Bc1RgbaUnormSrgb,
|
||||
wgpu::TextureFormat::Bc2RgbaUnorm,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user