<div dir="ltr"><div><div>Thank you for your review.<br><br></div>I will add the white space.<br></div>I will remove the unused parameter code.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/15 Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 07/15/2013 07:28 AM, Tomasz Lis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The change allows to store RENDER_TYPE value in GLX context<br>
when indirect rendering is in use.<br>
---<br>
src/glx/create_context.c | 4 +++-<br>
src/glx/glxclient.h | 7 +++++++<br>
src/glx/glxcmds.c | 1 -<br>
src/glx/indirect_glx.c | 23 ++++++++++++++++++-----<br>
4 files changed, 28 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/glx/create_context.c b/src/glx/create_context.c<br>
index a755e83..38e949a 100644<br>
--- a/src/glx/create_context.c<br>
+++ b/src/glx/create_context.c<br>
@@ -84,7 +84,9 @@ glXCreateContextAttribsARB(<u></u>Display *dpy, GLXFBConfig config,<br>
#ifdef GLX_USE_APPLEGL<br>
gc = applegl_create_context(psc, cfg, share, 0);<br>
#else<br>
- gc = indirect_create_context(psc, cfg, share, 0);<br>
+ gc = indirect_create_context_<u></u>attribs(psc, cfg, share, num_attribs,<br>
+ (const uint32_t *) attrib_list,<br>
+ &dummy_err);<br>
#endif<br>
}<br>
<br>
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h<br>
index 3e9b730..fc8f31c 100644<br>
--- a/src/glx/glxclient.h<br>
+++ b/src/glx/glxclient.h<br>
@@ -817,5 +817,12 @@ extern struct glx_context *<br>
indirect_create_context(struct glx_screen *psc,<br>
struct glx_config *mode,<br>
struct glx_context *shareList, int renderType);<br>
+extern struct glx_context *<br>
+indirect_create_context_<u></u>attribs(struct glx_screen *base,<br>
+ struct glx_config *config_base,<br>
+ struct glx_context *shareList,<br>
+ unsigned num_attribs,<br>
+ const uint32_t *attribs,<br>
+ unsigned *error);<br>
<br>
#endif /* !__GLX_client_h__ */<br>
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c<br>
index 967dab3..99b0218 100644<br>
--- a/src/glx/glxcmds.c<br>
+++ b/src/glx/glxcmds.c<br>
@@ -344,7 +344,6 @@ CreateContext(Display *dpy, int generic_id, struct glx_config *config,<br>
<br>
gc->share_xid = shareList ? shareList->xid : None;<br>
gc->imported = GL_FALSE;<br>
- gc->renderType = renderType;<br>
<br>
return (GLXContext) gc;<br>
}<br>
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c<br>
index ff869e2..fc5107d 100644<br>
--- a/src/glx/indirect_glx.c<br>
+++ b/src/glx/indirect_glx.c<br>
@@ -32,6 +32,7 @@<br>
<br>
#include "glapi.h"<br>
#include "glxclient.h"<br>
+#include "dri_common.h"<br>
<br>
extern struct _glapi_table *__glXNewIndirectAPI(void);<br>
<br>
@@ -362,6 +363,8 @@ indirect_create_context(struct glx_screen *psc,<br>
gc->isDirect = GL_FALSE;<br>
gc->vtable = &indirect_context_vtable;<br>
state = calloc(1, sizeof(struct __GLXattributeRec));<br>
+ gc->renderType = renderType;<br>
+<br>
if (state == NULL) {<br>
/* Out of memory */<br>
free(gc);<br>
@@ -430,7 +433,7 @@ indirect_create_context(struct glx_screen *psc,<br>
return gc;<br>
}<br>
<br>
-static struct glx_context *<br>
+_X_HIDDEN struct glx_context *<br>
indirect_create_context_<u></u>attribs(struct glx_screen *base,<br>
struct glx_config *config_base,<br>
struct glx_context *shareList,<br>
@@ -438,18 +441,28 @@ indirect_create_context_<u></u>attribs(struct glx_screen *base,<br>
const uint32_t *attribs,<br>
unsigned *error)<br>
{<br>
+ uint32_t minor_ver = 1;<br>
+ uint32_t major_ver = 2;<br>
+ uint32_t renderType = GLX_RGBA_TYPE;<br>
+ uint32_t flags = 0;<br>
+ unsigned api;<br>
+ int reset = __DRI_CTX_RESET_NO_<u></u>NOTIFICATION;<br>
</blockquote>
<br></div></div>
There should be a blank line between the declarations and the comment.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/* All of the attribute validation for indirect contexts is handled on the<br>
- * server, so there's not much to do here.<br>
+ * server, so there's not much to do here. Still, we need to parse the attributes<br>
+ * to correctly set renderType.<br>
*/<br>
- (void) num_attribs;<br>
- (void) attribs;<br>
+ if (!dri2_convert_glx_attribs(<u></u>num_attribs, attribs,<br>
+ &major_ver, &minor_ver, &renderType, &flags,<br>
+ &api, &reset, error)) {<br>
+ return NULL;<br>
+ }<br>
<br>
/* The error parameter is only used on the server so that correct GLX<br>
* protocol errors can be generated. On the client, it can be ignored.<br>
*/<br>
(void) error;<br>
</blockquote>
<br></div>
Since error is used now, this should be deleted.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
- return indirect_create_context(base, config_base, shareList, 0);<br>
+ return indirect_create_context(base, config_base, shareList, renderType);<br>
}<br>
<br>
struct glx_screen_vtable indirect_screen_vtable = {<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>