Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/renderers/webgpu/utils/WebGPUUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,29 +161,14 @@ class WebGPUUtils {
/**
* Returns a modified sample count from the given sample count value.
*
* That is required since WebGPU does not support arbitrary sample counts.
* That is required since WebGPU only supports either 1 or 4.
*
* @param {number} sampleCount - The input sample count.
* @return {number} The (potentially updated) output sample count.
*/
getSampleCount( sampleCount ) {

let count = 1;

if ( sampleCount > 1 ) {

// WebGPU only supports power-of-two sample counts and 2 is not a valid value
count = Math.pow( 2, Math.floor( Math.log2( sampleCount ) ) );

if ( count === 2 ) {

count = 4;

}

}

return count;
return sampleCount >= 4 ? 4 : 1;

}

Expand Down