| 895 | |
| 896 | |
| 897 | int 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 | |
| 940 | void queryDrawable(Display *dpy, GLXDrawable draw, int attribute, |
no test coverage detected