Changeset 285868 in webkit
- Timestamp:
- Nov 16, 2021, 9:11:23 AM (5 years ago)
- Location:
- trunk/Source/WebCore/PAL
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp (modified) (1 diff)
-
pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp (modified) (7 diffs)
-
pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.h (modified) (1 diff)
-
pal/graphics/WebGPU/Impl/WebGPURenderBundleEncoderImpl.h (modified) (1 diff)
-
pal/graphics/WebGPU/Impl/WebGPURenderPassEncoderImpl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/PAL/ChangeLog
r285846 r285868 1 2021-11-16 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WebGPU] Vertex and fragment shaders are not hooked up to pipeline creation 4 https://bugs.webkit.org/show_bug.cgi?id=233166 5 6 Reviewed by Dean Jackson. 7 8 I simply forgot to implement them in r285831. 9 10 * pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp: 11 (PAL::WebGPU::supportedLimits): 12 * pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp: 13 (PAL::WebGPU::convertToBacking): 14 1 15 2021-11-15 Sam Weinig <weinig@apple.com> 2 16 -
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp
r285831 r285868 90 90 { 91 91 WGPUSupportedLimits limits; 92 wgpuAdapterGetLimits(adapter, &limits); 92 limits.nextInChain = nullptr; 93 auto result = wgpuAdapterGetLimits(adapter, &limits); 94 ASSERT_UNUSED(result, result); 93 95 return SupportedLimits::create( 94 96 limits.limits.maxTextureDimension1D, -
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp
r285831 r285868 236 236 auto label = descriptor.label.utf8(); 237 237 238 auto source = descriptor.code.utf8(); 239 240 WGPUShaderModuleWGSLDescriptor backingWGSLDescriptor { 241 { 242 nullptr, 243 WGPUSType_ShaderModuleWGSLDescriptor, 244 }, 245 source.data(), 246 }; 247 238 248 WGPUShaderModuleDescriptor backingDescriptor { 239 nullptr,249 &backingWGSLDescriptor.chain, 240 250 label.data(), 241 251 }; … … 251 261 auto entryPoint = descriptor.compute.entryPoint.utf8(); 252 262 253 Vector<CString> keys;254 keys.reserveInitialCapacity(descriptor.compute.constants.size());263 Vector<CString> constantNames; 264 constantNames.reserveInitialCapacity(descriptor.compute.constants.size()); 255 265 for (const auto& constant : descriptor.compute.constants) 256 keys.uncheckedAppend(constant.key.utf8());266 constantNames.uncheckedAppend(constant.key.utf8()); 257 267 258 268 Vector<WGPUConstantEntry> backingConstantEntries; … … 262 272 backingConstantEntries.uncheckedAppend(WGPUConstantEntry { 263 273 nullptr, 264 keys[i].data(),274 constantNames[i].data(), 265 275 constant.value 266 276 }); … … 293 303 { 294 304 auto label = descriptor.label.utf8(); 305 306 auto vertexEntryPoint = descriptor.vertex.entryPoint.utf8(); 307 308 Vector<CString> vertexConstantNames; 309 vertexConstantNames.reserveInitialCapacity(descriptor.vertex.constants.size()); 310 for (const auto& constant : descriptor.vertex.constants) 311 vertexConstantNames.uncheckedAppend(constant.key.utf8()); 312 313 Vector<WGPUConstantEntry> vertexConstantEntries; 314 vertexConstantEntries.reserveInitialCapacity(descriptor.vertex.constants.size()); 315 for (size_t i = 0; i < descriptor.vertex.constants.size(); ++i) { 316 const auto& constant = descriptor.vertex.constants[i]; 317 vertexConstantEntries.uncheckedAppend(WGPUConstantEntry { 318 nullptr, 319 vertexConstantNames[i].data(), 320 constant.value, 321 }); 322 } 295 323 296 324 Vector<Vector<WGPUVertexAttribute>> backingAttributes; … … 345 373 descriptor.depthStencil ? descriptor.depthStencil->depthBiasClamp : 0, 346 374 }; 375 376 auto fragmentEntryPoint = descriptor.fragment ? descriptor.fragment->entryPoint.utf8() : CString(""); 377 378 Vector<CString> fragmentConstantNames; 379 if (descriptor.fragment) { 380 fragmentConstantNames.reserveInitialCapacity(descriptor.fragment->constants.size()); 381 for (const auto& constant : descriptor.fragment->constants) 382 fragmentConstantNames.uncheckedAppend(constant.key.utf8()); 383 } 384 385 Vector<WGPUConstantEntry> fragmentConstantEntries; 386 if (descriptor.fragment) { 387 fragmentConstantEntries.reserveInitialCapacity(descriptor.fragment->constants.size()); 388 for (size_t i = 0; i < descriptor.fragment->constants.size(); ++i) { 389 const auto& constant = descriptor.fragment->constants[i]; 390 fragmentConstantEntries.uncheckedAppend(WGPUConstantEntry { 391 nullptr, 392 fragmentConstantNames[i].data(), 393 constant.value, 394 }); 395 } 396 } 347 397 348 398 Vector<std::optional<WGPUBlendState>> blendStates; … … 383 433 WGPUFragmentState fragmentState { 384 434 nullptr, 385 nullptr,386 nullptr,387 0,388 nullptr,435 descriptor.fragment ? convertToBackingContext.convertToBacking(descriptor.fragment->module) : nullptr, 436 fragmentEntryPoint.data(), 437 static_cast<uint32_t>(fragmentConstantEntries.size()), 438 fragmentConstantEntries.data(), 389 439 static_cast<uint32_t>(colorTargets.size()), 390 440 colorTargets.data(), … … 396 446 descriptor.layout ? convertToBackingContext.convertToBacking(*descriptor.layout) : nullptr, { 397 447 nullptr, 398 nullptr,399 nullptr,400 0,401 nullptr,448 convertToBackingContext.convertToBacking(descriptor.vertex.module), 449 vertexEntryPoint.data(), 450 static_cast<uint32_t>(vertexConstantEntries.size()), 451 vertexConstantEntries.data(), 402 452 static_cast<uint32_t>(backingBuffers.size()), 403 453 backingBuffers.data(), -
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.h
r285831 r285868 44 44 } 45 45 46 ~DeviceImpl();46 virtual ~DeviceImpl(); 47 47 48 48 private: -
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPURenderBundleEncoderImpl.h
r285831 r285868 43 43 } 44 44 45 ~RenderBundleEncoderImpl();45 virtual ~RenderBundleEncoderImpl(); 46 46 47 47 private: -
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPURenderPassEncoderImpl.h
r285831 r285868 43 43 } 44 44 45 ~RenderPassEncoderImpl();45 virtual ~RenderPassEncoderImpl(); 46 46 47 47 private:
Note:
See TracChangeset
for help on using the changeset viewer.