diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-24 19:53:13 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-24 19:53:23 +0000 |
commit | 6dd0d8a2659d5976fdd2b6528f787ac7f0b0005b (patch) | |
tree | c2b5536c6ecae3934ed74ce93f9ddd41b3daf3ba /src | |
parent | af37a53a84d03fa08bc2f447034d7db754cfc5ba (diff) |
Revert "Add vector GrSLTypes for shorts"
This reverts commit af37a53a84d03fa08bc2f447034d7db754cfc5ba.
Reason for revert: Compiler errors
Original change's description:
> Add vector GrSLTypes for shorts
>
> Bug: skia:
> Change-Id: Icb9eb1fcb0f879cd0bfdd27d06459843361c9947
> Reviewed-on: https://skia-review.googlesource.com/62943
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=egdaniel@google.com,csmartdalton@google.com,ethannicholas@google.com
Change-Id: Ib23b28be92e199459fe1666fb1ec0e46e141a8f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/63460
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/glsl/GrGLSL.cpp | 12 | ||||
-rw-r--r-- | src/gpu/vk/GrVkUniformHandler.cpp | 40 | ||||
-rw-r--r-- | src/gpu/vk/GrVkVaryingHandler.cpp | 6 |
3 files changed, 9 insertions, 49 deletions
diff --git a/src/gpu/glsl/GrGLSL.cpp b/src/gpu/glsl/GrGLSL.cpp index 994a8372a7..6067fa65af 100644 --- a/src/gpu/glsl/GrGLSL.cpp +++ b/src/gpu/glsl/GrGLSL.cpp @@ -89,20 +89,8 @@ const char* GrGLSLTypeString(const GrShaderCaps* shaderCaps, GrSLType t) { return "uint"; case kShort_GrSLType: return "short"; - case kShort2_GrSLType: - return "short2"; - case kShort3_GrSLType: - return "short3"; - case kShort4_GrSLType: - return "short4"; case kUShort_GrSLType: return "ushort"; - case kUShort2_GrSLType: - return "ushort2"; - case kUShort3_GrSLType: - return "ushort3"; - case kUShort4_GrSLType: - return "ushort4"; case kTexture2D_GrSLType: return "texture2D"; case kSampler_GrSLType: diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp index d9c25198a9..8bc024941b 100644 --- a/src/gpu/vk/GrVkUniformHandler.cpp +++ b/src/gpu/vk/GrVkUniformHandler.cpp @@ -14,22 +14,12 @@ // This alignment mask will give correct alignments for using the std430 block layout. If you want // the std140 alignment, you can use this, but then make sure if you have an array type it is // aligned to 16 bytes (i.e. has mask of 0xF). -// These are designated in the Vulkan spec, section 14.5.4 "Offset and Stride Assignment". -// 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 kShort_GrSLType: // fall through - case kUShort_GrSLType: - return 0x1; - case kShort2_GrSLType: // fall through - case kUShort2_GrSLType: - return 0x3; - case kShort3_GrSLType: // fall through - case kShort4_GrSLType: - case kUShort3_GrSLType: - case kUShort4_GrSLType: - return 0x7; case kInt_GrSLType: + return 0x3; + case kUShort_GrSLType: // fall through case kUint_GrSLType: return 0x3; case kHalf_GrSLType: // fall through @@ -45,7 +35,7 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) { case kFloat4_GrSLType: return 0xF; case kUint2_GrSLType: - return 0x7; + return 0x3; case kInt2_GrSLType: return 0x7; case kInt3_GrSLType: @@ -80,27 +70,15 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) { return 0; } -/** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */ +/** Returns the size in bytes taken up in vulkanbuffers for floating point GrSLTypes. + For non floating point type returns 0. Currently this reflects the std140 alignment + so a float2x2 takes up 8 floats. */ static inline uint32_t grsltype_to_vk_size(GrSLType type) { switch(type) { - case kShort_GrSLType: - return sizeof(int16_t); - case kShort2_GrSLType: - return 2 * sizeof(int16_t); - case kShort3_GrSLType: - return 3 * sizeof(int16_t); - case kShort4_GrSLType: - return 4 * sizeof(int16_t); - case kUShort_GrSLType: - return sizeof(uint16_t); - case kUShort2_GrSLType: - return 2 * sizeof(uint16_t); - case kUShort3_GrSLType: - return 3 * sizeof(uint16_t); - case kUShort4_GrSLType: - return 4 * sizeof(uint16_t); + case kShort_GrSLType: // fall through case kInt_GrSLType: return sizeof(int32_t); + case kUShort_GrSLType: // fall through case kUint_GrSLType: return sizeof(int32_t); case kHalf_GrSLType: // fall through @@ -116,7 +94,7 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) { case kFloat4_GrSLType: return 4 * sizeof(float); case kUint2_GrSLType: - return 2 * sizeof(uint32_t); + return 2 * sizeof(uint16_t); case kInt2_GrSLType: return 2 * sizeof(int32_t); case kInt3_GrSLType: diff --git a/src/gpu/vk/GrVkVaryingHandler.cpp b/src/gpu/vk/GrVkVaryingHandler.cpp index ff56a39ce1..21c97717b3 100644 --- a/src/gpu/vk/GrVkVaryingHandler.cpp +++ b/src/gpu/vk/GrVkVaryingHandler.cpp @@ -28,16 +28,10 @@ static inline int grsltype_to_location_size(GrSLType type) { case kUint2_GrSLType: return 1; case kInt2_GrSLType: - case kShort2_GrSLType: - case kUShort2_GrSLType: return 1; case kInt3_GrSLType: - case kShort3_GrSLType: - case kUShort3_GrSLType: return 1; case kInt4_GrSLType: - case kShort4_GrSLType: - case kUShort4_GrSLType: return 1; case kFloat2x2_GrSLType: case kHalf2x2_GrSLType: |