WebGPU (Chrome 119) এ নতুন কি আছে

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

ফিল্টারযোগ্য 32-বিট ফ্লোট টেক্সচার

32-বিট ফ্লোটিং-পয়েন্ট টেক্সচারগুলি উচ্চ-নির্ভুল ডেটা সংরক্ষণ করতে ব্যবহৃত হয়, যেমন HDR চিত্র এবং গভীরতার মানচিত্র। হাই-এন্ড গেমিং এবং পেশাদার অ্যাপ্লিকেশনগুলিতে ব্যবহৃত জিপিইউগুলির জন্য এগুলি বিশেষভাবে গুরুত্বপূর্ণ।

ফিল্টারযোগ্য 32-বিট ফ্লোট টেক্সচার সমর্থন 32-বিট ফ্লোটিং-পয়েন্ট টেক্সচার ফিল্টার করার জন্য একটি GPU-এর ক্ষমতা বর্ণনা করে। এর মানে হল যে GPU ফ্লোটিং-পয়েন্ট টেক্সচারের প্রান্তগুলিকে মসৃণ করতে পারে, যার ফলে সেগুলি কম জ্যাগড দেখায়। এটি WebGL-এর "OES_texture_float_linear" এক্সটেনশনের মতো।

সমস্ত GPU ফিল্টারযোগ্য 32-বিট ফ্লোট টেক্সচার সমর্থন করে না। যখন একটি GPUAdapter"float32-filterable" বৈশিষ্ট্যটি উপলব্ধ থাকে, তখন আপনি এখন এই বৈশিষ্ট্যটি সহ একটি GPUDevice জন্য অনুরোধ করতে পারেন এবং "r32float", "rg32float" এবং "rgba32float" বিন্যাস সহ টেক্সচার ফিল্টার করতে পারেন৷ নিচের উদাহরণটি দেখুন এবং ভোরের সংখ্যাটি দেখুন:1664

const adapter = await navigator.gpu.requestAdapter();
if (!adapter.features.has("float32-filterable")) {
  throw new Error("Filterable 32-bit float textures support is not available");
}
// Explicitly request filterable 32-bit float textures support.
const device = await adapter.requestDevice({
  requiredFeatures: ["float32-filterable"],
});

// Create a sampler with linear filtering.
const sampler = device.createSampler({
  magFilter: "linear",
});

// Create a texture with rgba32float format.
const texture = device.createTexture({
  size: [100, 100],
  format: "rgba32float",
  usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.TEXTURE_BINDING,
});

// Write data to texture, create a bindgroup with sampler and texture and
// send the appropriate commands to the GPU....

unorm10-10-10-2 শীর্ষবিন্দু বিন্যাস

WebGPU স্পেসিফিকেশনে "unorm10-10-10-2" ওরফে "rgb10a2" নামে একটি নতুন ভার্টেক্স ফরম্যাট যোগ করা হয়েছে। এটি 10 ​​বিট, 10 বিট, 10 বিট এবং 2 বিট হিসাবে সাজানো চারটি স্বাভাবিক স্বাক্ষরবিহীন পূর্ণসংখ্যা মান সহ একটি প্যাকযুক্ত 32-বিট মান নিয়ে গঠিত। নিচের উদাহরণটি দেখুন এবং ইস্য্যু ডন:2044

// Define the layout of vertex attribute data with unorm10-10-10-2 format.
const buffers = [
  {
    arrayStride: 0,
    attributes: [
      { format: "unorm10-10-10-2", offset: 0, shaderLocation: 0 },
    ],
  },
];

// Describe the vertex shader entry point and its input buffer layouts.
const vertex = {
  module: myVertexShaderModule,
  entryPoint: "main",
  buffers,
};

// Pass vertex to device.createRenderPipeline() and
// use vec4<f32> type in WGSL shader code to manipulate data.

rgb10a2uint টেক্সচার ফরম্যাট

WebGPU স্পেসিফিকেশনে "rgb10a2uint" নামে একটি নতুন টেক্সচার ফরম্যাট যোগ করা হয়েছে। এটি একটি 32-বিট প্যাকড পিক্সেল বিন্যাস নিয়ে গঠিত চারটি স্বাক্ষরবিহীন পূর্ণসংখ্যা উপাদান সহ: 10-বিট লাল, 10-বিট সবুজ, 10-বিট নীল এবং 2-বিট আলফা। নিম্নলিখিত উদাহরণ দেখুন এবং ইস্য্যু ডন:1936

// Create a texture with rgb10a2uint format.
const texture = device.createTexture({
  size: [100, 100],
  format: "rgb10a2uint",
  usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.TEXTURE_BINDING,
});

// Write data to texture, create a bindgroup with texture and
// send the appropriate commands to the GPU....

ভোরের আপডেট

টাইমস্ট্যাম্প ক্যোয়ারী WebGPU অ্যাপ্লিকেশনগুলিকে সঠিকভাবে পরিমাপ করতে দেয় (ন্যানোসেকেন্ড পর্যন্ত) তাদের GPU কমান্ডগুলি কার্যকর করতে কত সময় নেয়। পাসের শুরুতে এবং শেষে টাইমস্ট্যাম্পের প্রশ্নগুলি ক্যাপচার করার জন্য API আকৃতি WebGPU স্পেসিফিকেশনের সাথে মেলে আপডেট করা হয়েছে। নিম্নলিখিত উদাহরণ দেখুন এবং ইস্যুর ভোর:1800

// Create a timestamp query set that will store the timestamp values.
wgpu::QuerySetDescriptor querySetDescriptor = {
    .count = 2,
    .type = wgpu::QueryType::Timestamp};
wgpu::QuerySet querySet = device.CreateQuerySet(&querySetDescriptor);

wgpu::RenderPassTimestampWrites timestampWrites = {
    .querySet = querySet,
    .beginningOfPassWriteIndex = 0,
    .endOfPassWriteIndex = 1};
wgpu::ComputePassDescriptor pass{.timestampWrites = &timestampWrites};

// Write the queue timestamp into beginningOfPassWriteIndex and
// endOfPassWriteIndex of myQuerySet respectively before and after the pass
// commands execute.
myEncoder.BeginComputePass(&pass);

এটি শুধুমাত্র কিছু মূল হাইলাইট কভার করে। কমিটের সম্পূর্ণ তালিকা দেখুন।

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

ওয়েবজিপিইউ সিরিজে নতুন কী কভার করা হয়েছে তার একটি তালিকা।

ক্রোম 125

ক্রোম 124

ক্রোম 123

ক্রোম 122

ক্রোম 121

ক্রোম 120

ক্রোম 119

ক্রোম 118

ক্রোম 117

ক্রোম 116

ক্রোম 115

ক্রোম 114

ক্রোম 113