diff options
Diffstat (limited to 'src/gpu/vk/GrVkUniformHandler.cpp')
-rw-r--r-- | src/gpu/vk/GrVkUniformHandler.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp index d92d8d2fd6..848d52a5cd 100644 --- a/src/gpu/vk/GrVkUniformHandler.cpp +++ b/src/gpu/vk/GrVkUniformHandler.cpp @@ -18,6 +18,17 @@ // https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/html/vkspec.html#interfaces-resources-layout uint32_t grsltype_to_alignment_mask(GrSLType type) { switch(type) { + case kByte_GrSLType: // fall through + case kUByte_GrSLType: + return 0x0; + case kByte2_GrSLType: // fall through + case kUByte2_GrSLType: + return 0x1; + case kByte3_GrSLType: // fall through + case kByte4_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: + return 0x3; case kShort_GrSLType: // fall through case kUShort_GrSLType: return 0x1; @@ -80,6 +91,22 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) { /** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */ static inline uint32_t grsltype_to_vk_size(GrSLType type) { switch(type) { + case kByte_GrSLType: + return sizeof(int8_t); + case kByte2_GrSLType: + return 2 * sizeof(int8_t); + case kByte3_GrSLType: + return 3 * sizeof(int8_t); + case kByte4_GrSLType: + return 4 * sizeof(int8_t); + case kUByte_GrSLType: + return sizeof(uint8_t); + case kUByte2_GrSLType: + return 2 * sizeof(uint8_t); + case kUByte3_GrSLType: + return 3 * sizeof(uint8_t); + case kUByte4_GrSLType: + return 4 * sizeof(uint8_t); case kShort_GrSLType: return sizeof(int16_t); case kShort2_GrSLType: |