Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Implement dynamically uniform expression restrictions #56

Closed
litherum opened this issue Oct 13, 2018 · 14 comments
Closed

Implement dynamically uniform expression restrictions #56

litherum opened this issue Oct 13, 2018 · 14 comments
Assignees
Labels
HLSL Compat Implementation Does not affect the specification
Milestone

Comments

@litherum
Copy link
Contributor

Migrated from https://bugs.webkit.org/show_bug.cgi?id=189125:

At 2018-08-29T23:36:49Z, [email protected] wrote:
Implement dynamically uniform expression restrictions

@litherum
Copy link
Contributor Author

At 2018-09-13T01:50:51Z, [email protected] wrote:
rdar://problem/44403002

@litherum
Copy link
Contributor Author

At 2018-09-24T17:37:06Z, [email protected] wrote:
Ever value (lvalue and rvalue) will be associated with a "uniformity" attribute, which will be assigned by the compiler. These attributes can even survive being assigned to a variable, if the variable is marked as "uniform" in the program source.

Then, after we know whether or not each value is uniform, we can associate each nested scope with a similar uniformity attribute. This is true iff the condition leading to that scope is uniform.

We apply the restriction that any AssignmentExpression inside a non-uniform scope must never assign to a uniform variable that is declared in the non-innermost scope. This should guarantee that all uniform variables are, indeed, uniform.

Then, we can require any IndexExpression that indexes into an array which contains textures to use a uniform index.

@litherum
Copy link
Contributor Author

At 2018-09-24T18:14:24Z, [email protected] wrote:
Functions that return uniform variables must only have a single return point

@litherum
Copy link
Contributor Author

At 2018-09-24T18:18:09Z, [email protected] wrote:
UAVs can't hold uniform values

@litherum
Copy link
Contributor Author

At 2018-09-24T18:25:41Z, [email protected] wrote:
Conditional continues and breaks should contribute to the uniformity of the blocks they target

@litherum
Copy link
Contributor Author

At 2018-09-24T18:28:16Z, [email protected] wrote:
(In reply to Myles C. Maxfield from comment #5)

Conditional continues and breaks should contribute to the uniformity of the
blocks they target

This isn't quite right - the continue & break can affect just the remainder of the scope.

Also, uniforms should only exist in thread / constant address space.

@litherum
Copy link
Contributor Author

At 2018-09-24T18:37:48Z, [email protected] wrote:
(In reply to Myles C. Maxfield from comment #6)

(In reply to Myles C. Maxfield from comment #5)

Conditional continues and breaks should contribute to the uniformity of the
blocks they target

This isn't quite right - the continue & break can affect just the remainder
of the scope.

and "return"

In general, returns should be modeled as an assignment to a variable that's outside the function scope.

@litherum
Copy link
Contributor Author

At 2018-09-24T18:41:52Z, [email protected] wrote:
(In reply to Myles C. Maxfield from comment #3)

Functions that return uniform variables must only have a single return point

Actually, we can do better - just treat early returns as marking the rest of the scope non-uniform, and treating the return as writing to a value that's outside the scope

@litherum
Copy link
Contributor Author

At 2018-10-05T02:45:53Z, [email protected] wrote:
*** Bug 189123 has been marked as a duplicate of this bug. ***

@litherum
Copy link
Contributor Author

At 2018-10-05T02:47:32Z, [email protected] wrote:
Created attachment 351650
WIP

@litherum
Copy link
Contributor Author

At 2018-10-06T02:35:24Z, [email protected] wrote:
Created attachment 351711
WIP

@litherum
Copy link
Contributor Author

At 2018-10-09T07:07:01Z, [email protected] wrote:
Created attachment 351866
WIP

@litherum
Copy link
Contributor Author

At 2018-10-09T07:25:46Z, [email protected] wrote:
Created attachment 351868
WIP

@litherum litherum added this to the m1 milestone Oct 15, 2018
@litherum
Copy link
Contributor Author

#58

@litherum litherum self-assigned this Oct 15, 2018
@litherum litherum changed the title [WHLSL] Implement dynamically uniform expression restrictions Implement dynamically uniform expression restrictions Oct 18, 2018
@litherum litherum added Implementation Does not affect the specification HLSL Compat labels Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
HLSL Compat Implementation Does not affect the specification
Projects
None yet
Development

No branches or pull requests

1 participant