Open jpaoneMines opened 11 months ago
The fragment shader contains the following:
// ---------- UNIFORMS ---------- // layout(std140) uniform MaterialInfo { vec4 Ka; vec4 Kd; vec4 Ks; float shininess; } material;
// ---------- UNIFORMS ---------- //
layout(std140) uniform MaterialInfo {
vec4 Ka;
vec4 Kd;
vec4 Ks;
float shininess;
} material;
layout(std140) uniform LightInfo { vec4 position; vec4 La; vec4 Ld; vec4 Ls; } light;
layout(std140) uniform LightInfo {
vec4 position;
vec4 La;
vec4 Ld;
vec4 Ls;
} light;
uniform vec3 cameraPos; uniform int colorer; uniform uint MaxNodes;
uniform vec3 cameraPos;
uniform int colorer;
uniform uint MaxNodes;
// ---------- VARYINGS ---------- // in VectorData { vec3 modelPosition; vec3 position; vec3 normal; } vectorsIn;
// ---------- VARYINGS ---------- //
in VectorData {
vec3 modelPosition;
vec3 position;
vec3 normal;
} vectorsIn;
// ---------- IMAGES ---------- // layout(binding=0, r32ui) uniform uimage2D headPointers;
// ---------- IMAGES ---------- //
layout(binding=0, r32ui) uniform uimage2D headPointers;
// ---------- ATOMIC COUNTERS ---------- // layout(binding=0, offset=0) uniform atomic_uint nextNodeCounter;
// ---------- ATOMIC COUNTERS ---------- //
layout(binding=0, offset=0) uniform atomic_uint nextNodeCounter;
// ---------- BUFFERS ---------- // struct NodeType { vec4 color; float depth; uint next; }; layout(binding=0, std430) buffer linkedLists { NodeType nodes[]; };
// ---------- BUFFERS ---------- //
struct NodeType {
vec4 color;
float depth;
uint next;
};
layout(binding=0, std430) buffer linkedLists {
NodeType nodes[];
and the output shows as
[INFO]: >--------------------------------------------------------< [INFO]: | GL_ACTIVE_UNIFORMS: 15 | [INFO]: | 0) type: mat4 name: MVP_Matrix loc: 5 | [INFO]: | 1) type: mat4 name: modelviewMatrix loc: 1 | [INFO]: | 2) type: int name: colorer loc: 10 | [INFO]: | 7) type: vec3 name: cameraPos loc: 9 | [INFO]: | 13) type: unsigned int name: MaxNodes loc: 11 | [INFO]: | 14) type: uimage2D name: headPointers loc: 0 | [INFO]: >--------------------------------------------------------< [INFO]: | GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: 2 | [INFO]: | 0) LightInfo # Uniforms: 5 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: LightInfo.position | [INFO]: | uniform index: 3 offset: 0 | [INFO]: | 1) type: vec4 name: LightInfo.La | [INFO]: | uniform index: 4 offset: 16 | [INFO]: | 2) type: vec4 name: LightInfo.Ld | [INFO]: | uniform index: 5 offset: 32 | [INFO]: | 3) type: vec4 name: LightInfo.Ls | [INFO]: | uniform index: 6 offset: 48 | [INFO]: | 4) type: atomic_uint name: nextNodeCounter | [INFO]: | uniform index: 12 offset: 0 | [INFO]: | 1) MaterialInfo # Uniforms: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: MaterialInfo.Ka | [INFO]: | uniform index: 8 offset: 0 | [INFO]: | 1) type: vec4 name: MaterialInfo.Kd | [INFO]: | uniform index: 9 offset: 16 | [INFO]: | 2) type: vec4 name: MaterialInfo.Ks | [INFO]: | uniform index: 10 offset: 32 | [INFO]: | 3) type: float name: MaterialInfo.shininess | [INFO]: | uniform index: 11 offset: 48 | [INFO]: | Shader Uniform Block Counts 2/70 | [INFO]: | Vertex Shader Uniform Blocks: 0/36 | [INFO]: | Fragment Shader Uniform Blocks: 2/36 | [INFO]: >--------------------------------------------------------< [INFO]: | GL_SHADER_STORAGE_BLOCK: 1 | [INFO]: | 0) name: linkedLists index: 0 binding: 0 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | Shader Storage Block Counts: 1/32 | [INFO]: | Vertex Shader Storage Blocks: 0/32 | [INFO]: | Fragment Shader Storage Blocks: 1/32 | [INFO]: >--------------------------------------------------------< [INFO]: | GL_ATOMIC_COUNTER_BUFFER: 1 | [INFO]: | 0) type: mat4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: mat4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: int name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec3 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: vec4 name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: float name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: atomic_uint name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: unsigned int name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | 0) type: uimage2D name: | [INFO]: | uniform index: -1 atomic index: 0 | [INFO]: | binding: 0 offset: 0 buffer size: 4 | [INFO]: | Used in: Frag Shader(s) | [INFO]: | Atomic Counter Counts: 1/ 8 | [INFO]: | Vertex Atomic Counters: 0/ 8 | [INFO]: | Fragment Atomic Counters: 15/ 8 | [INFO]: \--------------------------------------------------------/
[INFO]: >--------------------------------------------------------<
[INFO]: | GL_ACTIVE_UNIFORMS: 15 |
[INFO]: | 0) type: mat4 name: MVP_Matrix loc: 5 |
[INFO]: | 1) type: mat4 name: modelviewMatrix loc: 1 |
[INFO]: | 2) type: int name: colorer loc: 10 |
[INFO]: | 7) type: vec3 name: cameraPos loc: 9 |
[INFO]: | 13) type: unsigned int name: MaxNodes loc: 11 |
[INFO]: | 14) type: uimage2D name: headPointers loc: 0 |
[INFO]: | GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: 2 |
[INFO]: | 0) LightInfo # Uniforms: 5 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: LightInfo.position |
[INFO]: | uniform index: 3 offset: 0 |
[INFO]: | 1) type: vec4 name: LightInfo.La |
[INFO]: | uniform index: 4 offset: 16 |
[INFO]: | 2) type: vec4 name: LightInfo.Ld |
[INFO]: | uniform index: 5 offset: 32 |
[INFO]: | 3) type: vec4 name: LightInfo.Ls |
[INFO]: | uniform index: 6 offset: 48 |
[INFO]: | 4) type: atomic_uint name: nextNodeCounter |
[INFO]: | uniform index: 12 offset: 0 |
[INFO]: | 1) MaterialInfo # Uniforms: 4 |
[INFO]: | 0) type: vec4 name: MaterialInfo.Ka |
[INFO]: | uniform index: 8 offset: 0 |
[INFO]: | 1) type: vec4 name: MaterialInfo.Kd |
[INFO]: | uniform index: 9 offset: 16 |
[INFO]: | 2) type: vec4 name: MaterialInfo.Ks |
[INFO]: | uniform index: 10 offset: 32 |
[INFO]: | 3) type: float name: MaterialInfo.shininess |
[INFO]: | uniform index: 11 offset: 48 |
[INFO]: | Shader Uniform Block Counts 2/70 |
[INFO]: | Vertex Shader Uniform Blocks: 0/36 |
[INFO]: | Fragment Shader Uniform Blocks: 2/36 |
[INFO]: | GL_SHADER_STORAGE_BLOCK: 1 |
[INFO]: | 0) name: linkedLists index: 0 binding: 0 |
[INFO]: | Shader Storage Block Counts: 1/32 |
[INFO]: | Vertex Shader Storage Blocks: 0/32 |
[INFO]: | Fragment Shader Storage Blocks: 1/32 |
[INFO]: | GL_ATOMIC_COUNTER_BUFFER: 1 |
[INFO]: | 0) type: mat4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | 0) type: int name: |
[INFO]: | 0) type: vec4 name: |
[INFO]: | 0) type: vec3 name: |
[INFO]: | 0) type: float name: |
[INFO]: | 0) type: atomic_uint name: |
[INFO]: | 0) type: unsigned int name: |
[INFO]: | 0) type: uimage2D name: |
[INFO]: | Atomic Counter Counts: 1/ 8 |
[INFO]: | Vertex Atomic Counters: 0/ 8 |
[INFO]: | Fragment Atomic Counters: 15/ 8 |
[INFO]: \--------------------------------------------------------/
The fragment shader contains the following:
// ---------- UNIFORMS ---------- //
layout(std140) uniform MaterialInfo {
vec4 Ka;
vec4 Kd;
vec4 Ks;
float shininess;
} material;
layout(std140) uniform LightInfo {
vec4 position;
vec4 La;
vec4 Ld;
vec4 Ls;
} light;
uniform vec3 cameraPos;
uniform int colorer;
uniform uint MaxNodes;
// ---------- VARYINGS ---------- //
in VectorData {
vec3 modelPosition;
vec3 position;
vec3 normal;
} vectorsIn;
// ---------- IMAGES ---------- //
layout(binding=0, r32ui) uniform uimage2D headPointers;
// ---------- ATOMIC COUNTERS ---------- //
layout(binding=0, offset=0) uniform atomic_uint nextNodeCounter;
// ---------- BUFFERS ---------- //
struct NodeType {
vec4 color;
float depth;
uint next;
};
layout(binding=0, std430) buffer linkedLists {
NodeType nodes[];
};
and the output shows as
[INFO]: >--------------------------------------------------------<
[INFO]: | GL_ACTIVE_UNIFORMS: 15 |
[INFO]: | 0) type: mat4 name: MVP_Matrix loc: 5 |
[INFO]: | 1) type: mat4 name: modelviewMatrix loc: 1 |
[INFO]: | 2) type: int name: colorer loc: 10 |
[INFO]: | 7) type: vec3 name: cameraPos loc: 9 |
[INFO]: | 13) type: unsigned int name: MaxNodes loc: 11 |
[INFO]: | 14) type: uimage2D name: headPointers loc: 0 |
[INFO]: >--------------------------------------------------------<
[INFO]: | GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: 2 |
[INFO]: | 0) LightInfo # Uniforms: 5 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: LightInfo.position |
[INFO]: | uniform index: 3 offset: 0 |
[INFO]: | 1) type: vec4 name: LightInfo.La |
[INFO]: | uniform index: 4 offset: 16 |
[INFO]: | 2) type: vec4 name: LightInfo.Ld |
[INFO]: | uniform index: 5 offset: 32 |
[INFO]: | 3) type: vec4 name: LightInfo.Ls |
[INFO]: | uniform index: 6 offset: 48 |
[INFO]: | 4) type: atomic_uint name: nextNodeCounter |
[INFO]: | uniform index: 12 offset: 0 |
[INFO]: | 1) MaterialInfo # Uniforms: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: MaterialInfo.Ka |
[INFO]: | uniform index: 8 offset: 0 |
[INFO]: | 1) type: vec4 name: MaterialInfo.Kd |
[INFO]: | uniform index: 9 offset: 16 |
[INFO]: | 2) type: vec4 name: MaterialInfo.Ks |
[INFO]: | uniform index: 10 offset: 32 |
[INFO]: | 3) type: float name: MaterialInfo.shininess |
[INFO]: | uniform index: 11 offset: 48 |
[INFO]: | Shader Uniform Block Counts 2/70 |
[INFO]: | Vertex Shader Uniform Blocks: 0/36 |
[INFO]: | Fragment Shader Uniform Blocks: 2/36 |
[INFO]: >--------------------------------------------------------<
[INFO]: | GL_SHADER_STORAGE_BLOCK: 1 |
[INFO]: | 0) name: linkedLists index: 0 binding: 0 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | Shader Storage Block Counts: 1/32 |
[INFO]: | Vertex Shader Storage Blocks: 0/32 |
[INFO]: | Fragment Shader Storage Blocks: 1/32 |
[INFO]: >--------------------------------------------------------<
[INFO]: | GL_ATOMIC_COUNTER_BUFFER: 1 |
[INFO]: | 0) type: mat4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: mat4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: int name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec3 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: vec4 name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: float name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: atomic_uint name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: unsigned int name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | 0) type: uimage2D name: |
[INFO]: | uniform index: -1 atomic index: 0 |
[INFO]: | binding: 0 offset: 0 buffer size: 4 |
[INFO]: | Used in: Frag Shader(s) |
[INFO]: | Atomic Counter Counts: 1/ 8 |
[INFO]: | Vertex Atomic Counters: 0/ 8 |
[INFO]: | Fragment Atomic Counters: 15/ 8 |
[INFO]: \--------------------------------------------------------/