You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the wiki the __SHADER_TARGET_STAGE is predefined when compiling a shader.
The predefined macro, __SHADER_TARGET_STAGE, is set at compilation time depending on the option provided to the -T flag to one of the above values.
However this does not seem to be the case in SPIR-V, as the shader stage identifiers do not seem to be set accordingly.
For example when compiling a compute shader:
...
bool checkForComputeStage() {
#if __SHADER_TARGET_STAGE == __SHADER_STAGE_COMPUTE
return true;
#else
return false;
#endif
}
void main() {
float4 result;
if(checkForComputeStage() {
result = float4(1,0,0,1);
} else {
result = float4(0,1,0,1);
}
//write result away to a texture or buffer
}
In this case checkForComputeStage() always returns false.
The text was updated successfully, but these errors were encountered:
According to the wiki the
__SHADER_TARGET_STAGE
is predefined when compiling a shader.However this does not seem to be the case in SPIR-V, as the shader stage identifiers do not seem to be set accordingly.
For example when compiling a compute shader:
In this case
checkForComputeStage()
always returns false.The text was updated successfully, but these errors were encountered: