Fix stack-use-after-scope for usedInterstageVariables pointer
Bug: chromium:1393728 Change-Id: I078f898b9a6a237c81c15bb86736eb790cf6a261 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112260 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
2c4423383a
commit
67d52eb4f2
|
@ -358,11 +358,12 @@ MaybeError RenderPipeline::Initialize() {
|
|||
PerStage<CompiledShader> compiledShader;
|
||||
|
||||
std::bitset<kMaxInterStageShaderVariables>* usedInterstageVariables = nullptr;
|
||||
dawn::native::EntryPointMetadata fragmentEntryPoint;
|
||||
if (GetStageMask() & wgpu::ShaderStage::Fragment) {
|
||||
// Now that only fragment shader can have interstage inputs.
|
||||
const ProgrammableStage& programmableStage = GetStage(SingleShaderStage::Fragment);
|
||||
auto entryPoint = programmableStage.module->GetEntryPoint(programmableStage.entryPoint);
|
||||
usedInterstageVariables = &entryPoint.usedInterStageVariables;
|
||||
fragmentEntryPoint = programmableStage.module->GetEntryPoint(programmableStage.entryPoint);
|
||||
usedInterstageVariables = &fragmentEntryPoint.usedInterStageVariables;
|
||||
}
|
||||
|
||||
for (auto stage : IterateStages(GetStageMask())) {
|
||||
|
|
Loading…
Reference in New Issue