Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed)

Created:
4 years, 8 months ago by egdaniel
Modified:
4 years, 8 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 Committed: https://skia.googlesource.com/skia/+/09aa1fce69b214714171db12c341aebd78dd29ea

Patch Set 1 #

Total comments: 5

Patch Set 2 : Updates from review comments #

Patch Set 3 : #

Patch Set 4 : Add Vulkan stuff #

Patch Set 5 : #

Patch Set 6 : rebase #

Patch Set 7 : dtor #

Patch Set 8 : Remove unneeded assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+368 lines, -180 lines) Patch
M gyp/gpu.gypi View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M include/gpu/GrShaderVar.h View 1 2 3 4 5 6 7 5 chunks +0 lines, -5 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/effects/GrTextureDomain.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/effects/GrTextureDomain.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLProgram.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLProgram.cpp View 2 chunks +3 lines, -6 lines 0 comments Download
M src/gpu/gl/GrGLProgramDataManager.h View 1 2 chunks +6 lines, -4 lines 0 comments Download
M src/gpu/gl/GrGLProgramDataManager.cpp View 1 chunk +25 lines, -13 lines 0 comments Download
A src/gpu/gl/GrGLSampler.h View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLUniformHandler.h View 1 2 3 3 chunks +14 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLUniformHandler.cpp View 1 4 chunks +31 lines, -0 lines 0 comments Download
M src/gpu/gl/builders/GrGLProgramBuilder.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/gpu/glsl/GrGLSLFragmentProcessor.h View 3 chunks +5 lines, -5 lines 0 comments Download
M src/gpu/glsl/GrGLSLFragmentProcessor.cpp View 1 chunk +4 lines, -5 lines 0 comments Download
M src/gpu/glsl/GrGLSLPrimitiveProcessor.h View 3 chunks +5 lines, -5 lines 0 comments Download
M src/gpu/glsl/GrGLSLProgramBuilder.h View 1 2 3 chunks +8 lines, -5 lines 0 comments Download
M src/gpu/glsl/GrGLSLProgramBuilder.cpp View 1 2 11 chunks +25 lines, -19 lines 0 comments Download
M src/gpu/glsl/GrGLSLSampler.h View 1 2 3 4 5 6 1 chunk +19 lines, -9 lines 0 comments Download
M src/gpu/glsl/GrGLSLShaderBuilder.h View 1 3 chunks +8 lines, -8 lines 0 comments Download
M src/gpu/glsl/GrGLSLShaderBuilder.cpp View 1 1 chunk +18 lines, -21 lines 0 comments Download
M src/gpu/glsl/GrGLSLUniformHandler.h View 1 2 5 chunks +22 lines, -0 lines 0 comments Download
M src/gpu/glsl/GrGLSLXferProcessor.h View 3 chunks +6 lines, -5 lines 0 comments Download
A src/gpu/vk/GrVkGLSLSampler.h View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
M src/gpu/vk/GrVkPipelineStateBuilder.cpp View 1 2 3 2 chunks +8 lines, -11 lines 0 comments Download
M src/gpu/vk/GrVkPipelineStateDataManager.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M src/gpu/vk/GrVkPipelineStateDataManager.cpp View 1 2 3 10 chunks +3 lines, -13 lines 0 comments Download
M src/gpu/vk/GrVkUniformHandler.h View 1 2 3 4 chunks +14 lines, -2 lines 0 comments Download
M src/gpu/vk/GrVkUniformHandler.cpp View 1 2 3 4 2 chunks +39 lines, -33 lines 0 comments Download

Messages

Total messages: 32 (14 generated)
egdaniel
This is a first draft which doesn't include any vulkan changes yet (and probably has ...
4 years, 8 months ago (2016-04-13 20:57:58 UTC) #3
Chris Dalton
So does this mean Vulkan and GL want to use different sampler fuction names for ...
4 years, 8 months ago (2016-04-13 21:56:40 UTC) #4
egdaniel
https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLSampler.h File src/gpu/glsl/GrGLSLSampler.h (right): https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLSampler.h#newcode29 src/gpu/glsl/GrGLSLSampler.h:29: virtual const char* getSamplerFunctionName() const = 0; On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 23:44:45 UTC) #5
egdaniel
https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLSampler.h File src/gpu/glsl/GrGLSLSampler.h (right): https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLSampler.h#newcode29 src/gpu/glsl/GrGLSLSampler.h:29: virtual const char* getSamplerFunctionName() const = 0; On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 23:51:43 UTC) #6
bsalomon
https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLUniformHandler.h File src/gpu/glsl/GrGLSLUniformHandler.h (right): https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLUniformHandler.h#newcode57 src/gpu/glsl/GrGLSLUniformHandler.h:57: virtual const GrGLSLSampler& getSampler(SamplerHandle handle) const = 0; It ...
4 years, 8 months ago (2016-04-14 01:40:17 UTC) #7
egdaniel
https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLUniformHandler.h File src/gpu/glsl/GrGLSLUniformHandler.h (right): https://codereview.chromium.org/1885863004/diff/1/src/gpu/glsl/GrGLSLUniformHandler.h#newcode57 src/gpu/glsl/GrGLSLUniformHandler.h:57: virtual const GrGLSLSampler& getSampler(SamplerHandle handle) const = 0; On ...
4 years, 8 months ago (2016-04-14 03:11:50 UTC) #8
egdaniel
Okay so this has been updated so that processors only ever deal with SamplerHandles. I've ...
4 years, 8 months ago (2016-04-14 14:58:53 UTC) #9
egdaniel
Vulkan stuff added. For this change vulkan still is using a combined sampler and texture. ...
4 years, 8 months ago (2016-04-14 19:53:24 UTC) #10
bsalomon
lgtm
4 years, 8 months ago (2016-04-19 14:42:21 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885863004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885863004/100001
4 years, 8 months ago (2016-04-19 20:16:42 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot/builds/6248)
4 years, 8 months ago (2016-04-19 20:17:53 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885863004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885863004/120001
4 years, 8 months ago (2016-04-19 20:29:21 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-19 20:44:49 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885863004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885863004/120001
4 years, 8 months ago (2016-04-19 21:44:37 UTC) #23
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://skia.googlesource.com/skia/+/45b61a1c4c0be896e7b12fd1405abfece799114f
4 years, 8 months ago (2016-04-19 21:46:01 UTC) #25
egdaniel
A revert of this CL (patchset #7 id:120001) has been created in https://codereview.chromium.org/1896013003/ by egdaniel@google.com. ...
4 years, 8 months ago (2016-04-19 22:24:14 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885863004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885863004/140001
4 years, 8 months ago (2016-04-20 13:57:58 UTC) #30
commit-bot: I haz the power
4 years, 8 months ago (2016-04-20 14:09:50 UTC) #32
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://skia.googlesource.com/skia/+/09aa1fce69b214714171db12c341aebd78dd29ea

Powered by Google App Engine
This is Rietveld 408576698