compiler/types: Add multisample vimage/vtexture types

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30834>
This commit is contained in:
Karol Herbst 2024-08-26 18:16:10 +02:00 committed by Marge Bot
parent 9982568fa8
commit c5e38d5cb8
2 changed files with 20 additions and 12 deletions

View file

@ -174,12 +174,14 @@ sampler_type("utexture2DMSArray", "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY"
sampler_type("textureExternalOES", "GL_SAMPLER_EXTERNAL_OES", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_EXTERNAL", 0, 0, "GLSL_TYPE_FLOAT")
# OpenCL image types
sampler_type("vtexture1D", "GL_SAMPLER_1D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_1D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture2D", "GL_SAMPLER_2D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_2D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture3D", "GL_SAMPLER_3D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_3D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture1DArray", "GL_SAMPLER_1D_ARRAY", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_1D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vtexture2DArray", "GL_SAMPLER_2D_ARRAY", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_2D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vtextureBuffer", "GL_SAMPLER_BUFFER", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_BUF", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture1D", "GL_SAMPLER_1D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_1D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture2D", "GL_SAMPLER_2D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_2D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture3D", "GL_SAMPLER_3D", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_3D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture2DMS", "GL_SAMPLER_2D_MULTISAMPLE", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_MS", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vtexture2DMSArray", "GL_SAMPLER_2D_MULTISAMPLE_ARRAY", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_MS", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vtexture1DArray", "GL_SAMPLER_1D_ARRAY", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_1D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vtexture2DArray", "GL_SAMPLER_2D_ARRAY", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_2D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vtextureBuffer", "GL_SAMPLER_BUFFER", "GLSL_TYPE_TEXTURE", "GLSL_SAMPLER_DIM_BUF", 0, 0, "GLSL_TYPE_VOID")
sampler_type("image1D", "GL_IMAGE_1D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_1D", 0, 0, "GLSL_TYPE_FLOAT")
sampler_type("image2D", "GL_IMAGE_2D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_2D", 0, 0, "GLSL_TYPE_FLOAT")
@ -238,12 +240,14 @@ sampler_type("u64image2DMS", "GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE", "G
sampler_type("u64image2DMSArray", "GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_MS", 0, 1, "GLSL_TYPE_UINT64")
# OpenCL image types
sampler_type("vbuffer", "GL_IMAGE_BUFFER", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_BUF", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage1D", "GL_IMAGE_1D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_1D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage2D", "GL_IMAGE_2D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_2D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage3D", "GL_IMAGE_3D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_3D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage1DArray", "GL_IMAGE_1D_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_1D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vimage2DArray", "GL_IMAGE_2D_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_2D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vbuffer", "GL_IMAGE_BUFFER", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_BUF", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage1D", "GL_IMAGE_1D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_1D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage2D", "GL_IMAGE_2D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_2D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage3D", "GL_IMAGE_3D", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_3D", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage2DMS", "GL_IMAGE_2D_MULTISAMPLE", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_MS", 0, 0, "GLSL_TYPE_VOID")
sampler_type("vimage2DMSArray", "GL_IMAGE_2D_MULTISAMPLE_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_MS", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vimage1DArray", "GL_IMAGE_1D_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_1D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("vimage2DArray", "GL_IMAGE_2D_ARRAY", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_2D", 0, 1, "GLSL_TYPE_VOID")
sampler_type("subpassInput", "0", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_SUBPASS", 0, 0, "GLSL_TYPE_FLOAT")
sampler_type("subpassInputMS", "0", "GLSL_TYPE_IMAGE", "GLSL_SAMPLER_DIM_SUBPASS_MS", 0, 0, "GLSL_TYPE_FLOAT")

View file

@ -1053,6 +1053,8 @@ glsl_texture_type(enum glsl_sampler_dim dim, bool array, enum glsl_base_type typ
return (array ? &glsl_type_builtin_error : &glsl_type_builtin_vtexture3D);
case GLSL_SAMPLER_DIM_BUF:
return (array ? &glsl_type_builtin_error : &glsl_type_builtin_vtextureBuffer);
case GLSL_SAMPLER_DIM_MS:
return (array ? &glsl_type_builtin_vtexture2DMSArray : &glsl_type_builtin_vtexture2DMS);
default:
return &glsl_type_builtin_error;
}
@ -1223,6 +1225,8 @@ glsl_image_type(enum glsl_sampler_dim dim, bool array, enum glsl_base_type type)
return (array ? &glsl_type_builtin_error : &glsl_type_builtin_vimage3D);
case GLSL_SAMPLER_DIM_BUF:
return (array ? &glsl_type_builtin_error : &glsl_type_builtin_vbuffer);
case GLSL_SAMPLER_DIM_MS:
return (array ? &glsl_type_builtin_vimage2DMSArray : &glsl_type_builtin_vimage2DMS);
default:
return &glsl_type_builtin_error;
}