Compare commits

...

1 Commits

Author SHA1 Message Date
Konrad Piascik
04efb9e18d Fix validation error on gltf_viewer
Inline header defined method to remove compiler warning
2025-06-17 09:23:58 -04:00
2 changed files with 10 additions and 6 deletions

View File

@@ -172,11 +172,15 @@ SPDPipeline& MipmapGenerator::GetOrCreatePipeline(const PipelineCacheKey& key) {
entry.binding = i;
entry.visibility = wgpu::ShaderStage::Compute;
if (i == 0) {
entry.texture.sampleType = (key.scalarType == SPDScalarType::I32)
? wgpu::TextureSampleType::Sint
: (key.scalarType == SPDScalarType::U32)
? wgpu::TextureSampleType::Uint
: wgpu::TextureSampleType::UnfilterableFloat;
if (key.scalarType == SPDScalarType::I32) {
entry.texture.sampleType = wgpu::TextureSampleType::Sint;
} else if (key.scalarType == SPDScalarType::U32) {
entry.texture.sampleType = wgpu::TextureSampleType::Uint;
} else if (key.scalarType == SPDScalarType::F32 || key.scalarType == SPDScalarType::F16) {
entry.texture.sampleType = wgpu::TextureSampleType::Float;
} else {
entry.texture.sampleType = wgpu::TextureSampleType::UnfilterableFloat;
}
entry.texture.viewDimension = wgpu::TextureViewDimension::e2DArray;
} else {
entry.storageTexture.access = wgpu::StorageTextureAccess::WriteOnly;

View File

@@ -101,7 +101,7 @@ template<typename WebGPUPrintable>
return out.str();
}
[[nodiscard]] std::string adapterInfoToString(wgpu::AdapterInfo const& info) {
[[nodiscard]] inline std::string adapterInfoToString(wgpu::AdapterInfo const& info) {
std::stringstream out;
out << "vendor (" << info.vendorID << ") '" << info.vendor
<< "' device (" << info.deviceID << ") '" << info.device