Add support for GL_NV_shader_sm_builtins

Including spirv and AST tests

Also increase size of TBuiltInVariable bitfields since we've now exceeded 127
and add a static_assert to make this easier to find next time it happens!
This commit is contained in:
Daniel Koch
2019-06-04 08:43:32 -04:00
parent 92b5c9ee91
commit 2cb2f197a7
43 changed files with 825 additions and 20 deletions

View File

@@ -230,3 +230,24 @@ void partitioned_works(vec4 f4)
subgroupPartitionedExclusiveOrNV(ballot, parti);
subgroupPartitionedExclusiveXorNV(ballot, parti);
}
// tests for NV_shader_sm_builtins
void sm_builtins_err()
{
gl_WarpsPerSMNV; // ERROR, no extension
gl_SMCountNV; // ERROR, no extension
gl_WarpIDNV; // ERROR, no extension
gl_SMIDNV; // ERROR, no extension
}
#ifdef GL_NV_shader_sm_builtins
#extension GL_NV_shader_sm_builtins : enable
#endif
void sm_builtins()
{
gl_WarpsPerSMNV;
gl_SMCountNV;
gl_WarpIDNV;
gl_SMIDNV;
}