aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkUniformHandler.cpp
diff options
context:
space:
mode:
authorGravatar Ruiqi Mao <ruiqimao@google.com>2018-07-17 10:19:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-17 15:08:40 +0000
commitb609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec (patch)
tree052d6e5c5c7835481f5a0e0bead6ec575679b76f /src/gpu/vk/GrVkUniformHandler.cpp
parent6dd4b209091b876832218e8adf1909669960bf98 (diff)
added byte and ubyte types to SKSL
created new GMs for skinning Bug: skia: Change-Id: I15fb2bd02fba8beb6dd2dd3f3716da016ea92192 Reviewed-on: https://skia-review.googlesource.com/140241 Commit-Queue: Ruiqi Mao <ruiqimao@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkUniformHandler.cpp')
-rw-r--r--src/gpu/vk/GrVkUniformHandler.cpp27
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: