17 #ifndef SPIRV_CROSS_INTERNAL_INTERFACE_HPP 18 #define SPIRV_CROSS_INTERNAL_INTERFACE_HPP 22 #ifndef GLM_FORCE_SWIZZLE 23 #define GLM_FORCE_SWIZZLE 26 #ifndef GLM_FORCE_RADIANS 27 #define GLM_FORCE_RADIANS 30 #include <glm/glm.hpp> 69 template <
typename T,
unsigned U>
120 template <
typename T>
136 template <
typename T,
unsigned U>
164 template <
typename T>
170 template <
typename T>
174 template <
typename T>
178 template <
typename T>
182 template <
typename T>
221 template <
typename U>
238 template <
typename U>
250 template <
typename U>
260 template <
typename U>
270 template <
typename U>
280 template <
typename U>
332 if (
resources[set][binding].pre_dereference)
341 template <
typename T>
346 static_cast<T *
>(
this)->
main();
357 #define gl_FragCoord __res->gl_FragCoord.get() 360 template <
typename T,
typename Res>
385 #define gl_Position __res->gl_Position.get() 388 template <
typename T,
typename Res>
413 template <
typename T,
typename Res>
438 template <
typename T,
typename Res>
463 template <
typename T,
typename Res>
490 #define gl_WorkGroupID __res->gl_WorkGroupID__.get() 491 #define gl_NumWorkGroups __res->gl_NumWorkGroups__.get() 494 #define barrier() __res->barrier__.wait() 500 #define gl_LocalInvocationIndex __priv_res.gl_LocalInvocationIndex__ 502 #define gl_LocalInvocationID __priv_res.gl_LocalInvocationID__ 504 #define gl_GlobalInvocationID __priv_res.gl_GlobalInvocationID__ 507 template <
typename T,
typename Res,
unsigned WorkGroupX,
unsigned WorkGroupY,
unsigned WorkGroupZ>
514 for (
unsigned z = 0;
z < WorkGroupZ;
z++)
515 for (
unsigned y = 0;
y < WorkGroupY;
y++)
516 for (
unsigned x = 0;
x < WorkGroupX;
x++)
517 impl[
z][
y][
x].__priv_res.gl_GlobalInvocationID__ =
518 glm::uvec3(WorkGroupX, WorkGroupY, WorkGroupZ) *
resources.gl_WorkGroupID__.get() +
529 resources.barrier__.set_release_divisor(WorkGroupX * WorkGroupY * WorkGroupZ);
532 for (
unsigned z = 0;
z < WorkGroupZ;
z++)
534 for (
unsigned y = 0;
y < WorkGroupY;
y++)
536 for (
unsigned x = 0;
x < WorkGroupX;
x++)
538 impl[
z][
y][
x].__priv_res.gl_LocalInvocationID__ = glm::uvec3(
x,
y,
z);
539 impl[
z][
y][
x].__priv_res.gl_LocalInvocationIndex__ = i++;
546 T impl[WorkGroupZ][WorkGroupY][WorkGroupX];
562 template <
typename T>
565 static_assert(
sizeof(std::atomic<T>) ==
sizeof(
T),
"Cannot cast properly to std::atomic<T>.");
569 return std::atomic_fetch_add_explicit(
reinterpret_cast<std::atomic<T> *
>(&
v),
a, std::memory_order_relaxed);
GLuint shader
Definition: glext.h:6670
Definition: internal_interface.hpp:481
PPSize()
Definition: internal_interface.hpp:192
const GLvoid * ptr
Definition: nx_glsym.h:242
Definition: internal_interface.hpp:439
T * ptr
Definition: internal_interface.hpp:88
Definition: internal_interface.hpp:406
void spirv_cross_set_stage_input(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:573
Res resources
Definition: internal_interface.hpp:428
Definition: internal_interface.hpp:175
size_t size
Definition: internal_interface.hpp:210
void register_resource(const internal::Resource< U > &value, unsigned set, unsigned binding)
Definition: internal_interface.hpp:239
Res resources
Definition: internal_interface.hpp:403
#define SPIRV_CROSS_NUM_STAGE_OUTPUTS
Definition: external_interface.h:60
Definition: internal_interface.hpp:508
FragmentShader()
Definition: internal_interface.hpp:368
#define SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS
Definition: external_interface.h:58
Definition: internal_interface.hpp:464
void register_push_constant(const internal::PushConstant< U > &value)
Definition: internal_interface.hpp:281
T impl
Definition: internal_interface.hpp:452
Barrier barrier__
Definition: internal_interface.hpp:493
glm::uvec3 gl_LocalInvocationID__
Definition: internal_interface.hpp:501
GLsizeiptr size
Definition: glext.h:6559
internal::StageInput< glm::uvec3 > gl_WorkGroupID__
Definition: internal_interface.hpp:483
void set_resource(unsigned set, unsigned binding, void **data, size_t size)
Definition: internal_interface.hpp:324
VertexShader()
Definition: internal_interface.hpp:396
internal::StageOutput< glm::vec4 > gl_Position
Definition: internal_interface.hpp:380
Definition: internal_interface.hpp:171
Definition: external_interface.h:48
void main()
Definition: internal_interface.hpp:391
Definition: external_interface.h:49
Res resources
Definition: internal_interface.hpp:375
GLdouble s
Definition: glext.h:6390
Definition: internal_interface.hpp:121
T & operator[](unsigned index) const
Definition: internal_interface.hpp:127
GLdouble GLdouble z
Definition: glext.h:6514
void set_push_constant(void *data, size_t size)
Definition: internal_interface.hpp:316
spirv_cross_builtin
Definition: external_interface.h:47
ComputeShader()
Definition: internal_interface.hpp:525
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
PPSize push_constant
Definition: internal_interface.hpp:218
void register_stage_input(const internal::StageInput< U > &value, unsigned location)
Definition: internal_interface.hpp:251
GLint location
Definition: glext.h:6690
void set_uniform_constant(unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:307
glm::uvec3 gl_GlobalInvocationID__
Definition: internal_interface.hpp:503
DereferenceAdaptor(T **ptr)
Definition: internal_interface.hpp:123
T impl
Definition: internal_interface.hpp:402
internal::StageInput< glm::uvec3 > gl_NumWorkGroups__
Definition: internal_interface.hpp:484
Definition: internal_interface.hpp:98
Res resources
Definition: internal_interface.hpp:548
void main()
Definition: internal_interface.hpp:416
void init(spirv_cross_shader &)
Definition: internal_interface.hpp:433
T impl[WorkGroupZ][WorkGroupY][WorkGroupX]
Definition: internal_interface.hpp:546
internal::StageOutput< glm::vec4 > gl_FragCoord
Definition: internal_interface.hpp:352
T impl
Definition: internal_interface.hpp:477
void spirv_cross_set_builtin(spirv_cross_shader_t *shader, spirv_cross_builtin builtin, void *data, size_t size)
Definition: internal_interface.hpp:598
void set_stage_input(unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:289
void spirv_cross_set_push_constant(spirv_cross_shader_t *shader, void *data, size_t size)
Definition: internal_interface.hpp:593
Definition: barrier.hpp:23
Definition: internal_interface.hpp:188
PointerInterface()
Definition: internal_interface.hpp:148
#define SPIRV_CROSS_NUM_UNIFORM_CONSTANTS
Definition: external_interface.h:61
void init(spirv_cross_shader &s)
Definition: internal_interface.hpp:381
Definition: external_interface.h:52
T ** ptr
Definition: internal_interface.hpp:131
bool pre_dereference
Definition: internal_interface.hpp:211
void init(spirv_cross_shader &s)
Definition: internal_interface.hpp:353
Definition: internal_interface.hpp:361
void register_builtin(spirv_cross_builtin builtin, const U &value)
Definition: internal_interface.hpp:222
T atomicAdd(T &v, T a)
Definition: internal_interface.hpp:563
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
#define SPIRV_CROSS_NUM_DESCRIPTOR_SETS
Definition: external_interface.h:57
T * get()
Definition: internal_interface.hpp:82
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
void ** ptr
Definition: internal_interface.hpp:197
void main()
Definition: internal_interface.hpp:441
Definition: document.h:391
T impl
Definition: internal_interface.hpp:427
void main()
Definition: internal_interface.hpp:510
GeometryShader()
Definition: internal_interface.hpp:471
Res resources
Definition: internal_interface.hpp:453
Definition: barrier.hpp:25
size_t size
Definition: internal_interface.hpp:198
void spirv_cross_set_uniform_constant(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:583
Definition: internal_interface.hpp:431
PPSize uniform_constants[SPIRV_CROSS_NUM_UNIFORM_CONSTANTS]
Definition: internal_interface.hpp:217
void set_stage_output(unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:298
Interface()
Definition: internal_interface.hpp:55
GLuint index
Definition: glext.h:6671
ThreadGroup< T, WorkGroupX *WorkGroupY *WorkGroupZ > group
Definition: internal_interface.hpp:547
PPSize stage_inputs[SPIRV_CROSS_NUM_STAGE_INPUTS]
Definition: internal_interface.hpp:215
int main(int argc, char *argv[])
Definition: send-presence.c:197
const GLdouble * v
Definition: glext.h:6391
Definition: internal_interface.hpp:201
void memoryBarrierShared()
Definition: internal_interface.hpp:551
Definition: internal_interface.hpp:52
Definition: internal_interface.hpp:47
Definition: internal_interface.hpp:497
Definition: internal_interface.hpp:183
PPSize builtins[SPIRV_CROSS_NUM_BUILTINS]
Definition: internal_interface.hpp:219
void invoke()
Definition: internal_interface.hpp:344
void main()
Definition: internal_interface.hpp:466
void init(spirv_cross_shader &)
Definition: internal_interface.hpp:408
#define SPIRV_CROSS_NUM_STAGE_INPUTS
Definition: external_interface.h:59
GLboolean GLuint group
Definition: glext.h:12027
void memoryBarrier()
Definition: internal_interface.hpp:555
DereferenceAdaptor< T > get()
Definition: internal_interface.hpp:153
void init(spirv_cross_shader &s)
Definition: internal_interface.hpp:485
void set_builtin(spirv_cross_builtin builtin, void *data, size_t size)
Definition: internal_interface.hpp:230
Definition: external_interface.h:50
Definition: external_interface.h:51
T & get()
Definition: internal_interface.hpp:59
Definition: internal_interface.hpp:389
void main()
Definition: internal_interface.hpp:363
Definition: internal_interface.hpp:165
Res resources
Definition: internal_interface.hpp:478
Interface()
Definition: internal_interface.hpp:78
GLsizei const GLfloat * value
Definition: glext.h:6709
Definition: internal_interface.hpp:350
void register_stage_output(const internal::StageOutput< U > &value, unsigned location)
Definition: internal_interface.hpp:261
Unknown compiler Device disconnected from port File already exists Saving to backup buffer Got connection No arguments supplied and no menu builtin
Definition: msg_hash_eo.h:34
void spirv_cross_set_resource(spirv_cross_shader_t *shader, unsigned set, unsigned binding, void **data, size_t size)
Definition: internal_interface.hpp:588
Definition: internal_interface.hpp:190
PPSize stage_outputs[SPIRV_CROSS_NUM_STAGE_OUTPUTS]
Definition: internal_interface.hpp:216
void init(spirv_cross_shader &)
Definition: internal_interface.hpp:458
Definition: internal_interface.hpp:179
#define false
Definition: ordinals.h:83
void spirv_cross_set_stage_output(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
Definition: internal_interface.hpp:578
Definition: internal_interface.hpp:51
Definition: internal_interface.hpp:456
TessControlShader()
Definition: internal_interface.hpp:446
T & get()
Definition: internal_interface.hpp:110
Definition: internal_interface.hpp:97
Definition: internal_interface.hpp:102
Definition: internal_interface.hpp:414
void register_uniform_constant(const internal::UniformConstant< U > &value, unsigned location)
Definition: internal_interface.hpp:271
T * ptr
Definition: internal_interface.hpp:65
T * ptr
Definition: internal_interface.hpp:116
unsigned int uint32_t
Definition: stdint.h:126
Definition: internal_interface.hpp:378
PointerInterface()
Definition: internal_interface.hpp:105
PPSizeResource resources[SPIRV_CROSS_NUM_DESCRIPTOR_SETS][SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS]
Definition: internal_interface.hpp:214
TessEvaluationShader()
Definition: internal_interface.hpp:421
Definition: internal_interface.hpp:342
PPSizeResource()
Definition: internal_interface.hpp:203
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
void ** ptr
Definition: internal_interface.hpp:209
uint32_t gl_LocalInvocationIndex__
Definition: internal_interface.hpp:499
T ** ptr
Definition: internal_interface.hpp:159
Definition: internal_interface.hpp:93
static void memoryBarrier()
Definition: barrier.hpp:39
T impl
Definition: internal_interface.hpp:374