Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-04-18 Thread Jason Ekstrand
On Thu, Apr 18, 2019 at 9:13 AM Juan A. Suarez Romero wrote: > On Thu, 2019-03-14 at 11:25 -0500, Jason Ekstrand wrote: > > Looking at this a bit more, I'm not sure that just short-circuiting > actually covers all the cases. Unfortunately, we don't know what all the > cases are because the

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-04-18 Thread Juan A. Suarez Romero
On Thu, 2019-03-14 at 11:25 -0500, Jason Ekstrand wrote: > Looking at this a bit more, I'm not sure that just short-circuiting actually > covers all the cases. Unfortunately, we don't know what all the cases are > because the SPIR-V spec doesn't say. I'm trying to work towards fixing that >

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-14 Thread Jason Ekstrand
Looking at this a bit more, I'm not sure that just short-circuiting actually covers all the cases. Unfortunately, we don't know what all the cases are because the SPIR-V spec doesn't say. I'm trying to work towards fixing that right now. --Jason On Wed, Mar 6, 2019 at 5:25 AM Juan A. Suarez

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-14 Thread Jason Ekstrand
On Thu, Mar 14, 2019 at 4:09 AM Juan A. Suarez Romero wrote: > On Fri, 2019-03-08 at 13:29 -0600, Jason Ekstrand wrote: > > On Fri, Mar 8, 2019 at 9:30 AM Juan A. Suarez Romero > wrote: > > On Thu, 2019-03-07 at 07:15 -0600, Jason Ekstrand wrote: > > Woah, is this legal SPIR-V? I think a second

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-14 Thread Juan A. Suarez Romero
On Fri, 2019-03-08 at 13:29 -0600, Jason Ekstrand wrote: > On Fri, Mar 8, 2019 at 9:30 AM Juan A. Suarez Romero > wrote: > > On Thu, 2019-03-07 at 07:15 -0600, Jason Ekstrand wrote: > > > > > Woah, is this legal SPIR-V? I think a second OpSelectionMerge is required. > > > > > > > > I'd say

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-08 Thread Jason Ekstrand
On Fri, Mar 8, 2019 at 9:30 AM Juan A. Suarez Romero wrote: > On Thu, 2019-03-07 at 07:15 -0600, Jason Ekstrand wrote: > > Woah, is this legal SPIR-V? I think a second OpSelectionMerge is > required. > > I'd say it is legal. The spec does not mandate that each branch has its own > merge

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-08 Thread Juan A. Suarez Romero
On Thu, 2019-03-07 at 07:15 -0600, Jason Ekstrand wrote: > Woah, is this legal SPIR-V? I think a second OpSelectionMerge is required. I'd say it is legal. The spec does not mandate that each branch has its own merge instruction; only that the control flow must be structured for shaders. In

Re: [Mesa-dev] [PATCH] nir/spirv: short-circuit when conditional branch contains end block

2019-03-07 Thread Jason Ekstrand
Woah, is this legal SPIR-V? I think a second OpSelectionMerge is required. --Jason On March 6, 2019 05:25:26 "Juan A. Suarez Romero" wrote: This fixes the case when the SPIR-V code has two nested conditional branches, but only one selection merge: [...] %1 = OpLabel OpSelectionMerge