Index: src/gpu/vk/GrVkPipelineStateDataManager.cpp |
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
index c72f209a218a8daef9c72384d2cb28f55be8279f..60d7d7fee85175e33534914b05afc0e6617f7ff6 100644 |
--- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
@@ -32,10 +32,11 @@ |
uniform.fArrayCount = uniformInfo.fVariable.getArrayCount(); |
uniform.fType = uniformInfo.fVariable.getType(); |
); |
- uniform.fBinding = |
- (kVertex_GrShaderFlag == uniformInfo.fVisibility) ? GrVkUniformHandler::kVertexBinding |
- : GrVkUniformHandler::kFragBinding; |
+ uniform.fBinding = uniformInfo.fBinding; |
uniform.fOffset = uniformInfo.fUBOffset; |
+ SkDEBUGCODE( |
+ uniform.fSetNumber = uniformInfo.fSetNumber; |
+ ); |
} |
} |
@@ -58,6 +59,7 @@ |
const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kFloat_GrSLType); |
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
memcpy(buffer, &v0, sizeof(float)); |
@@ -71,6 +73,7 @@ |
SkASSERT(arrayCount > 0); |
SkASSERT(arrayCount <= uni.fArrayCount || |
(1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount)); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
@@ -85,6 +88,7 @@ |
const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec2f_GrSLType); |
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
float v[2] = { v0, v1 }; |
@@ -99,6 +103,7 @@ |
SkASSERT(arrayCount > 0); |
SkASSERT(arrayCount <= uni.fArrayCount || |
(1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount)); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
@@ -113,6 +118,7 @@ |
const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec3f_GrSLType); |
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
float v[3] = { v0, v1, v2 }; |
@@ -127,6 +133,7 @@ |
SkASSERT(arrayCount > 0); |
SkASSERT(arrayCount <= uni.fArrayCount || |
(1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount)); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
@@ -145,6 +152,7 @@ |
const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec4f_GrSLType); |
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
float v[4] = { v0, v1, v2, v3 }; |
@@ -159,6 +167,7 @@ |
SkASSERT(arrayCount > 0); |
SkASSERT(arrayCount <= uni.fArrayCount || |
(1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount)); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer = this->getBufferPtrAndMarkDirty(uni); |
SkASSERT(sizeof(float) == 4); |
@@ -205,6 +214,7 @@ |
SkASSERT(arrayCount > 0); |
SkASSERT(arrayCount <= uni.fArrayCount || |
(1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount)); |
+ SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber); |
void* buffer; |
if (GrVkUniformHandler::kVertexBinding == uni.fBinding) { |