Opened 5 years ago

Last modified 5 years ago

#9 accepted 작업

SPIRV 리플랙션 / texturearray

Reported by: Hongtae Kim Owned by: Hongtae Kim
Priority: 사소 Milestone: pipelineReflection
Component: Graphics/Compute Pipeline Version: 2.0
Keywords: Cc:

Description (last modified by Hongtae Kim)

Vertex Shader

#version 450

#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable

layout (location = 0) in vec4 inPos;
layout (location = 1) in vec2 inUV;

struct Instance
{
    mat4 model;
    vec4 arrayIndex;
};

layout (binding = 0) uniform UBO 
{
    mat4 projection;
    mat4 view;
    Instance instance[8];
} ubo;

layout (location = 0) out vec3 outUV;

void main() 
{
    outUV = vec3(inUV, ubo.instance[gl_InstanceIndex].arrayIndex.x);
    mat4 modelView = ubo.view * ubo.instance[gl_InstanceIndex].model;
    gl_Position = ubo.projection * modelView * inPos;
}

Fragment Shader

#version 450

#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable

layout (binding = 1) uniform sampler2DArray samplerArray;

layout (location = 0) in vec3 inUV;

layout (location = 0) out vec4 outFragColor;

void main() 
{
    outFragColor = texture(samplerArray, inUV);
}

Change History (4)

comment:1 Changed 5 years ago by Hongtae Kim

Milestone: pipelineReflection
Version: 2.0

comment:2 Changed 5 years ago by Hongtae Kim

Component: 일반Graphics/Compute Pipeline
Status: assignedaccepted

comment:3 Changed 5 years ago by Hongtae Kim

Description: modified (diff)
Type: 기타작업
[53700:29040 V] VertexFunction.VertexAttributes: 2
[53700:29040 V]   --> VertexAttribute[0]: "inPos" (location:0)
[53700:29040 V]   --> VertexAttribute[1]: "inUV" (location:1)
[53700:29040 V] =========================================================
[53700:29040 V] PipelineReflection.VertexResources: 1
[53700:29040 I] ShaderResource: ubo (set=0, binding=0)
[53700:29040 I]  Type:Buffer, Access:ReadOnly, Enabled:1, Size:768
[53700:29040 I]  Struct "ubo"
[53700:29040 I]      + projection (Float4x4, Offset: 0)
[53700:29040 I]      + view (Float4x4, Offset: 64)
[53700:29040 I]      + instance[8] (Struct, Offset: 128, Stride: 80)
[53700:29040 I]        Struct "ubo.instance"
[53700:29040 I]          + model (Float4x4, Offset: 0)
[53700:29040 I]          + arrayIndex (Float4, Offset: 64)
[53700:29040 V] ---------------------------------------------------------
[53700:29040 V] PipelineReflection.FragmentResources: 1
[53700:29040 I] ShaderResource: samplerArray (set=0, binding=1)
[53700:29040 I]  Type:SampledTexture, Access:ReadOnly, Enabled:1
[53700:29040 V] =========================================================

comment:4 Changed 5 years ago by Hongtae Kim

Description: modified (diff)
Note: See TracTickets for help on using tickets.