[Mesa-dev] [PATCH 1/2] glsl: add subpass image type

Dave Airlie airlied at gmail.com
Fri Sep 16 04:54:00 UTC 2016


On 16 September 2016 at 14:47, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Thu, Sep 15, 2016 at 1:23 AM, Dave Airlie <airlied at gmail.com> wrote:
>>
>> From: Dave Airlie <airlied at redhat.com>
>>
>> SPIR-V/Vulkan have a special image type for input attachments
>> called the subpass type. It has different characteristics than
>> other images types.
>>
>> The main one being it can only be an input image to fragment
>> shaders and loads from it are relative to the frag coord.
>>
>> This adds support for it to the GLSL types. Unfortunately
>> we've run out of space in the sampler dim in types, so we
>> need to use another bit.
>> ---
>>  src/compiler/builtin_type_macros.h |  2 ++
>>  src/compiler/glsl_types.cpp        | 12 ++++++++++++
>>  src/compiler/glsl_types.h          |  5 +++--
>>  src/compiler/nir/nir.h             |  1 +
>>  4 files changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/compiler/builtin_type_macros.h
>> b/src/compiler/builtin_type_macros.h
>> index da3f19e..8af0e2a 100644
>> --- a/src/compiler/builtin_type_macros.h
>> +++ b/src/compiler/builtin_type_macros.h
>> @@ -159,6 +159,8 @@ DECL_TYPE(uimageCubeArray,
>> GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY,       GLSL_TYPE
>>  DECL_TYPE(uimage2DMS,      GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE,
>> GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 0, GLSL_TYPE_UINT)
>>  DECL_TYPE(uimage2DMSArray, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY,
>> GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 1, GLSL_TYPE_UINT)
>>
>> +DECL_TYPE(imageSubpass,    0,
>> GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_SUBPASS,0, 0, GLSL_TYPE_FLOAT)
>
>
> We should probably call this subpassInput to match the GLSL Vulkan spec.

Sounds good, I'll post v2.

Dave.


More information about the mesa-dev mailing list