Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Type-Casts on parameters declared 'out' results in erroneous code #59

Open
Malacath92 opened this issue Sep 7, 2017 · 1 comment
Open

Comments

@Malacath92
Copy link

Calling any atomic function of the uint type seems to result in optimizations to pick the corresponding atomic function of the int type, subsequently forcing a cast on its parameters. However the first parameter is declared as out and does thus not allow to be cast there (since that results in a non-lvalue). As an example you can see

#version 450
layout (binding = 0) buffer uintBuffer {
	uint inUInt;
};
layout (location = 0) out uint outUInt;
void main() {
	outUInt = atomicOr(inUInt, 1);
}

which has the corresponding output from LunarGOO.exe

#version 450 core
// LunarGOO output
layout(binding=0) buffer uintBuffer {
        uint inUInt;
} ;
layout(location=0) out uint outUInt;
const int C_1 = 1;
void main()
{
        int outUInt1 = atomicOr(int(inUInt), C_1);
        outUInt = uint(outUInt1);
}
@Silverlan
Copy link

Can confirm that this still happens with the latest commit (012965a)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants