11/****************************************************************************
22*
3- * Copyright (c) 2005 - 2019 by Vivante Corp. All rights reserved.
3+ * Copyright (c) 2005 - 2020 by Vivante Corp. All rights reserved.
44*
55* The material in this file is confidential and contains trade secrets
66* of Vivante Corporation. This is proprietary information owned by
@@ -469,6 +469,30 @@ PROG_GL_XFB_OUT_TABLE;
469469 ********************************** VK program mapping table definitions *********************************
470470 **********************************************************************************************************************/
471471
472+ typedef struct PROG_VK_IMAGE_FORMAT_INFO
473+ {
474+ VSC_IMAGE_FORMAT imageFormat ;
475+ gctBOOL bSetInSpriv ;
476+ }
477+ PROG_VK_IMAGE_FORMAT_INFO ;
478+
479+ typedef struct PROG_VK_IMAGE_DERIVED_INFO
480+ {
481+ /* For a image, it might need a image-size attached. As each image in
482+ Binding::arraySize array has image-size, so this is the first entry
483+ of image-size array. */
484+ SHADER_PRIV_CONSTANT_ENTRY * pImageSize ;
485+
486+ /* Extra layer HW mapping. As currently, for images in in tBinding::arraySize
487+ array, if one image has extra image, all other images must have extra image, so
488+ this is the first entry of extra-image */
489+ SHADER_PRIV_UAV_ENTRY * pExtraLayer ;
490+
491+ /* ImageFormat, can be NONE. */
492+ PROG_VK_IMAGE_FORMAT_INFO imageFormatInfo ;
493+ }
494+ PROG_VK_IMAGE_DERIVED_INFO ;
495+
472496typedef struct PROG_VK_SUB_RESOURCE_BINDING
473497{
474498 /* Pointer to original API resource binding */
@@ -528,6 +552,7 @@ typedef struct PROG_VK_PRIV_COMB_TEX_SAMP_HW_MAPPING_LIST
528552 VSC_SHADER_RESOURCE_TYPE_COMBINED_IMAGE_SAMPLER
529553*/
530554
555+ #define __YCBCR_PLANE_COUNT__ 3
531556typedef struct PROG_VK_COMBINED_TEXTURE_SAMPLER_HW_MAPPING
532557{
533558 /* For the case
@@ -541,6 +566,9 @@ typedef struct PROG_VK_COMBINED_TEXTURE_SAMPLER_HW_MAPPING
541566 combTsBinding::arraySize */
542567 SHADER_PRIV_SAMPLER_ENTRY * * ppExtraSamplerArray ;
543568
569+ /* For the ycbcr texture recompilation. */
570+ SHADER_PRIV_UAV_ENTRY * pYcbcrPlanes [__YCBCR_PLANE_COUNT__ ];
571+
544572 /* For the case that HW natively supports separated texture, so texture part of API
545573 combined texture sampler will be directly mapped to HW separated texture */
546574 SHADER_RESOURCE_SLOT_MAPPING texMapping ;
@@ -663,15 +691,7 @@ typedef union PROG_VK_SEPARATED_TEXTURE_HW_MAPPING
663691 /* For HW does not natively supports separated texture */
664692 struct
665693 {
666- /* For a separated image, it might need a image-size attached. As each image in
667- storageBinding::arraySize array has image-size, so this is the first entry
668- of image-size array. */
669- SHADER_PRIV_CONSTANT_ENTRY * pImageSize ;
670-
671- /* Extra layer HW mapping. As currently, for images in in texBinding::arraySize
672- array, if one image has extra image, all other images must have extra image, so
673- this is the first entry of extra-image */
674- SHADER_PRIV_UAV_ENTRY * pExtraLayer ;
694+ PROG_VK_IMAGE_DERIVED_INFO imageDerivedInfo ;
675695
676696 /* We still need to allocate a constant image for this separated texture for the imageFetch operation.*/
677697 SHADER_UAV_SLOT_MAPPING hwMapping ;
@@ -749,6 +769,13 @@ typedef struct PROG_VK_UNIFORM_TEXEL_BUFFER_HW_MAPPING
749769}
750770PROG_VK_UNIFORM_TEXEL_BUFFER_HW_MAPPING ;
751771
772+ typedef enum PROG_VK_UNIFORM_TEXEL_BUFFER_ENTRY_FLAG
773+ {
774+ PROG_VK_UTB_ENTRY_FLAG_NONE = 0x0000 ,
775+ /* Treat a texelBuffer as an image, now from a recompilation only. */
776+ PROG_VK_UTB_ENTRY_FLAG_TREAT_TEXELBUFFER_AS_IMAGE = 0x0002 ,
777+ } PROG_VK_UNIFORM_TEXEL_BUFFER_ENTRY_FLAG ;
778+
752779typedef struct PROG_VK_UNIFORM_TEXEL_BUFFER_TABLE_ENTRY
753780{
754781 /* API resource binding */
@@ -763,14 +790,16 @@ typedef struct PROG_VK_UNIFORM_TEXEL_BUFFER_TABLE_ENTRY
763790 /* Is this entry really used by shader */
764791 gctUINT activeStageMask ;
765792
793+ PROG_VK_UNIFORM_TEXEL_BUFFER_ENTRY_FLAG utbEntryFlag ;
794+
766795 /*----------------------------------Sampler-related----------------------------------*/
767796 /* For texel buffer, it might need a texture-size attached. As each texel buffer in
768797 utbBinding::arraySize array has texture-size, so this is the first entry
769798 of texture-size array. */
770799 SHADER_PRIV_CONSTANT_ENTRY * pTextureSize [VSC_MAX_SHADER_STAGE_COUNT ][2 ];
771800
772801 /*----------------------------------Image-related----------------------------------*/
773- VSC_IMAGE_FORMAT imageFormat ;
802+ PROG_VK_IMAGE_DERIVED_INFO imageDerivedInfo [ VSC_MAX_SHADER_STAGE_COUNT ] ;
774803
775804 /* Which kinds of inst operation acting on texture. The count of this
776805 resOpBit is same as utbBinding::arraySize */
@@ -826,15 +855,7 @@ typedef struct PROG_VK_INPUT_ATTACHMENT_TABLE_ENTRY
826855 ** it is treated as a sampler, otherwise it is treated as an image.
827856 */
828857 /*----------------------------------Image-related----------------------------------*/
829- /* For image storage, it might need a image-size attached. As each image in
830- iaBinding::arraySize array has image-size, so this is the first entry
831- of image-size array. */
832- SHADER_PRIV_CONSTANT_ENTRY * pImageSize [VSC_MAX_SHADER_STAGE_COUNT ];
833-
834- /* Extra layer HW mapping. As currently, for images in in iaBinding::arraySize
835- array, if one image has extra image, all other images must have extra image, so
836- this is the first entry of extra-image */
837- SHADER_PRIV_UAV_ENTRY * pExtraLayer [VSC_MAX_SHADER_STAGE_COUNT ];
858+ PROG_VK_IMAGE_DERIVED_INFO imageDerivedInfo [VSC_MAX_SHADER_STAGE_COUNT ];
838859
839860 /*----------------------------------Sampler-related----------------------------------*/
840861 /* For texel buffer, it might need a texture-size attached. As each texel buffer in
@@ -888,15 +909,12 @@ typedef struct PROG_VK_STORAGE_TABLE_ENTRY
888909 /* Is this entry really used by shader */
889910 gctUINT activeStageMask ;
890911
891- /* For image storage, it might need a image-size attached. As each image in
892- storageBinding::arraySize array has image-size, so this is the first entry
893- of image-size array. */
894- SHADER_PRIV_CONSTANT_ENTRY * pImageSize [VSC_MAX_SHADER_STAGE_COUNT ];
912+ /*----------------------------------Image-related----------------------------------*/
913+ PROG_VK_IMAGE_DERIVED_INFO imageDerivedInfo [VSC_MAX_SHADER_STAGE_COUNT ];
895914
896- /* Extra layer HW mapping. As currently, for images in in storageBinding::arraySize
897- array, if one image has extra image, all other images must have extra image, so
898- this is the first entry of extra-image */
899- SHADER_PRIV_UAV_ENTRY * pExtraLayer [VSC_MAX_SHADER_STAGE_COUNT ];
915+ /* Which kinds of inst operation acting on texture. The count of this
916+ resOpBit is same as storageBinding::arraySize */
917+ VSC_RES_OP_BIT * pResOpBits ;
900918
901919 /* Different shader stage may have different HW mappings. */
902920 SHADER_UAV_SLOT_MAPPING hwMappings [VSC_MAX_SHADER_STAGE_COUNT ];
0 commit comments