mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-19 09:55:26 +00:00
Integrate Multiplanar External Texture Transform
Introduces the majority of the logic associated with enabling multiplanar external textures. Removes most backend logic associated with external textures in favor of expanding them into their components in the frontend. Includes a basic e2e test demonstrating multiplanar YUV-to-RGB conversion. Bug: dawn:1082 Change-Id: Ib5c042e5639b1a8efe2954680abc346c8c6c76d7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78248 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
e6e2bcf436
commit
cff04b4d3f
@@ -364,25 +364,9 @@ namespace dawn::native::opengl {
|
||||
break;
|
||||
}
|
||||
|
||||
case BindingInfoType::ExternalTexture: {
|
||||
const std::array<Ref<TextureViewBase>, kMaxPlanesPerFormat>&
|
||||
textureViews = mBindGroups[index]
|
||||
->GetBindingAsExternalTexture(bindingIndex)
|
||||
->GetTextureViews();
|
||||
|
||||
ASSERT(textureViews[2].Get() == nullptr);
|
||||
|
||||
TextureView* view = ToBackend(textureViews[0].Get());
|
||||
GLuint handle = view->GetHandle();
|
||||
GLenum target = view->GetGLTarget();
|
||||
GLuint viewIndex = indices[bindingIndex];
|
||||
|
||||
for (auto unit : mPipeline->GetTextureUnitsForTextureView(viewIndex)) {
|
||||
gl.ActiveTexture(GL_TEXTURE0 + unit);
|
||||
gl.BindTexture(target, handle);
|
||||
}
|
||||
case BindingInfoType::ExternalTexture:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,15 +268,18 @@ namespace dawn::native::opengl {
|
||||
const PipelineLayout* layout,
|
||||
bool* needsDummySampler) const {
|
||||
TRACE_EVENT0(GetDevice()->GetPlatform(), General, "TranslateToGLSL");
|
||||
tint::transform::SingleEntryPoint singleEntryPointTransform;
|
||||
tint::transform::Manager transformManager;
|
||||
transformManager.append(std::make_unique<tint::transform::SingleEntryPoint>());
|
||||
|
||||
tint::transform::DataMap transformInputs;
|
||||
transformInputs.Add<tint::transform::SingleEntryPoint::Config>(entryPointName);
|
||||
|
||||
AddExternalTextureTransform(layout, &transformManager, &transformInputs);
|
||||
|
||||
tint::Program program;
|
||||
{
|
||||
TRACE_EVENT0(GetDevice()->GetPlatform(), General, "RunTransforms");
|
||||
DAWN_TRY_ASSIGN(program, RunTransforms(&singleEntryPointTransform, GetTintProgram(),
|
||||
DAWN_TRY_ASSIGN(program, RunTransforms(&transformManager, GetTintProgram(),
|
||||
transformInputs, nullptr, nullptr));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user