renaming param to samplerType

This commit is contained in:
Jeremy Nelson
2025-06-04 14:35:25 -07:00
committed by Jeremy Nelson
parent 0c01799c50
commit 6af38fa47f
3 changed files with 7 additions and 16 deletions

View File

@@ -845,7 +845,7 @@ void WebGPUDriver::beginRenderPass(Handle<HwRenderTarget> rth, RenderPassParams
<< " layers.";
uint8_t stencilMipLevel = stencilInfo.level;
uint32_t stencilArrayLayer = stencilInfo.layer;
customStencilView = hwTexture->getTextureView(stencilMipLevel,stencilArrayLayer);
customStencilView = hwTexture->getTextureView(stencilMipLevel, stencilArrayLayer);
customStencilFormat = hwTexture->getFormat();
}
}

View File

@@ -579,7 +579,7 @@ size_t WebGPUDescriptorSet::countEntitiesWithDynamicOffsets() const {
return mEntriesWithDynamicOffsetsCount;
}
WGPUTexture::WGPUTexture(SamplerType target, uint8_t levels, TextureFormat format,
WGPUTexture::WGPUTexture(SamplerType samplerType, uint8_t levels, TextureFormat format,
uint8_t samples, uint32_t width, uint32_t height, uint32_t depth, TextureUsage usage,
wgpu::Device const& device) noexcept {
assert_invariant(
@@ -593,12 +593,12 @@ WGPUTexture::WGPUTexture(SamplerType target, uint8_t levels, TextureFormat forma
mFormat = fToWGPUTextureFormat(format);
mUsage = fToWGPUTextureUsage(usage);
mAspect = fToWGPUTextureViewAspect(usage, format);
mSamplerType = target;
mSamplerType = samplerType;
mBlockWidth = filament::backend::getBlockWidth(format);
mBlockHeight = filament::backend::getBlockHeight(format);
wgpu::TextureDescriptor textureDescriptor{
.label = getUserTextureLabel(target),
.label = getUserTextureLabel(samplerType),
.usage = mUsage,
.dimension = target == SamplerType::SAMPLER_3D ? wgpu::TextureDimension::e3D
: wgpu::TextureDimension::e2D,
@@ -612,7 +612,7 @@ WGPUTexture::WGPUTexture(SamplerType target, uint8_t levels, TextureFormat forma
.viewFormats = nullptr,
};
switch (target) {
switch (samplerType) {
case SamplerType::SAMPLER_2D:
mArrayLayerCount = 1;
break;
@@ -638,7 +638,7 @@ WGPUTexture::WGPUTexture(SamplerType target, uint8_t levels, TextureFormat forma
FILAMENT_CHECK_POSTCONDITION(mTexture)
<< "Failed to create texture for " << textureDescriptor.label;
mTextureView = makeTextureView(0, levels, 0, mArrayLayerCount, target);
mTextureView = makeTextureView(0, levels, 0, mArrayLayerCount, samplerType);
}
WGPUTexture::WGPUTexture(WGPUTexture* src, uint8_t baseLevel, uint8_t levelCount) noexcept {
@@ -652,8 +652,6 @@ WGPUTexture::WGPUTexture(WGPUTexture* src, uint8_t baseLevel, uint8_t levelCount
mTextureView = makeTextureView(baseLevel, levelCount, 0, src->mArrayLayerCount, mSamplerType);
}
wgpu::TextureUsage WGPUTexture::fToWGPUTextureUsage(TextureUsage const& fUsage) {
wgpu::TextureUsage retUsage = wgpu::TextureUsage::None;
@@ -983,7 +981,6 @@ wgpu::TextureView WGPUTexture::getTextureView(uint8_t mipLevel, uint32_t arrayLa
return makeTextureView(mipLevel, 1, arrayLayer, 1, mSamplerType);
}
wgpu::TextureView WGPUTexture::makeTextureView(const uint8_t& baseLevel, const uint8_t& levelCount,
const uint32_t& baseArrayLayer, const uint32_t& arrayLayerCount,
SamplerType samplerType) const {

View File

@@ -198,7 +198,6 @@ public:
filament::backend::TextureUsage const& fUsage,
filament::backend::TextureFormat const& fFormat);
private:
// CreateTextureR has info for a texture and sampler. Texture Views are needed for binding,
// along with a sampler Current plan: Inherit the sampler and Texture to always exist (It is a
@@ -213,13 +212,11 @@ private:
size_t mBlockHeight;
SamplerType mSamplerType;
wgpu::TextureUsage fToWGPUTextureUsage(filament::backend::TextureUsage const& fUsage);
wgpu::TextureView makeTextureView(const uint8_t& baseLevel, const uint8_t& levelCount,
const uint32_t& baseArrayLayer, const uint32_t& arrayLayerCount,
SamplerType samplerType) const;
};
struct WGPURenderPrimitive : public HwRenderPrimitive {
@@ -258,7 +255,6 @@ public:
wgpu::TextureFormat customDepthFormat,
wgpu::TextureFormat customStencilFormat);
bool isDefaultRenderTarget() const { return defaultRenderTarget; }
uint8_t getSamples() const { return mSamples; }
uint8_t getLayerCount() const { return mLayerCount; }
@@ -271,9 +267,7 @@ public:
// Static helpers for load/store operations
static wgpu::LoadOp getLoadOperation(const RenderPassParams& params, TargetBufferFlags buffer);
static wgpu::StoreOp getStoreOperation(const RenderPassParams& params, TargetBufferFlags buffer);
private:
bool defaultRenderTarget = false;
uint8_t mSamples = 1;