GrDirectContext

297 views
Skip to first unread message

Jhon

unread,
Sep 21, 2021, 6:13:51 AM9/21/21
to skia-discuss
Hi ,
I have build skia with skia_use_gl = true and skia_use_metal=true skia_use_vulkan=true.
But still SK_GL is not defined

and throws this error

 error: no type named 'MakeGL' in 'GrDirectContext'
    sk_sp<GrDirectContext> grContext(GrDirectContext::MakeGL(interface));

can anyone help me?


my gn args

is_official_build=true skia_build_fuzzers=false skia_compile_processors=false skia_compile_sksl_tests=false skia_enable_android_utils=false skia_enable_api_available_macro=true skia_enable_direct3d_debug_layer=false skia_enable_discrete_gpu=false skia_enable_flutter_defines=false skia_enable_fontmgr_android=true skia_enable_fontmgr_custom_directory=true skia_enable_fontmgr_custom_embedded=true skia_enable_fontmgr_custom_empty=true skia_enable_fontmgr_empty=false skia_enable_fontmgr_fontconfig=false skia_enable_fontmgr_fuchsia=false skia_enable_fontmgr_win=false skia_enable_fontmgr_win_gdi=false skia_enable_gpu=false skia_enable_gpu_debug_layers=false skia_enable_metal_debug_info=false skia_enable_particles=true skia_enable_pdf=false skia_enable_skgpu_v1=true skia_enable_skgpu_v2=false skia_enable_skottie=false skia_enable_skparagraph=true skia_enable_skrive=true skia_enable_skshaper=true skia_enable_sksl=true skia_enable_skvm_jit_when_possible=false skia_enable_spirv_validation=false skia_enable_svg=true skia_enable_tools=false skia_enable_vulkan_debug_layers=false skia_enable_winuwp=false skia_generate_workarounds=false skia_include_multiframe_procs=false skia_lex=false skia_pdf_subset_harfbuzz=false skia_tools_require_resources=false skia_update_fuchsia_sdk=false skia_use_angle=false skia_use_dawn=false skia_use_direct3d=false skia_use_dng_sdk=true skia_use_egl=false skia_use_expat=true skia_use_experimental_xform=false skia_use_ffmpeg=false skia_use_fixed_gamma_text=false skia_use_fontconfig=false skia_use_fonthost_mac=false skia_use_freetype=true skia_use_freetype_woff2=false skia_use_gl=true skia_use_harfbuzz=false skia_use_icu=true skia_use_libfuzzer_defaults=true skia_use_libgifcodec=true skia_use_libheif=false skia_use_libjpeg_turbo_decode=true skia_use_libjpeg_turbo_encode=true skia_use_libpng_decode=true skia_use_libpng_encode=true skia_use_libwebp_decode=true skia_use_libwebp_encode=true skia_use_lua=false skia_use_metal=true skia_use_ndk_images=false skia_use_piex=true skia_use_sfml=false skia_use_sfntly=true skia_use_system_expat=true skia_use_system_freetype2=true skia_use_system_libjpeg_turbo=false skia_use_system_libpng=true skia_use_system_libwebp=true skia_use_system_zlib=true skia_use_vma=false skia_use_vulkan=false skia_use_webgl=false skia_use_wuffs=false skia_use_x11=false skia_use_xps=false skia_use_zlib=false

Brian Osman

unread,
Sep 21, 2021, 8:31:45 AM9/21/21
to skia-d...@googlegroups.com
You also need  skia_enable_gpu=true (you have it set to false).

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/47fdb33b-851e-4392-ad60-7f74d4b4c1e5n%40googlegroups.com.

Jhon

unread,
Sep 21, 2021, 8:46:40 AM9/21/21
to skia-discuss
Thank you will try and let u know

Jhon

unread,
Sep 21, 2021, 9:41:45 AM9/21/21
to skia-discuss
i tried
<EGL/egl.h> file not found in mac 

Jhon

unread,
Sep 21, 2021, 9:41:56 AM9/21/21
to skia-discuss
could u help me

Greg Daniel

unread,
Sep 21, 2021, 9:50:13 AM9/21/21
to skia-discuss
You need to supply egl. That is not part of Skia

Jim Van Verth

unread,
Sep 21, 2021, 10:34:42 AM9/21/21
to skia-d...@googlegroups.com
I believe the EGL/egl.h requirement is coming from skia_use_vulkan, as there are some Vulkan-only tests that use it. Since you have Metal enabled, you probably don't need Vulkan as well (since MoltenVK runs on top of Metal).



--

Jim Van Verth | Software Engineer | jvan...@google.com | 919-210-7664

Jhon

unread,
Sep 21, 2021, 12:55:36 PM9/21/21
to skia-discuss
I'm building for mac . so i enabled metal only . but still got the same kind of error

error: no matching function for call to 'MakeMetal'
    sk_sp<GrDirectContext> grContext(GrDirectContext::MakeMetal(interface));

I have added a print statement in Build.gn to check public_defines array was populated with SK_METAL

any idea?

Gn Options
is_official_build=true
skia_compile_processors=false
skia_enable_android_utils=false
skia_enable_api_available_macro=true
skia_enable_direct3d_debug_layer=false
skia_enable_discrete_gpu=true
skia_enable_flutter_defines=false
skia_enable_fontmgr_android=false
skia_enable_fontmgr_custom_directory=false
skia_enable_fontmgr_custom_embedded=false
skia_enable_fontmgr_custom_empty=false
skia_enable_fontmgr_empty=false
skia_enable_fontmgr_fontconfig=false
skia_enable_fontmgr_fuchsia=false
skia_enable_fontmgr_win=false
skia_enable_fontmgr_win_gdi=false
skia_enable_gpu=true
skia_enable_gpu_debug_layers=false
skia_enable_particles=true
skia_enable_pdf=true
skia_enable_skottie=true
skia_enable_skparagraph=true
skia_enable_skrive=true
skia_enable_skshaper=true
skia_enable_spirv_validation=false
skia_enable_tools=false
skia_enable_vulkan_debug_layers=false
skia_generate_workarounds=false
skia_include_multiframe_procs=false
skia_lex=false
skia_pdf_subset_harfbuzz=false
skia_tools_require_resources=false
skia_update_fuchsia_sdk=false
skia_use_angle=false
skia_use_dawn=false
skia_use_direct3d=false
skia_use_dng_sdk=true
skia_use_egl=false
skia_use_expat=true
skia_use_experimental_xform=false
skia_use_ffmpeg=false
skia_use_fixed_gamma_text=false
skia_use_fontconfig=false
skia_use_fonthost_mac=true
skia_use_freetype=false
skia_use_gl=false
skia_use_harfbuzz=true skia_use_icu=true skia_use_libgifcodec=true
skia_use_libheif=false skia_use_libjpeg_turbo_decode=true skia_use_libjpeg_turbo_encode=true
skia_use_libpng_decode=true skia_use_libpng_encode=true skia_use_libwebp_decode=true
skia_use_libwebp_encode=true skia_use_lua=false skia_use_metal=true skia_use_ndk_images=false
skia_use_piex=true skia_use_sfml=false skia_use_sfntly=true skia_use_system_expat=true
skia_use_system_libjpeg_turbo=true skia_use_system_libpng=true skia_use_system_libwebp=true
skia_use_system_zlib=true skia_use_vma=false skia_use_vulkan=false skia_use_webgl=false
skia_use_wuffs=false skia_use_x11=false skia_use_xps=true skia_use_zlib=true

sAsuKe

unread,
Sep 23, 2021, 8:20:24 AM9/23/21
to skia-discuss
did you add c++ flags in xcode project? It'll give this error if c++ flags is not added

Jhon

unread,
Sep 24, 2021, 2:12:11 AM9/24/21
to skia-discuss
no i didnt add any flags. I'm using cmake generator to build my code and gn to compile skia. btw which flag u mean -DSK_METAL ?
Reply all
Reply to author
Forward
0 new messages