Compare commits
4 Commits
ry/hello-w
...
pf/metal-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
320a5c91ad | ||
|
|
ff3bd4dc4d | ||
|
|
b950598d11 | ||
|
|
0e1e5fb381 |
@@ -1005,7 +1005,8 @@ ShaderModel MetalDriver::getShaderModel() const noexcept {
|
||||
|
||||
utils::FixedCapacityVector<ShaderLanguage> MetalDriver::getShaderLanguages(
|
||||
ShaderLanguage preferredLanguage) const noexcept {
|
||||
if (preferredLanguage == backend::ShaderLanguage::MSL) {
|
||||
if (preferredLanguage == backend::ShaderLanguage::UNSPECIFIED ||
|
||||
preferredLanguage == backend::ShaderLanguage::MSL) {
|
||||
return { backend::ShaderLanguage::MSL, backend::ShaderLanguage::METAL_LIBRARY };
|
||||
}
|
||||
return { backend::ShaderLanguage::METAL_LIBRARY, backend::ShaderLanguage::MSL };
|
||||
|
||||
@@ -32,25 +32,27 @@ namespace filament::backend {
|
||||
FenceStatus VulkanCmdFence::wait(VkDevice device, uint64_t const timeout,
|
||||
std::chrono::steady_clock::time_point const until) {
|
||||
|
||||
std::shared_lock l(mLock);
|
||||
{
|
||||
std::shared_lock l(mLock);
|
||||
|
||||
// If the vulkan fence has not been submitted yet, we need to wait for that before we
|
||||
// can use vkWaitForFences()
|
||||
if (mStatus == VK_INCOMPLETE) {
|
||||
bool const success = mCond.wait_until(l, until, [this] {
|
||||
// Internally we use the VK_INCOMPLETE status to mean "not yet submitted".
|
||||
// When this fence gets submitted, its status changes to VK_NOT_READY.
|
||||
return mStatus != VK_INCOMPLETE;
|
||||
});
|
||||
if (!success) {
|
||||
// !success indicates a timeout
|
||||
return FenceStatus::TIMEOUT_EXPIRED;
|
||||
// If the vulkan fence has not been submitted yet, we need to wait for that before we
|
||||
// can use vkWaitForFences()
|
||||
if (mStatus == VK_INCOMPLETE) {
|
||||
bool const success = mCond.wait_until(l, until, [this] {
|
||||
// Internally we use the VK_INCOMPLETE status to mean "not yet submitted".
|
||||
// When this fence gets submitted, its status changes to VK_NOT_READY.
|
||||
return mStatus != VK_INCOMPLETE;
|
||||
});
|
||||
if (!success) {
|
||||
// !success indicates a timeout
|
||||
return FenceStatus::TIMEOUT_EXPIRED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The fence could have already signaled, avoid calling into vkWaitForFences()
|
||||
if (mStatus == VK_SUCCESS) {
|
||||
return FenceStatus::CONDITION_SATISFIED;
|
||||
// The fence could have already signaled, avoid calling into vkWaitForFences()
|
||||
if (mStatus == VK_SUCCESS) {
|
||||
return FenceStatus::CONDITION_SATISFIED;
|
||||
}
|
||||
}
|
||||
|
||||
// If we're here, we know that vkQueueSubmit has been called (because it sets the status
|
||||
@@ -60,13 +62,17 @@ FenceStatus VulkanCmdFence::wait(VkDevice device, uint64_t const timeout,
|
||||
// place simultaneously. vkResetFence is only called once it knows the fence has signaled,
|
||||
// which guaranties that vkResetFence won't have to wait too long, just enough for
|
||||
// all the vkWaitForFences() to return.
|
||||
mStatus = vkWaitForFences(device, 1, &mFence, VK_TRUE, timeout);
|
||||
if (mStatus == VK_SUCCESS) {
|
||||
return FenceStatus::CONDITION_SATISFIED;
|
||||
}
|
||||
if (mStatus == VK_TIMEOUT) {
|
||||
VkResult status = vkWaitForFences(device, 1, &mFence, VK_TRUE, timeout);
|
||||
if (status == VK_TIMEOUT) {
|
||||
return FenceStatus::TIMEOUT_EXPIRED;
|
||||
}
|
||||
|
||||
if (status == VK_SUCCESS) {
|
||||
std::lock_guard const l(mLock);
|
||||
mStatus = status;
|
||||
return FenceStatus::CONDITION_SATISFIED;
|
||||
}
|
||||
|
||||
return FenceStatus::ERROR; // not supported
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +267,8 @@ void VulkanPipelineCache::bindVertexArray(VkVertexInputAttributeDescription cons
|
||||
mPipelineRequirements.vertexAttributes[i] = attribDesc[i];
|
||||
mPipelineRequirements.vertexBuffers[i] = bufferDesc[i];
|
||||
} else {
|
||||
mPipelineRequirements.vertexAttributes[i] = {};
|
||||
mPipelineRequirements.vertexBuffers[i] = {};
|
||||
mPipelineRequirements.vertexAttributes[i] = VertexInputAttributeDescription{};
|
||||
mPipelineRequirements.vertexBuffers[i] = VertexInputBindingDescription{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ VulkanStage* VulkanStagePool::allocateNewStage(uint32_t capacity) {
|
||||
return new VulkanStage(memory, buffer, capacity, pMapping);
|
||||
}
|
||||
|
||||
void VulkanStagePool::destroyStage(VulkanStage const*&& stage) {
|
||||
void VulkanStagePool::destroyStage(VulkanStage const* stage) {
|
||||
assert(stage->isSafeToReset()); // Ensure all segments have been reset already.
|
||||
vmaUnmapMemory(mAllocator, stage->memory());
|
||||
vmaDestroyBuffer(mAllocator, stage->buffer(), stage->memory());
|
||||
@@ -196,7 +196,7 @@ fvkmemory::resource_ptr<VulkanStageImage::Resource> VulkanStagePool::acquireImag
|
||||
|
||||
VkImage image;
|
||||
VmaAllocation memory;
|
||||
const UTILS_UNUSED VkResult result = vmaCreateImage(mAllocator, &imageInfo, &allocInfo,
|
||||
UTILS_UNUSED const VkResult result = vmaCreateImage(mAllocator, &imageInfo, &allocInfo,
|
||||
&image, &memory, nullptr);
|
||||
|
||||
assert_invariant(result == VK_SUCCESS);
|
||||
@@ -239,7 +239,7 @@ void VulkanStagePool::gc() noexcept {
|
||||
FVK_LOGD << "Destroying a staging buffer with hndl " << pair.second->buffer()
|
||||
<< utils::io::endl;
|
||||
#endif
|
||||
destroyStage(std::move(pair.second));
|
||||
destroyStage(pair.second);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ void VulkanStagePool::gc() noexcept {
|
||||
|
||||
void VulkanStagePool::terminate() noexcept {
|
||||
for (auto& pair : mStages) {
|
||||
destroyStage(std::move(pair.second));
|
||||
destroyStage(pair.second);
|
||||
}
|
||||
mStages.clear();
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ private:
|
||||
// unmapping memory, freeing the allocation, and deleting the VulkanStage
|
||||
// object. Note: takes an r-value because after this call, `stage` won't
|
||||
// exist.
|
||||
void destroyStage(VulkanStage const*&& stage);
|
||||
void destroyStage(VulkanStage const* stage);
|
||||
|
||||
// Use an ordered multimap for quick (capacity => stage) lookups using lower_bound().
|
||||
std::multimap<uint32_t, VulkanStage*> mStages;
|
||||
|
||||
@@ -179,7 +179,7 @@ TEST_F(BackendTest, FeedbackLoops) {
|
||||
|
||||
auto descriptorSet = shader.createDescriptorSet(api);
|
||||
auto textureView = passCleanup.add(api.createTextureView(texture, sourceLevel, 1));
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, textureView, {
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, textureView, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -216,7 +216,7 @@ TEST_F(BackendTest, FeedbackLoops) {
|
||||
|
||||
auto descriptorSet = shader.createDescriptorSet(api);
|
||||
auto textureView = passCleanup.add(api.createTextureView(texture, sourceLevel, 1));
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, textureView, {
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, textureView, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
|
||||
@@ -362,7 +362,7 @@ TEST_F(LoadImageTest, UpdateImage2D) {
|
||||
}
|
||||
|
||||
DescriptorSetHandle descriptorSet = shader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, {
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST,
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
|
||||
@@ -446,7 +446,7 @@ TEST_F(LoadImageTest, UpdateImageSRGB) {
|
||||
|
||||
// Update samplers.
|
||||
DescriptorSetHandle descriptorSet = shader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, {
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -513,7 +513,7 @@ TEST_F(LoadImageTest, UpdateImageMipLevel) {
|
||||
|
||||
// Update samplers.
|
||||
DescriptorSetHandle descriptorSet = shader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, {
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -602,9 +602,9 @@ TEST_F(LoadImageTest, UpdateImage3D) {
|
||||
|
||||
// Update samplers.
|
||||
DescriptorSetHandle descriptorSet = shader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture,
|
||||
{ .filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST });
|
||||
api.updateDescriptorSetTexture(descriptorSet, 0, texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST });
|
||||
|
||||
api.bindDescriptorSet(descriptorSet, 0, {});
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ TEST_F(BackendTest, TextureViewLod) {
|
||||
params.viewport = getFullViewport();
|
||||
|
||||
DescriptorSetHandle descriptorSet13 = texturedShader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet13, 0, texture13, {
|
||||
api.updateDescriptorSetTexture(descriptorSet13, 0, texture13, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST,
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
|
||||
@@ -185,7 +185,7 @@ TEST_F(BackendTest, TextureViewLod) {
|
||||
auto texture22 = cleanup.add(api.createTextureView(texture, 2, 2));
|
||||
|
||||
DescriptorSetHandle descriptorSet22 = texturedShader.createDescriptorSet(api);
|
||||
api.updateDescriptorSetTexture(descriptorSet22, 0, texture22, {
|
||||
api.updateDescriptorSetTexture(descriptorSet22, 0, texture22, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST,
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ PostProcessManager::StructurePassOutput PostProcessManager::structure(FrameGraph
|
||||
for (size_t level = 0; level < levelCount - 1; level++) {
|
||||
auto out = resources.getRenderPassInfo(level);
|
||||
auto th = driver.createTextureView(in, level, 1);
|
||||
mi->setParameter("depth", th, {
|
||||
mi->setParameter("depth", th, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->commit(driver);
|
||||
mi->use(driver);
|
||||
@@ -1048,8 +1048,8 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::screenSpaceAmbientOcclusion(
|
||||
|
||||
// Set common material parameters
|
||||
mi->setParameter("invRadiusSquared", 1.0f / (options.radius * options.radius));
|
||||
mi->setParameter("depth", depth,
|
||||
{ .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("depth", depth, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("screenFromViewMatrix",
|
||||
mat4f(screenFromClipMatrix * cameraInfo.projection));
|
||||
mi->setParameter("resolution",
|
||||
@@ -1372,11 +1372,11 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::gaussianBlurPass(FrameGraph&
|
||||
auto setCommonParams = [&](FMaterialInstance* const mi) {
|
||||
// Initialize the samplers with dummy textures because vulkan requires a sampler to
|
||||
// be bound to a texture even if sampler might be unused.
|
||||
mi->setParameter("sourceArray"sv, getZeroTextureArray(), {
|
||||
mi->setParameter("sourceArray"sv, getZeroTextureArray(), SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
mi->setParameter("source"sv, getZeroTexture(), {
|
||||
mi->setParameter("source"sv, getZeroTexture(), SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -1389,8 +1389,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::gaussianBlurPass(FrameGraph&
|
||||
// horizontal pass
|
||||
auto mi = getMaterialInstance(mEngine, separableGaussianBlur);
|
||||
setCommonParams(mi);
|
||||
mi->setParameter(sourceParameterName, hwIn,
|
||||
{
|
||||
mi->setParameter(sourceParameterName, hwIn, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST,
|
||||
});
|
||||
@@ -1413,8 +1412,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::gaussianBlurPass(FrameGraph&
|
||||
assert_invariant(width == hwOutRT.params.viewport.width);
|
||||
assert_invariant(height == hwOutRT.params.viewport.height);
|
||||
|
||||
mi->setParameter(sourceParameterName, hwTemp,
|
||||
{
|
||||
mi->setParameter(sourceParameterName, hwTemp, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR, /* level is always 0 */
|
||||
});
|
||||
@@ -1819,8 +1817,10 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
getPostProcessMaterial("dofDownsample");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
|
||||
mi->setParameter("color", color, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("depth", depth, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("depth", depth, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("cocParams", cocParams);
|
||||
mi->setParameter("cocClamp", float2{
|
||||
-(dofOptions.maxForegroundCOC ? dofOptions.maxForegroundCOC : DOF_DEFAULT_MAX_COC),
|
||||
@@ -1889,8 +1889,10 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
auto inCoc = driver.createTextureView(inOutCoc, level, 1);
|
||||
FMaterialInstance* const mi = getMaterialInstance(ma);
|
||||
|
||||
mi->setParameter("color", inColor, { .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("coc", inCoc, { .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("color", inColor, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("coc", inCoc, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("weightScale", 0.5f / float(1u << level)); // FIXME: halfres?
|
||||
mi->setParameter("texelSize", float2{ 1.0f / w, 1.0f / h });
|
||||
mi->commit(driver);
|
||||
@@ -1956,7 +1958,8 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
getPostProcessMaterial("dofTilesSwizzle") :
|
||||
getPostProcessMaterial("dofTiles");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("cocMinMax", inCocMinMax, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("cocMinMax", inCocMinMax, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("texelSize", float2{ 1.0f / inputDesc.width, 1.0f / inputDesc.height });
|
||||
commitAndRenderFullScreenQuad(driver, out, mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
@@ -1992,7 +1995,8 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
auto inTilesCocMinMax = resources.getTexture(data.inTilesCocMinMax);
|
||||
auto const& material = getPostProcessMaterial("dofDilate");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("tiles", inTilesCocMinMax, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("tiles", inTilesCocMinMax, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
commitAndRenderFullScreenQuad(driver, out, mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
});
|
||||
@@ -2055,14 +2059,14 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
auto const& material = getPostProcessMaterial("dof");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
// it's not safe to use bilinear filtering in the general case (causes artifacts around edges)
|
||||
mi->setParameter("color", color,
|
||||
{ .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("colorLinear", color,
|
||||
{ .filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST });
|
||||
mi->setParameter("coc", coc,
|
||||
{ .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax,
|
||||
{ .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("colorLinear", color, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST });
|
||||
mi->setParameter("coc", coc, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("cocToTexelScale", float2{
|
||||
bokehScale.x / (inputDesc.width * dofResolution),
|
||||
bokehScale.y / (inputDesc.height * dofResolution)
|
||||
@@ -2118,9 +2122,12 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
|
||||
auto const& material = getPostProcessMaterial("dofMedian");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("dof", inColor, { .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("alpha", inAlpha, { .filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("dof", inColor, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("alpha", inAlpha, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
commitAndRenderFullScreenQuad(driver, out, mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
});
|
||||
@@ -2169,10 +2176,14 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::dof(FrameGraph& fg,
|
||||
|
||||
auto const& material = getPostProcessMaterial("dofCombine");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("color", color, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("dof", dof, { .filterMag = SamplerMagFilter::NEAREST });
|
||||
mi->setParameter("alpha", alpha, { .filterMag = SamplerMagFilter::NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax, { .filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
mi->setParameter("dof", dof, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST });
|
||||
mi->setParameter("alpha", alpha, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST });
|
||||
mi->setParameter("tiles", tilesCocMinMax, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST });
|
||||
commitAndRenderFullScreenQuad(driver, out, mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
});
|
||||
@@ -2202,7 +2213,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::downscalePass(FrameGraph& fg
|
||||
auto const& out = resources.getRenderPassInfo();
|
||||
auto const& material = getPostProcessMaterial("bloomDownsample2x");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("source", resources.getTexture(data.input), {
|
||||
mi->setParameter("source", resources.getTexture(data.input), SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
@@ -2362,7 +2373,7 @@ PostProcessManager::BloomPassOutput PostProcessManager::bloom(FrameGraph& fg,
|
||||
auto vp = resources.getRenderPassInfo(data.outRT[i-1]).params.viewport;
|
||||
auto* const mi = (vp.width & 1 || vp.height & 1) ? mi13 : mi9;
|
||||
auto hwOutView = driver.createTextureView(hwOut, i - 1, 1);
|
||||
mi->setParameter("source", hwOutView, {
|
||||
mi->setParameter("source", hwOutView, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST });
|
||||
commitAndRenderFullScreenQuad(driver, hwDstRT, mi);
|
||||
@@ -2411,7 +2422,7 @@ PostProcessManager::BloomPassOutput PostProcessManager::bloom(FrameGraph& fg,
|
||||
auto h = FTexture::valueForLevel(i - 1, outDesc.height);
|
||||
auto hwOutView = driver.createTextureView(hwOut, i, 1);
|
||||
mi->setParameter("resolution", float4{ w, h, 1.0f / w, 1.0f / h });
|
||||
mi->setParameter("source", hwOutView, {
|
||||
mi->setParameter("source", hwOutView, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST});
|
||||
mi->commit(driver);
|
||||
@@ -2459,7 +2470,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::flarePass(FrameGraph& fg,
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material);
|
||||
|
||||
mi->setParameter("color", in, {
|
||||
mi->setParameter("color", in, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -2732,19 +2743,19 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::colorGrading(FrameGraph& fg,
|
||||
vignetteOptions, output.width, output.height);
|
||||
|
||||
mi->setParameter("colorBuffer", colorTexture, { /* shader uses texelFetch */ });
|
||||
mi->setParameter("bloomBuffer", bloomTexture, {
|
||||
mi->setParameter("bloomBuffer", bloomTexture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR /* always read base level in shader */
|
||||
});
|
||||
mi->setParameter("flareBuffer", flareTexture, {
|
||||
mi->setParameter("flareBuffer", flareTexture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
mi->setParameter("dirtBuffer", dirtTexture, {
|
||||
mi->setParameter("dirtBuffer", dirtTexture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
mi->setParameter("starburstBuffer", starburstTexture, {
|
||||
mi->setParameter("starburstBuffer", starburstTexture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR,
|
||||
.wrapS = SamplerWrapMode::REPEAT,
|
||||
@@ -2815,7 +2826,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::fxaa(FrameGraph& fg,
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material, variant);
|
||||
|
||||
mi->setParameter("colorBuffer", texture, {
|
||||
mi->setParameter("colorBuffer", texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
@@ -2936,7 +2947,7 @@ FMaterialInstance* PostProcessManager::configureColorGradingMaterial(
|
||||
: mFixedMaterialInstanceIndex.colorGradingOpaque;
|
||||
std::tie(mi, fixedIndex) = mMaterialInstanceManager.getFixedMaterialInstance(ma);
|
||||
|
||||
const SamplerParams params = {
|
||||
const SamplerParams params = SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR,
|
||||
.wrapS = SamplerWrapMode::CLAMP_TO_EDGE,
|
||||
@@ -3087,10 +3098,10 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::taa(FrameGraph& fg,
|
||||
FMaterial const* const ma = material.getMaterial(mEngine, variant);
|
||||
|
||||
FMaterialInstance* mi = getMaterialInstance(ma);
|
||||
mi->setParameter("color", color, {}); // nearest
|
||||
mi->setParameter("depth", depth, {}); // nearest
|
||||
mi->setParameter("color", color, SamplerParams{}); // nearest
|
||||
mi->setParameter("depth", depth, SamplerParams{}); // nearest
|
||||
mi->setParameter("alpha", taaOptions.feedback);
|
||||
mi->setParameter("history", history, {
|
||||
mi->setParameter("history", history, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
@@ -3181,7 +3192,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::rcas(
|
||||
FSRUniforms uniforms;
|
||||
FSR_SharpeningSetup(&uniforms, { .sharpness = 2.0f - 2.0f * sharpness });
|
||||
mi->setParameter("RcasCon", uniforms.RcasCon);
|
||||
mi->setParameter("color", input, {}); // uses texelFetch
|
||||
mi->setParameter("color", input, SamplerParams{}); // uses texelFetch
|
||||
mi->setParameter("resolution", float4{
|
||||
outputDesc.width, outputDesc.height,
|
||||
1.0f / outputDesc.width, 1.0f / outputDesc.height });
|
||||
@@ -3264,7 +3275,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::upscaleBilinear(FrameGraph&
|
||||
auto& material = getPostProcessMaterial("blitLow");
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMag = filter
|
||||
});
|
||||
|
||||
@@ -3342,7 +3353,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::upscaleSGSR1(FrameGraph& fg,
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material, variant);
|
||||
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
// The SGSR documentation doesn't clarify if LINEAR or NEAREST should be used. The
|
||||
// sample code uses NEAREST, but that doesn't seem right, since it would mean the
|
||||
// LERP mode would not be a LERP, and the non-edges would be sampled as NEAREST.
|
||||
@@ -3452,7 +3463,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::upscaleFSR1(FrameGraph& fg,
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, *splitEasuMaterial);
|
||||
setEasuUniforms(mi, inputDesc, outputDesc);
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR
|
||||
});
|
||||
mi->setParameter("resolution",
|
||||
@@ -3471,7 +3482,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::upscaleFSR1(FrameGraph& fg,
|
||||
|
||||
setEasuUniforms(mi, inputDesc, outputDesc);
|
||||
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR
|
||||
});
|
||||
|
||||
@@ -3557,7 +3568,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::blit(FrameGraph& fg, bool co
|
||||
getPostProcessMaterial(layer ? "blitArray" : "blitLow");
|
||||
FMaterial const* const ma = material.getMaterial(mEngine);
|
||||
auto* mi = getMaterialInstance(ma);
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMag = filterMag,
|
||||
.filterMin = filterMin
|
||||
});
|
||||
@@ -3657,8 +3668,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::blitDepth(FrameGraph& fg,
|
||||
PostProcessMaterial const& material = getPostProcessMaterial("blitDepth");
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("depth", depth,
|
||||
{
|
||||
mi->setParameter("depth", depth, SamplerParams {
|
||||
.filterMag = SamplerMagFilter::NEAREST,
|
||||
.filterMin = SamplerMinFilter::NEAREST,
|
||||
});
|
||||
@@ -3771,7 +3781,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::resolveDepth(FrameGraph& fg,
|
||||
auto const& material = getPostProcessMaterial("resolveDepth");
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("depth", input, {}); // NEAREST
|
||||
mi->setParameter("depth", input, SamplerParams{}); // NEAREST
|
||||
commitAndRenderFullScreenQuad(driver, resources.getRenderPassInfo(), mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
});
|
||||
@@ -3824,7 +3834,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::vsmMipmapPass(FrameGraph& fg
|
||||
backend::Viewport const scissor = { 1u, 1u, dim - 2u, dim - 2u };
|
||||
|
||||
FMaterialInstance* const mi = getMaterialInstance(ma);
|
||||
mi->setParameter("color", in, {
|
||||
mi->setParameter("color", in, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_NEAREST
|
||||
});
|
||||
@@ -3869,8 +3879,8 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::debugShadowCascades(FrameGra
|
||||
auto const& material = getPostProcessMaterial("debugShadowCascades");
|
||||
FMaterialInstance* const mi =
|
||||
getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("color", color, {}); // nearest
|
||||
mi->setParameter("depth", depth, {}); // nearest
|
||||
mi->setParameter("color", color, SamplerParams{}); // nearest
|
||||
mi->setParameter("depth", depth, SamplerParams{}); // nearest
|
||||
commitAndRenderFullScreenQuad(driver, out, mi);
|
||||
unbindAllDescriptorSets(driver);
|
||||
});
|
||||
@@ -3922,7 +3932,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::debugCombineArrayTexture(Fra
|
||||
// It should be ok to not move this getMaterialInstance to inside the loop, since
|
||||
// this is a pass meant for debug.
|
||||
auto* mi = getMaterialInstance(ma);
|
||||
mi->setParameter("color", color, {
|
||||
mi->setParameter("color", color, SamplerParams{
|
||||
.filterMag = filterMag,
|
||||
.filterMin = filterMin
|
||||
});
|
||||
@@ -3997,7 +4007,7 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::debugDisplayShadowTexture(
|
||||
auto in = resources.getTexture(data.depth);
|
||||
auto const& material = getPostProcessMaterial("shadowmap");
|
||||
FMaterialInstance* const mi = getMaterialInstance(mEngine, material);
|
||||
mi->setParameter("shadowmap", in, {
|
||||
mi->setParameter("shadowmap", in, SamplerParams{
|
||||
.filterMin = SamplerMinFilter::NEAREST_MIPMAP_NEAREST });
|
||||
mi->setParameter("scale", s);
|
||||
mi->setParameter("layer", (uint32_t)layer);
|
||||
|
||||
@@ -79,14 +79,13 @@ public:
|
||||
|
||||
private:
|
||||
// These first fields are dereferences from PrimitiveInfo, keep them together
|
||||
struct {
|
||||
FMaterialInstance const* mMaterialInstance = nullptr;
|
||||
backend::Handle<backend::HwRenderPrimitive> mHandle = {};
|
||||
backend::Handle<backend::HwVertexBufferInfo> mVertexBufferInfoHandle = {};
|
||||
uint32_t mIndexOffset = 0;
|
||||
uint32_t mIndexCount = 0;
|
||||
uint32_t mMorphingBufferOffset = 0;
|
||||
};
|
||||
FMaterialInstance const* mMaterialInstance = nullptr;
|
||||
backend::Handle<backend::HwRenderPrimitive> mHandle = {};
|
||||
backend::Handle<backend::HwVertexBufferInfo> mVertexBufferInfoHandle = {};
|
||||
uint32_t mIndexOffset = 0;
|
||||
uint32_t mIndexCount = 0;
|
||||
uint32_t mMorphingBufferOffset = 0;
|
||||
// End PrimitiveInfo fields.
|
||||
|
||||
AttributeBitset mEnabledAttributes = {};
|
||||
uint16_t mBlendOrder = 0;
|
||||
|
||||
@@ -112,7 +112,7 @@ ColorPassDescriptorSet::ColorPassDescriptorSet(FEngine& engine, bool const vsm,
|
||||
|
||||
setSampler(+PerViewBindingPoints::IBL_DFG_LUT,
|
||||
engine.getDFG().isValid() ?
|
||||
engine.getDFG().getTexture() : engine.getZeroTexture(), {
|
||||
engine.getDFG().getTexture() : engine.getZeroTexture(), SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR
|
||||
});
|
||||
}
|
||||
@@ -236,7 +236,7 @@ void ColorPassDescriptorSet::prepareFog(FEngine& engine, const CameraInfo& camer
|
||||
|
||||
setSampler(+PerViewBindingPoints::FOG,
|
||||
fogColorTextureHandle ?
|
||||
fogColorTextureHandle : engine.getDummyCubemap()->getHwHandleForSampling(), {
|
||||
fogColorTextureHandle : engine.getDummyCubemap()->getHwHandleForSampling(), SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_LINEAR
|
||||
});
|
||||
@@ -277,7 +277,7 @@ void ColorPassDescriptorSet::prepareSSAO(Handle<HwTexture> ssao,
|
||||
&& options.resolution < 1.0f;
|
||||
|
||||
// LINEAR filtering is only needed when AO is enabled and low-quality upsampling is used.
|
||||
setSampler(+PerViewBindingPoints::SSAO, ssao, {
|
||||
setSampler(+PerViewBindingPoints::SSAO, ssao, SamplerParams{
|
||||
.filterMag = options.enabled && !highQualitySampling ?
|
||||
SamplerMagFilter::LINEAR : SamplerMagFilter::NEAREST
|
||||
});
|
||||
@@ -293,7 +293,7 @@ void ColorPassDescriptorSet::prepareMaterialGlobals(
|
||||
}
|
||||
|
||||
void ColorPassDescriptorSet::prepareScreenSpaceRefraction(Handle<HwTexture> ssr) noexcept {
|
||||
setSampler(+PerViewBindingPoints::SSR, ssr, {
|
||||
setSampler(+PerViewBindingPoints::SSR, ssr, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_LINEAR
|
||||
});
|
||||
@@ -364,7 +364,7 @@ void ColorPassDescriptorSet::prepareAmbientLight(FEngine const& engine, FIndirec
|
||||
reflection = engine.getDummyCubemap()->getHwHandle();
|
||||
}
|
||||
setSampler(+PerViewBindingPoints::IBL_SPECULAR,
|
||||
reflection, {
|
||||
reflection, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR_MIPMAP_LINEAR
|
||||
});
|
||||
@@ -390,7 +390,7 @@ void ColorPassDescriptorSet::prepareShadowVSM(Handle<HwTexture> texture,
|
||||
filterMin = SamplerMinFilter::LINEAR_MIPMAP_LINEAR;
|
||||
}
|
||||
setSampler(+PerViewBindingPoints::SHADOW_MAP,
|
||||
texture, {
|
||||
texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = filterMin,
|
||||
.anisotropyLog2 = options.anisotropy,
|
||||
@@ -399,7 +399,7 @@ void ColorPassDescriptorSet::prepareShadowVSM(Handle<HwTexture> texture,
|
||||
|
||||
void ColorPassDescriptorSet::prepareShadowPCF(Handle<HwTexture> texture) noexcept {
|
||||
setSampler(+PerViewBindingPoints::SHADOW_MAP,
|
||||
texture, {
|
||||
texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR,
|
||||
.compareMode = SamplerCompareMode::COMPARE_TO_TEXTURE,
|
||||
@@ -416,7 +416,7 @@ void ColorPassDescriptorSet::prepareShadowPCSS(Handle<HwTexture> texture) noexce
|
||||
}
|
||||
|
||||
void ColorPassDescriptorSet::prepareShadowPCFDebug(Handle<HwTexture> texture) noexcept {
|
||||
setSampler(+PerViewBindingPoints::SHADOW_MAP, texture, {
|
||||
setSampler(+PerViewBindingPoints::SHADOW_MAP, texture, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::NEAREST,
|
||||
.filterMin = SamplerMinFilter::NEAREST
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ void SsrPassDescriptorSet::setFrameUniforms(FEngine const& engine,
|
||||
|
||||
void SsrPassDescriptorSet::prepareHistorySSR(FEngine const& engine, Handle<HwTexture> ssr) noexcept {
|
||||
mDescriptorSet.setSampler(engine.getPerViewDescriptorSetLayoutSsrVariant(),
|
||||
+PerViewBindingPoints::SSR_HISTORY, ssr, {
|
||||
+PerViewBindingPoints::SSR_HISTORY, ssr, SamplerParams{
|
||||
.filterMag = SamplerMagFilter::LINEAR,
|
||||
.filterMin = SamplerMinFilter::LINEAR
|
||||
});
|
||||
@@ -80,7 +80,7 @@ void SsrPassDescriptorSet::prepareStructure(FEngine const& engine,
|
||||
Handle<HwTexture> structure) noexcept {
|
||||
// sampler must be NEAREST
|
||||
mDescriptorSet.setSampler(engine.getPerViewDescriptorSetLayoutSsrVariant(),
|
||||
+PerViewBindingPoints::STRUCTURE, structure, {});
|
||||
+PerViewBindingPoints::STRUCTURE, structure, SamplerParams{});
|
||||
}
|
||||
|
||||
void SsrPassDescriptorSet::commit(FEngine& engine) noexcept {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <backend/TargetBufferInfo.h>
|
||||
|
||||
#include <filament/Viewport.h>
|
||||
#include <utils/debug.h>
|
||||
|
||||
namespace filament {
|
||||
|
||||
@@ -33,14 +34,20 @@ namespace filament {
|
||||
struct FrameGraphRenderPass {
|
||||
static constexpr size_t ATTACHMENT_COUNT = backend::MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT + 2;
|
||||
struct Attachments {
|
||||
union {
|
||||
FrameGraphId<FrameGraphTexture> array[ATTACHMENT_COUNT] = {};
|
||||
struct {
|
||||
FrameGraphId<FrameGraphTexture> color[backend::MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT];
|
||||
FrameGraphId<FrameGraphTexture> depth;
|
||||
FrameGraphId<FrameGraphTexture> stencil;
|
||||
};
|
||||
};
|
||||
FrameGraphId<FrameGraphTexture> color[backend::MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT];
|
||||
FrameGraphId<FrameGraphTexture> depth;
|
||||
FrameGraphId<FrameGraphTexture> stencil;
|
||||
|
||||
FrameGraphId<FrameGraphTexture>& operator[](size_t index) noexcept {
|
||||
assert_invariant(index < ATTACHMENT_COUNT);
|
||||
if (index < backend::MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT) {
|
||||
return color[index];
|
||||
} else if (index == backend::MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT) {
|
||||
return depth;
|
||||
} else {
|
||||
return stencil;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct Descriptor {
|
||||
|
||||
@@ -95,7 +95,7 @@ uint32_t RenderPassNode::declareRenderTarget(FrameGraph& fg, FrameGraph::Builder
|
||||
|
||||
for (size_t i = 0; i < RenderPassData::ATTACHMENT_COUNT; i++) {
|
||||
FrameGraphId<FrameGraphTexture> const& handle =
|
||||
data.descriptor.attachments.array[i];
|
||||
data.descriptor.attachments[i];
|
||||
if (handle) {
|
||||
data.attachmentInfo[i] = handle;
|
||||
|
||||
@@ -150,7 +150,7 @@ void RenderPassNode::resolve() noexcept {
|
||||
constexpr size_t STENCIL_INDEX = MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT + 1;
|
||||
|
||||
for (size_t i = 0; i < MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT + 2; i++) {
|
||||
if (rt.descriptor.attachments.array[i]) {
|
||||
if (rt.descriptor.attachments[i]) {
|
||||
const TargetBufferFlags target = getTargetBufferFlagsAt(i);
|
||||
|
||||
rt.targetBufferFlags |= target;
|
||||
@@ -174,7 +174,7 @@ void RenderPassNode::resolve() noexcept {
|
||||
if (!rt.incoming[i] || !rt.incoming[i]->hasActiveWriters()) {
|
||||
rt.backend.params.flags.discardStart |= target;
|
||||
}
|
||||
VirtualResource* pResource = mFrameGraph.getResource(rt.descriptor.attachments.array[i]);
|
||||
VirtualResource* pResource = mFrameGraph.getResource(rt.descriptor.attachments[i]);
|
||||
Resource<FrameGraphTexture>* pTextureResource = static_cast<Resource<FrameGraphTexture>*>(pResource);
|
||||
|
||||
pImportedRenderTarget = pImportedRenderTarget ?
|
||||
|
||||
@@ -196,10 +196,7 @@ if (WEBGL_PTHREADS)
|
||||
target_compile_definitions(gltfio_core PUBLIC -DFILAMENT_WASM_THREADS)
|
||||
endif()
|
||||
|
||||
set(GLTFIO_WARNINGS -Wall -Werror)
|
||||
if (NOT MSVC)
|
||||
target_compile_options(gltfio_core PRIVATE ${GLTFIO_WARNINGS})
|
||||
endif()
|
||||
target_compile_options(gltfio_core PRIVATE ${FILAMENT_WARNINGS})
|
||||
|
||||
if (NOT WEBGL AND NOT ANDROID AND NOT IOS)
|
||||
|
||||
|
||||
@@ -67,11 +67,6 @@ struct TangentSpaceMeshWrapper {
|
||||
short4* getQuats() noexcept;
|
||||
uint3* getTriangles();
|
||||
|
||||
template<typename T>
|
||||
using is_supported_aux_t = typename std::enable_if<
|
||||
std::is_same<float2*, T>::value || std::is_same<float3*, T>::value ||
|
||||
std::is_same<float4*, T>::value || std::is_same<ushort3*, T>::value ||
|
||||
std::is_same<ushort4*, T>::value>::type;
|
||||
template<typename T, typename = is_supported_aux_t<T>>
|
||||
T getAux(AuxType attribute) noexcept;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace utils {
|
||||
inline void* aligned_alloc(size_t size, size_t align) noexcept {
|
||||
// 'align' must be a power of two and a multiple of sizeof(void*)
|
||||
align = (align < sizeof(void*)) ? sizeof(void*) : align;
|
||||
assert(align && !(align & align - 1));
|
||||
assert(align && !(align & (align - 1)));
|
||||
assert((align % sizeof(void*)) == 0);
|
||||
|
||||
void* p = nullptr;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifndef VIEWER_TIFF_EXPORT_H
|
||||
#define VIEWER_TIFF_EXPORT_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
|
||||
void exportTIFF(void* buffer, uint32_t width, uint32_t height, std::ostream& outstream);
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
"description": "transmission",
|
||||
"apply_presets": ["base", "transmission_models"],
|
||||
"rendering": {
|
||||
"viewer.cameraFocalLength": 52.0,
|
||||
"view.screenSpaceReflections.enabled": true
|
||||
"viewer.cameraFocalLength": 52.0
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
1
third_party/draco/src/draco/io/file_utils.h
vendored
1
third_party/draco/src/draco/io/file_utils.h
vendored
@@ -15,6 +15,7 @@
|
||||
#ifndef DRACO_IO_FILE_UTILS_H_
|
||||
#define DRACO_IO_FILE_UTILS_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ static float sq(float x) { return x * x; }
|
||||
|
||||
constexpr float PI_F = 3.141592653589793238f;
|
||||
|
||||
static UTILS_UNUSED float sphericalCapsIntersection(float cosCap1, float cosCap2, float cosDistance) {
|
||||
UTILS_UNUSED static float sphericalCapsIntersection(float cosCap1, float cosCap2, float cosDistance) {
|
||||
// Oat and Sander 2007, "Ambient Aperture Lighting"
|
||||
float r1 = std::acos(cosCap1);
|
||||
float r2 = std::acos(cosCap2);
|
||||
|
||||
Reference in New Issue
Block a user