WebGPU-তে নতুন কী আছে (Chrome 115)

ফ্রাঁসোয়া বিউফোর্ট
François Beaufort

সমর্থিত WGSL ভাষা এক্সটেনশন

GPU অবজেক্টের wgslLanguageFeatures সদস্য সমর্থিত WGSL ভাষা এক্সটেনশনের নাম তালিকাভুক্ত করে। সমর্থিত WGSL ভাষা এক্সটেনশনগুলি স্বয়ংক্রিয়ভাবে সক্রিয় হয়, তাই আপনাকে স্পষ্টভাবে একটি অনুরোধ করার প্রয়োজন নেই। এই তালিকাটি বর্তমানে খালি তবে আপনি ভবিষ্যতে প্রচুর পরিমাণে আশা করতে পারেন (উদাহরণস্বরূপ, do-while loops )। সমস্যা dawn:1777 দেখুন।

if (navigator.gpu.wgslLanguageFeatures?.has("unknown-feature")) {
  // Use unknown-feature in WGSL shader code.
}

Direct3D 11 এর জন্য পরীক্ষামূলক সহায়তা

Chromium টিম Direct3D 11 এর জন্য WebGPU সাপোর্ট যোগ করার জন্য কাজ করছে। আপনি এখন --enable-unsafe-webgpu --use-webgpu-adapter=d3d11 কমান্ড-লাইন ফ্ল্যাগ ব্যবহার করে Windows এ Chrome চালিয়ে স্থানীয়ভাবে এটি পরীক্ষা করতে পারেন। সমস্যা dawn:1705 দেখুন।

এসি পাওয়ারে ডিফল্টভাবে ডিসক্রিট জিপিইউ পান

ডুয়াল GPU macOS ডিভাইসে, যদি powerPreference বিকল্প ছাড়াই requestAdapter() কল করা হয়, তাহলে ব্যবহারকারীর ডিভাইস AC পাওয়ারে থাকা অবস্থায় বিচ্ছিন্ন GPU ফেরত পাঠানো হয়। অন্যথায়, ইন্টিগ্রেটেড GPU ফেরত পাঠানো হয়। পরিবর্তন 4499307 দেখুন।

ডেভেলপারের অভিজ্ঞতা উন্নত করা হচ্ছে

নতুন DevTools সতর্কতা

If the depth key is used in a GPUExtend3DDict a warning is shown in the DevTools Console since the correct key is depthOrArrayLayers . See issue chromium:1440900 .

A warning is also raised if a GPUBlendComponent has a mix of explicit and defaulted members. See issue dawn:1785 .

Even though zero-size dispatches and draws are valid, a warning encourages developers to avoid them when possible. See issue dawn:1786 .

আরও ভালো ত্রুটি বার্তা

An improved error message is now provided when using a GPUCommandEncoder if finish() has been called already. See issue dawn:1736 .

When submitting command buffers with destroyed objects, the labels of the command buffers that were used in submit() are now visible in the error message. See issue dawn:1747 .

The invalid part of the depth stencil state is now specified in the error message when validating depthStencil . See issue dawn:1735 .

The minBindingSize validation error message now reports the group and number of the binding that failed validation, as well as the buffer. See issue dawn:1604 .

Error messages returned by the mapAsync() method on a GPUBuffer object have been improved to help developers when debugging. See an example below and issue chromium:1431622 .

// Create a GPU buffer and map it.
const descriptor = { size: 0, usage: GPUBufferUsage.MAP_READ };
const buffer = device.createBuffer(descriptor);
buffer.mapAsync(GPUMapMode.READ);

// Before it has been mapped, request another mapping.
try {
  await buffer.mapAsync(GPUMapMode.READ);
} catch (error) {
  // New! Error message tells you mapping is already pending.
  console.warn(error.message);
}

macOS ডিবাগিং টুলে লেবেল

use_user_defined_labels_in_backend ডিবাগ টগল আপনাকে অবজেক্ট লেবেলগুলিকে ব্যাকএন্ডে ফরোয়ার্ড করতে দেয় যাতে সেগুলি RenderDoc, PIX, অথবা Instruments এর মতো প্ল্যাটফর্ম-নির্দিষ্ট ডিবাগিং টুলগুলিতে দেখা যায়। এখন থেকে, যখন আপনি এটি ডিবাগিংয়ের জন্য সক্ষম করেন তখন macOS-এ আরও ভাল ডিবাগিং অভিজ্ঞতা প্রদান করা হয়। সমস্যা dawn:1784 দেখুন।

Screenshot of Instruments app on macOS featuring custom labels coming from WebGPU.
User defined labels in the Instruments app on macOS.

সংকলন ব্যর্থ হলে HLSL লগ করুন।

dump_shaders ডিবাগ টগল আপনাকে WGSL শেডার এবং অনুবাদিত ব্যাকএন্ড শেডার ইনপুট লগ করার অনুমতি দেয়। এখন থেকে, যখন আপনি এটি ডিবাগিংয়ের জন্য সক্ষম করবেন, তখন সংকলন ব্যর্থ হলে HLSL ডাম্প হয়ে যাবে। সমস্যাটি দেখুন dawn:1681

ভোরের আপডেট

ভার্টেক্স বাফার আনসেট করুন

wgpu::RenderPassEncoder অথবা wgpu::RenderBundleEncoder এ wgpu:: wgpu::Buffer পরিবর্তে SetVertexBuffer() -এ nullptr পাস করলে আপনি একটি নির্দিষ্ট স্লটে পূর্বে সেট করা একটি ভার্টেক্স বাফার আনসেট করতে পারবেন। সমস্যা dawn:1675 দেখুন।

// Set vertex buffer in slot 0.
myRenderPassEncoder.SetVertexBuffer(0, myVertexBuffer);

// Then later, unset vertex buffer in slot 0.
myRenderPassEncoder.SetVertexBuffer(0, nullptr);

ক্ষণস্থায়ী সংযুক্তি

আপনি এমন অ্যাটাচমেন্ট তৈরি করতে পারেন যা রেন্ডার পাস অপারেশনগুলিকে টাইল মেমোরিতে থাকতে দেয়, VRAM ট্র্যাফিক এড়াতে পারে এবং সম্ভাব্যভাবে টেক্সচারের জন্য VRAM বরাদ্দ এড়াতে পারে wgpu::TextureUsage::TransientAttachment ব্যবহার সেট করে। এই বৈশিষ্ট্যটি শুধুমাত্র মেটাল এবং Vulkan এর জন্য সমর্থিত। দেখুন ইস্যু dawn: 1695

wgpu::TextureDescriptor desc;
desc.format = wgpu::TextureFormat::RGBA8Unorm;
desc.size = {1, 1, 1};
desc.usage = wgpu::TextureUsage::RenderAttachment |
             wgpu::TextureUsage::TransientAttachment;

auto transientTexture = device.CreateTexture(&desc);

// You can now create views from the texture to serve as transient
// attachments, e.g. as color attachments in a render pipeline.

depot_tools ছাড়া ভবন

একটি নতুন DAWN_FETCH_DEPENDENCIES CMake বিকল্প আপনাকে একটি Python স্ক্রিপ্ট ব্যবহার করে Dawn নির্ভরতা আনতে সাহায্য করে যা DEPS ফাইলগুলি পড়ে, এর উপর নির্ভরশীল সমস্ত প্রকল্পের জন্য depot_tools ইনস্টল করার প্রয়োজন হয় না। পরিবর্তন 131750 দেখুন।

WebGPU-তে নতুন কী আছে

" What's New in WebGPU" সিরিজে যা যা আলোচনা করা হয়েছে তার একটি তালিকা।

ক্রোম ১৪২

ক্রোম ১৪১

ক্রোম ১৪০

ক্রোম ১৩৯

ক্রোম ১৩৮

ক্রোম ১৩৭

ক্রোম ১৩৬

ক্রোম ১৩৫

ক্রোম ১৩৪

ক্রোম ১৩৩

ক্রোম ১৩২

ক্রোম ১৩১

ক্রোম ১৩০

ক্রোম ১২৯

ক্রোম ১২৮

ক্রোম ১২৭

ক্রোম ১২৬

ক্রোম ১২৫

ক্রোম ১২৪

ক্রোম ১২৩

ক্রোম ১২২

ক্রোম ১২১

ক্রোম ১২০

ক্রোম ১১৯

ক্রোম ১১৮

ক্রোম ১১৭

ক্রোম ১১৬

ক্রোম ১১৫

ক্রোম ১১৪

ক্রোম ১১৩