aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkUniformHandler.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-10 11:19:51 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-10 17:13:34 +0000
commit434c534bd0ec08cb355fecfb6d2110197b523e74 (patch)
tree119167b88683157346ab8250bbc553903e046f7f /src/gpu/vk/GrVkUniformHandler.cpp
parente13a69baac9dc326510009fa7c0c5966aee9240c (diff)
Add integer texture support.
This allows us to create integer textures and sample them from a GrProcessor's code. Filtering is limited to NEAREST. Adds tests for reading/writing pixels, copying, and drawing. These operations are not allowed to convert to fixed/float configs. Vulkan support is TBD. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4348 Change-Id: If38d89a03285d4bd98d1f14f9638b0320977e43d Reviewed-on: https://skia-review.googlesource.com/4348 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkUniformHandler.cpp')
-rw-r--r--src/gpu/vk/GrVkUniformHandler.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp
index 4a6e977a8c..7c11b9dc46 100644
--- a/src/gpu/vk/GrVkUniformHandler.cpp
+++ b/src/gpu/vk/GrVkUniformHandler.cpp
@@ -25,10 +25,11 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
0x7, // kMat22f_GrSLType
0xF, // kMat33f_GrSLType
0xF, // kMat44f_GrSLType
- 0x0, // Sampler2D_GrSLType, should never return this
- 0x0, // SamplerExternal_GrSLType, should never return this
- 0x0, // Sampler2DRect_GrSLType, should never return this
- 0x0, // SamplerBuffer_GrSLType, should never return this
+ 0x0, // kTexture2DSampler_GrSLType, should never return this
+ 0x0, // kTexture2DISampler_GrSLType, should never return this
+ 0x0, // kTextureExternalSampler_GrSLType, should never return this
+ 0x0, // kTexture2DSamplerRect_GrSLType, should never return this
+ 0x0, // ktextureBufferSampler_GrSLType, should never return this
0x0, // kBool_GrSLType
0x7, // kInt_GrSLType
0x7, // kUint_GrSLType
@@ -44,14 +45,15 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
- GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
- GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
- GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
- GR_STATIC_ASSERT(12 == kBool_GrSLType);
- GR_STATIC_ASSERT(13 == kInt_GrSLType);
- GR_STATIC_ASSERT(14 == kUint_GrSLType);
- GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
- GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTexture2DISampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(12 == kTextureBufferSampler_GrSLType);
+ GR_STATIC_ASSERT(13 == kBool_GrSLType);
+ GR_STATIC_ASSERT(14 == kInt_GrSLType);
+ GR_STATIC_ASSERT(15 == kUint_GrSLType);
+ GR_STATIC_ASSERT(16 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(17 == kSampler_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAlignmentMask) == kGrSLTypeCount);
return kAlignmentMask[type];
}
@@ -71,6 +73,7 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
12 * sizeof(float), // kMat33f_GrSLType
16 * sizeof(float), // kMat44f_GrSLType
0, // kTexture2DSampler_GrSLType
+ 0, // kTexture2DISampler_GrSLType
0, // kTextureExternalSampler_GrSLType
0, // kTexture2DRectSampler_GrSLType
0, // kTextureBufferSampler_GrSLType
@@ -91,14 +94,15 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
- GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
- GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
- GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
- GR_STATIC_ASSERT(12 == kBool_GrSLType);
- GR_STATIC_ASSERT(13 == kInt_GrSLType);
- GR_STATIC_ASSERT(14 == kUint_GrSLType);
- GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
- GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTexture2DISampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(12 == kTextureBufferSampler_GrSLType);
+ GR_STATIC_ASSERT(13 == kBool_GrSLType);
+ GR_STATIC_ASSERT(14 == kInt_GrSLType);
+ GR_STATIC_ASSERT(15 == kUint_GrSLType);
+ GR_STATIC_ASSERT(16 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(17 == kSampler_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrSLTypeCount);
}