<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 28, 2018 at 7:20 AM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is required for tessellation shader Compat profile support.<br>
---<br>
 src/mesa/main/dlist.c | 78 ++++++++++++++++++++++++++++++<wbr>+++++++++++++<br>
 1 file changed, 78 insertions(+)<br>
<br>
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c<br>
index 8be223559ab..4fc451000b5 100644<br>
--- a/src/mesa/main/dlist.c<br>
+++ b/src/mesa/main/dlist.c<br>
@@ -365,6 +365,11 @@ typedef enum<br>
    OPCODE_UNIFORM_3UIV,<br>
    OPCODE_UNIFORM_4UIV,<br>
<br>
+   /* OpenGL 4.0 / GL_ARB_tessellation_shader */<br>
+   OPCODE_PATCH_PARAMETER_I,<br>
+   OPCODE_PATCH_PARAMETER_FV_<wbr>INNER,<br>
+   OPCODE_PATCH_PARAMETER_FV_<wbr>OUTER,<br>
+<br>
    /* OpenGL 4.2 / GL_ARB_separate_shader_objects */<br>
    OPCODE_USE_PROGRAM_STAGES,<br>
    OPCODE_PROGRAM_UNIFORM_1F,<br>
@@ -3271,6 +3276,54 @@ save_Ortho(GLdouble left, GLdouble right,<br>
 }<br>
<br>
<br>
+static void GLAPIENTRY<br>
+save_PatchParameteri(GLenum pname, const GLint value)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   Node *n;<br>
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_<wbr>AND_FLUSH(ctx);<br>
+   n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_I, 2);<br>
+   if (n) {<br>
+      n[1].e = pname;<br>
+      n[2].i = value;<br>
+   }<br>
+   if (ctx->ExecuteFlag) {<br>
+      CALL_PatchParameteri(ctx-><wbr>Exec, (pname, value));<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void GLAPIENTRY<br>
+save_PatchParameterfv(GLenum pname, const GLfloat *params)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   Node *n;<br>
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_<wbr>AND_FLUSH(ctx);<br>
+<br>
+   if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {<br>
+      n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_<wbr>OUTER, 5);<br>
+   } else {<br>
+      assert(pname == GL_PATCH_DEFAULT_INNER_LEVEL);<br>
+      n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_<wbr>INNER, 3);<br>
+   }<br>
+   if (n) {<br>
+      n[1].e = pname;<br>
+      if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {<br>
+         n[2].f = params[0];<br>
+         n[3].f = params[1];<br>
+         n[4].f = params[2];<br>
+         n[5].f = params[3];<br>
+      } else {<br>
+         n[2].f = params[0];<br>
+         n[3].f = params[1];<br>
+      }<br>
+   }<br>
+   if (ctx->ExecuteFlag) {<br>
+      CALL_PatchParameterfv(ctx-><wbr>Exec, (pname, params));<br>
+   }<br>
+}<br>
+<br>
+<br>
 static void GLAPIENTRY<br>
 save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)<br>
 {<br>
@@ -8401,6 +8454,27 @@ execute_list(struct gl_context *ctx, GLuint list)<br>
          case OPCODE_PASSTHROUGH:<br>
             CALL_PassThrough(ctx->Exec, (n[1].f));<br>
             break;<br>
+         case OPCODE_PATCH_PARAMETER_I:<br>
+            CALL_PatchParameteri(ctx-><wbr>Exec, (n[1].e, n[2].i));<br>
+            break;<br>
+         case OPCODE_PATCH_PARAMETER_FV_<wbr>INNER:<br>
+            {<br>
+               GLfloat params[2];<br>
+               params[0] = n[2].f;<br>
+               params[1] = n[3].f;<br>
+               CALL_PatchParameterfv(ctx-><wbr>Exec, (n[1].e, params));<br>
+            }<br>
+            break;<br>
+         case OPCODE_PATCH_PARAMETER_FV_<wbr>OUTER:<br>
+            {<br>
+               GLfloat params[4];<br>
+               params[0] = n[2].f;<br>
+               params[1] = n[3].f;<br>
+               params[2] = n[4].f;<br>
+               params[3] = n[5].f;<br>
+               CALL_PatchParameterfv(ctx-><wbr>Exec, (n[1].e, params));<br>
+            }<br>
+            break;<br>
          case OPCODE_PIXEL_MAP:<br>
             CALL_PixelMapfv(ctx->Exec,<br>
                             (n[1].e, n[2].i, get_pointer(&n[3])));<br>
@@ -9847,6 +9921,10 @@ _mesa_initialize_save_table(<wbr>const struct gl_context *ctx)<br>
    SET_PointParameterf(table, save_PointParameterfEXT);<br>
    SET_PointParameterfv(table, save_PointParameterfvEXT);<br>
<br>
+   /* 91. GL_ARB_tessellation_shader */<br>
+   SET_PatchParameteri(table, save_PatchParameteri);<br>
+   SET_PatchParameterfv(table, save_PatchParameterfv);<br>
+<br>
    /* 173. GL_EXT_blend_func_separate */<br>
    SET_BlendFuncSeparate(table, save_BlendFuncSeparateEXT);<br>
<span class="HOEnZb"><font color="#888888"> <br>
-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>