MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / queryContext

Function queryContext

server/backend.cpp:897–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895
896
897int queryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
898{
899 if(fconfig.egl)
900 {
901 int retval = Success;
902 VGLFBConfig config;
903
904 if(!ctx || !(config = CTXHASHEGL.findConfig(ctx)))
905 {
906 faker::sendGLXError(dpy, X_GLXQueryContext, GLXBadContext, false);
907 return GLX_BAD_CONTEXT;
908 }
909 switch(attribute)
910 {
911 case GLX_FBCONFIG_ID:
912 *value = config->id;
913 retval = Success;
914 break;
915 case GLX_RENDER_TYPE:
916 *value = GLX_RGBA_TYPE;
917 retval = Success;
918 break;
919 case GLX_SCREEN:
920 *value = config->screen;
921 retval = Success;
922 break;
923 default:
924 retval = GLX_BAD_ATTRIBUTE;
925 }
926
927 return retval;
928 }
929 else
930 {
931 int retval = _glXQueryContext(DPY3D, ctx, attribute, value);
932 if(fconfig.amdgpuHack && ctx && attribute == GLX_RENDER_TYPE && value
933 && *value == 0)
934 *value = GLX_RGBA_TYPE;
935 return retval;
936 }
937}
938
939
940void queryDrawable(Display *dpy, GLXDrawable draw, int attribute,

Callers 1

glXQueryContextFunction · 0.85

Calls 2

sendGLXErrorFunction · 0.85
findConfigMethod · 0.45

Tested by

no test coverage detected