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

Unified Diff: src/gpu/vk/GrVkPipelineState.cpp

Issue 1970293002: Support allowSRGBInputs on Vulkan (via secondary texture views) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: default case for switch Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.h ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipelineState.cpp
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 8e52fb46c0e28282efc23ce688004ec3ed2df6e9..0ebd1dd7fd1ffd29c0de71802d92a3d8e8e4162b 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -203,7 +203,7 @@ void GrVkPipelineState::setData(GrVkGpu* gpu,
if (fNumSamplers) {
fSamplerPoolManager.getNewDescriptorSet(gpu,
&fDescriptorSets[GrVkUniformHandler::kSamplerDescSet]);
- this->writeSamplers(gpu, textureBindings);
+ this->writeSamplers(gpu, textureBindings, pipeline.getAllowSRGBInputs());
}
if (fVertexUniformBuffer.get() || fFragmentUniformBuffer.get()) {
@@ -286,7 +286,8 @@ void GrVkPipelineState::writeUniformBuffers(const GrVkGpu* gpu) {
}
void GrVkPipelineState::writeSamplers(GrVkGpu* gpu,
- const SkTArray<const GrTextureAccess*>& textureBindings) {
+ const SkTArray<const GrTextureAccess*>& textureBindings,
+ bool allowSRGBInputs) {
SkASSERT(fNumSamplers == textureBindings.count());
for (int i = 0; i < textureBindings.count(); ++i) {
@@ -307,7 +308,7 @@ void GrVkPipelineState::writeSamplers(GrVkGpu* gpu,
textureResource->ref();
fTextures.push(textureResource);
- const GrVkImageView* textureView = texture->textureView();
+ const GrVkImageView* textureView = texture->textureView(allowSRGBInputs);
textureView->ref();
fTextureViews.push(textureView);
@@ -321,7 +322,7 @@ void GrVkPipelineState::writeSamplers(GrVkGpu* gpu,
VkDescriptorImageInfo imageInfo;
memset(&imageInfo, 0, sizeof(VkDescriptorImageInfo));
imageInfo.sampler = fSamplers[i]->sampler();
- imageInfo.imageView = texture->textureView()->imageView();
+ imageInfo.imageView = textureView->imageView();
imageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
VkWriteDescriptorSet writeInfo;
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.h ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698