From 99c2b29cceef62251cafeddb02bf94a1ee2914ca Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 18 Mar 2022 10:36:29 -0400 Subject: [PATCH] Reland "Add glGetFloatv and glSamplerParameterf to GrGLInterface." This is a reland of commit 171450a1a0433cbe3e103d9b2163f3c0b9805e25 Original change's description: > Add glGetFloatv and glSamplerParameterf to GrGLInterface. > > > Bug: skia:13036 > Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100 > Auto-Submit: Brian Salomon > Reviewed-by: Robert Phillips > Commit-Queue: Brian Salomon Bug: skia:13036 Change-Id: Id594ea5fd68c76703ff61d8414c203facbf28801 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522359 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- RELEASE_NOTES.txt | 8 ++++++++ include/gpu/gl/GrGLFunctions.h | 4 +++- include/gpu/gl/GrGLInterface.h | 2 ++ src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp | 2 ++ src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp | 3 +++ src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp | 2 ++ tools/gpu/gl/interface/interface.json5 | 12 ++++++++++-- 7 files changed, 30 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 2dbcb9e9ab..e7a8bf1c7f 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -2,11 +2,19 @@ Skia Graphics Release Notes This file includes a list of high level updates for each milestone release. +Milestone 102 +------------- + * Add glGetFloatv and glSamplerParameterf to GrGLInterface. + +* * * + Milestone 101 ------------- * Add maxSurfaceSampleCountForColorType(SkColorType ct) in GrContextThreadSafeProxy * Enums SkAlphaType and SkColorType are broken out into their own header files in include/core/ +* * * + Milestone 100 ------------- * Skia now requires C++17 and the corresponding standard library (or newer). diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h index aef61e065a..84724403a9 100644 --- a/include/gpu/gl/GrGLFunctions.h +++ b/include/gpu/gl/GrGLFunctions.h @@ -96,6 +96,7 @@ using GrGLGenVertexArraysFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint using GrGLGetBufferParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum pname, GrGLint* params); using GrGLGetErrorFn = GrGLenum GR_GL_FUNCTION_TYPE(); using GrGLGetFramebufferAttachmentParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params); +using GrGLGetFloatvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLfloat* params); using GrGLGetIntegervFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLint* params); using GrGLGetMultisamplefvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLuint index, GrGLfloat* val); using GrGLGetProgramBinaryFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, GrGLenum* binaryFormat, void* binary); @@ -142,7 +143,8 @@ using GrGLReadPixelsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint x, GrGLint y, GrGL using GrGLRenderbufferStorageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); using GrGLRenderbufferStorageMultisampleFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); using GrGLResolveMultisampleFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(); -using GrGLSamplerParameteriFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint sampler, GrGLenum pname, GrGLint params); +using GrGLSamplerParameterfFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint sampler, GrGLenum pname, GrGLfloat param); +using GrGLSamplerParameteriFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint sampler, GrGLenum pname, GrGLint param); using GrGLSamplerParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint sampler, GrGLenum pname, const GrGLint* params); using GrGLScissorFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); // GL_CHROMIUM_bind_uniform_location diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index af3ca67dcc..c28aade61f 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -170,6 +170,7 @@ public: GrGLFunction fGetBufferParameteriv; GrGLFunction fGetError; GrGLFunction fGetFramebufferAttachmentParameteriv; + GrGLFunction fGetFloatv; GrGLFunction fGetIntegerv; GrGLFunction fGetMultisamplefv; GrGLFunction fGetProgramBinary; @@ -248,6 +249,7 @@ public: GrGLFunction fBindUniformLocation; GrGLFunction fResolveMultisampleFramebuffer; + GrGLFunction fSamplerParameterf; GrGLFunction fSamplerParameteri; GrGLFunction fSamplerParameteriv; GrGLFunction fScissor; diff --git a/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp index f119b00d60..2911a383de 100644 --- a/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp +++ b/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp @@ -91,6 +91,7 @@ sk_sp GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc GET_PROC(GenTextures); GET_PROC(GetBufferParameteriv); GET_PROC(GetError); + GET_PROC(GetFloatv); GET_PROC(GetIntegerv); GET_PROC(GetProgramInfoLog); GET_PROC(GetProgramiv); @@ -425,6 +426,7 @@ sk_sp GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc GET_PROC(BindSampler); GET_PROC(DeleteSamplers); GET_PROC(GenSamplers); + GET_PROC(SamplerParameterf); GET_PROC(SamplerParameteri); GET_PROC(SamplerParameteriv); } diff --git a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp index 7f443961bb..18e2cdb62b 100644 --- a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp +++ b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp @@ -94,6 +94,7 @@ sk_sp GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g GET_PROC(GenTextures); GET_PROC(GetBufferParameteriv); GET_PROC(GetError); + GET_PROC(GetFloatv); GET_PROC(GetIntegerv); GET_PROC(GetProgramInfoLog); GET_PROC(GetProgramiv); @@ -421,12 +422,14 @@ sk_sp GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g GET_PROC(BindSampler); GET_PROC(DeleteSamplers); GET_PROC(GenSamplers); + GET_PROC(SamplerParameterf); GET_PROC(SamplerParameteri); GET_PROC(SamplerParameteriv); } else if (extensions.has("GL_ARB_sampler_objects")) { GET_PROC(BindSampler); GET_PROC(DeleteSamplers); GET_PROC(GenSamplers); + GET_PROC(SamplerParameterf); GET_PROC(SamplerParameteri); GET_PROC(SamplerParameteriv); } diff --git a/src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp index 6f8736f406..c8773a8693 100644 --- a/src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp +++ b/src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp @@ -98,6 +98,7 @@ sk_sp GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetPro GET_PROC(GenTextures); GET_PROC(GetBufferParameteriv); GET_PROC(GetError); + GET_PROC(GetFloatv); GET_PROC(GetIntegerv); GET_PROC(GetProgramInfoLog); GET_PROC(GetProgramiv); @@ -239,6 +240,7 @@ sk_sp GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetPro GET_PROC(BindSampler); GET_PROC(DeleteSamplers); GET_PROC(GenSamplers); + GET_PROC(SamplerParameterf); GET_PROC(SamplerParameteri); GET_PROC(SamplerParameteriv); } diff --git a/tools/gpu/gl/interface/interface.json5 b/tools/gpu/gl/interface/interface.json5 index 207af58bae..a3beb8232f 100644 --- a/tools/gpu/gl/interface/interface.json5 +++ b/tools/gpu/gl/interface/interface.json5 @@ -32,7 +32,7 @@ "EnableVertexAttribArray", "Finish", "Flush", "FrontFace", "GenBuffers", "GenTextures", "GetBufferParameteriv", "GetError", - "GetIntegerv", "GetProgramInfoLog", + "GetFloatv", "GetIntegerv", "GetProgramInfoLog", "GetProgramiv", "GetShaderInfoLog", "GetShaderiv", "GetString", "GetUniformLocation", "IsTexture", "LineWidth", "LinkProgram", "PixelStorei", @@ -46,6 +46,11 @@ "VertexAttrib2fv", "VertexAttrib3fv", "VertexAttrib4fv", "VertexAttribPointer", "Viewport", ], + + // TODO: Remove 'optional' once Chrome sets this function in the interface. + "optional": [ + "GetFloatv", + ] }, { // GL exclusive core functions "GL": [{"ext": ""}], @@ -610,8 +615,11 @@ "functions": [ "BindSampler", "DeleteSamplers", "GenSamplers", - "SamplerParameteri", "SamplerParameteriv", + "SamplerParameterf", "SamplerParameteri", "SamplerParameteriv", ], + + // TODO: Remove 'optional' once Chrome sets this function in the interface. + "optional": ["SamplerParameterf"] }, {