From 877858a195025bcf6bce22db65b3f378879c988f Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Tue, 24 Aug 2021 10:12:37 -0400 Subject: [PATCH] Removed unnecessary GL extensions We've been cargo-culting these extensions around for a long time, but it appears they aren't actually necessary. Change-Id: I536ec9b81643c7d35f108d230233bb6990fcb5d7 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441519 Reviewed-by: Brian Osman Reviewed-by: John Stiles Commit-Queue: Ethan Nicholas --- src/gpu/d3d/GrD3DPipelineStateBuilder.cpp | 7 ------- src/gpu/dawn/GrDawnProgramBuilder.cpp | 5 ----- src/gpu/mtl/GrMtlPipelineStateBuilder.mm | 5 ----- src/gpu/vk/GrVkMSAALoadManager.cpp | 6 ------ src/gpu/vk/GrVkPipelineStateBuilder.cpp | 7 ------- 5 files changed, 30 deletions(-) diff --git a/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp b/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp index 2f586b3332..0f98899b21 100644 --- a/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp +++ b/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp @@ -571,13 +571,6 @@ static constexpr SkFourByteTag kSKSL_Tag = SkSetFourByteTag('S', 'K', 'S', 'L'); std::unique_ptr GrD3DPipelineStateBuilder::finalize() { TRACE_EVENT0("skia.shaders", TRACE_FUNC); - // We need to enable the following extensions so that the compiler can correctly make spir-v - // from our glsl shaders. - fVS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fVS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - this->finalizeShaders(); SkSL::Program::Settings settings; diff --git a/src/gpu/dawn/GrDawnProgramBuilder.cpp b/src/gpu/dawn/GrDawnProgramBuilder.cpp index d171b45a2f..8d883c8a54 100644 --- a/src/gpu/dawn/GrDawnProgramBuilder.cpp +++ b/src/gpu/dawn/GrDawnProgramBuilder.cpp @@ -263,11 +263,6 @@ sk_sp GrDawnProgramBuilder::Build(GrDawnGpu* gpu, return nullptr; } - builder.fVS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - builder.fFS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - builder.fVS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - builder.fFS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - builder.finalizeShaders(); SkSL::Program::Inputs vertInputs, fragInputs; diff --git a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm index 2672ac3a24..20da637a8e 100644 --- a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm +++ b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm @@ -549,11 +549,6 @@ GrMtlPipelineState* GrMtlPipelineStateBuilder::finalize( } else { id shaderLibraries[kGrShaderTypeCount]; - fVS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fVS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - this->finalizeShaders(); SkSL::Program::Settings settings; diff --git a/src/gpu/vk/GrVkMSAALoadManager.cpp b/src/gpu/vk/GrVkMSAALoadManager.cpp index f0268d831f..e2cb4969d3 100644 --- a/src/gpu/vk/GrVkMSAALoadManager.cpp +++ b/src/gpu/vk/GrVkMSAALoadManager.cpp @@ -33,9 +33,6 @@ bool GrVkMSAALoadManager::createMSAALoadProgram(GrVkGpu* gpu) { SkSL::String vertShaderText; vertShaderText.append( - "#extension GL_ARB_separate_shader_objects : enable\n" - "#extension GL_ARB_shading_language_420pack : enable\n" - "layout(set = 0, binding = 0) uniform vertexUniformBuffer {" "half4 uPosXform;" "};" @@ -49,9 +46,6 @@ bool GrVkMSAALoadManager::createMSAALoadProgram(GrVkGpu* gpu) { SkSL::String fragShaderText; fragShaderText.append( - "#extension GL_ARB_separate_shader_objects : enable\n" - "#extension GL_ARB_shading_language_420pack : enable\n" - "layout(input_attachment_index = 0, set = 2, binding = 0) uniform subpassInput uInput;" "// MSAA Load Program FS\n" diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp index 4d25380619..463d291158 100644 --- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp +++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp @@ -192,13 +192,6 @@ GrVkPipelineState* GrVkPipelineStateBuilder::finalize(const GrProgramDesc& desc, dsLayout[GrVkUniformHandler::kInputDescSet] = resourceProvider.getInputDSLayout(); - // We need to enable the following extensions so that the compiler can correctly make spir-v - // from our glsl shaders. - fVS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_separate_shader_objects : enable\n"); - fVS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - fFS.extensions().appendf("#extension GL_ARB_shading_language_420pack : enable\n"); - this->finalizeShaders(); bool usePushConstants = fUniformHandler.usePushConstants();