From 09aa1fce69b214714171db12c341aebd78dd29ea Mon Sep 17 00:00:00 2001 From: egdaniel Date: Wed, 20 Apr 2016 07:09:46 -0700 Subject: Refactor how we store and use samplers in Ganesh The main goal of this refactorization is to allow Vulkan to use separate sampler and texture objects in the shader and descriptor sets and combine them into a sampler2d in the shader where needed. A large part of this is separating how we store samplers and uniforms in the UniformHandler. We no longer need to store handles to samplers besides when we are initially emitting code. After we emit code all we ever do is loop over all samplers and do some processor independent work on them, so we have no need for direct access to individual samplers. In the GLProgram all we ever do is set the sampler uniforms in the ctor and never touch them again, so no need to save sampler info there. The texture access on program reuse just assume that they come in the same order as we set the texture units for the samplers For Vulkan, it is a similar story. We create the descriptor set layouts with the samplers, then when we get new textures, we just assume they come in in the same order as we set the samplers on the descriptor sets. Thus no need to save direct vulkan info. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885863004 Committed: https://skia.googlesource.com/skia/+/45b61a1c4c0be896e7b12fd1405abfece799114f Review URL: https://codereview.chromium.org/1885863004 --- include/gpu/GrShaderVar.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/gpu/GrShaderVar.h b/include/gpu/GrShaderVar.h index 3f56eaf70a..78e08e0d9a 100644 --- a/include/gpu/GrShaderVar.h +++ b/include/gpu/GrShaderVar.h @@ -51,7 +51,6 @@ public: , fName(name) , fCount(arrayCount) , fPrecision(precision) { - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); SkASSERT(kVoid_GrSLType != type); } @@ -62,7 +61,6 @@ public: , fName(name) , fCount(arrayCount) , fPrecision(precision) { - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); SkASSERT(kVoid_GrSLType != type); } @@ -73,7 +71,6 @@ public: , fName(name) , fCount(arrayCount) , fPrecision(precision) { - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); SkASSERT(kVoid_GrSLType != type); } @@ -91,7 +88,6 @@ public: GrSLPrecision precision = kDefault_GrSLPrecision, int count = kNonArray) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); fType = type; fTypeModifier = typeModifier; fName = name; @@ -105,7 +101,6 @@ public: GrSLPrecision precision = kDefault_GrSLPrecision, int count = kNonArray) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); fType = type; fTypeModifier = typeModifier; fName = name; -- cgit v1.2.3