[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request: Fix passing matrixes to the shaders
From:       Fredrik_Höglund <fredrik () kde ! org>
Date:       2011-03-01 0:23:18
Message-ID: 20110301002318.681.31455 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100759/#review1718
-----------------------------------------------------------

Ship it!



kwin/libkwineffects/kwinglutils.cpp
<http://git.reviewboard.kde.org/r/100759/#comment1418>

    This can now be written as:
    
    for (int i = 0; i < 16; i++)
        m[i] = data[i];
    


Aside from a minor nitpick it looks good.

- Fredrik


On Feb. 27, 2011, 5:13 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100759/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2011, 5:13 p.m.)
> 
> 
> Review request for kwin and Fredrik Höglund.
> 
> 
> Summary
> -------
> 
> As Fredrik noticed QMatrix4x4 accepts data in row-major order but returns them in \
> column-major order. As that was undocumented I expected that constData returns the \
> data in row-major order resulting in all our vertex shaders doing the corrections \
> incorrectly. 
> This fix tries to solve it. Please verify if the math is correct this time :-)
> 
> 
> Diffs
> -----
> 
> kwin/effects/blur/blurshader.cpp 1542578 
> kwin/effects/cube/cube.cpp 89edf32 
> kwin/effects/cube/data/cylinder.vert 5d685d3 
> kwin/effects/cube/data/sphere.vert d634d25 
> kwin/libkwineffects/kwinglutils.cpp f8ddb69 
> kwin/scene-color-vertex.glsl 651e22a 
> kwin/scene-generic-vertex.glsl 6672dec 
> kwin/scene-vertex.glsl 5869dcd 
> 
> Diff: http://git.reviewboard.kde.org/r/100759/diff
> 
> 
> Testing
> -------
> 
> ortho shader still works, generic shader works (e.g. present window, coverswitch, \
> cube). Sphere shader is broken, though seems to be unrelated as it's throwing \
> GL_INVALID_ERRORS (I need to investigate). 
> Untested multi screen adjustments in e.g. coverswitch, though I expect them to \
> work. 
> 
> Thanks,
> 
> Martin
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/100759/">http://git.reviewboard.kde.org/r/100759/</a>
  </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>







<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/100759/diff/1/?file=10308#file10308line994" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/libkwineffects/kwinglutils.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
GLShader::setUniform(int location, const QMatrix4x4 &amp;value)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">994</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span \
class="n">m</span><span class="p">[</span><span class="n">i</span><span \
class="o">*</span><span class="mi">4</span><span class="o">+</span><span \
class="n">j</span><span class="p">]</span> <span class="o">=</span> <span \
class="n">data</span><span class="p">[</span><span class="n"><span \
class="hl">j</span></span><span class="o">*</span><span class="mi">4</span><span \
class="o">+</span><span class="n"><span class="hl">i</span></span><span \
class="p">];</span></pre></td>  <th bgcolor="#e9eaa8" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">994</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">                <span class="n">m</span><span \
class="p">[</span><span class="n">i</span><span class="o">*</span><span \
class="mi">4</span><span class="o">+</span><span class="n">j</span><span \
class="p">]</span> <span class="o">=</span> <span class="n">data</span><span \
class="p">[</span><span class="n"><span class="hl">i</span></span><span \
class="o">*</span><span class="mi">4</span><span class="o">+</span><span \
class="n"><span class="hl">j</span></span><span class="p">];</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This can \
now be written as:

for (int i = 0; i &lt; 16; i++)
    m[i] = data[i];
</pre>
</div>
<br />



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Aside from a minor \
nitpick it looks good.</pre>

<p>- Fredrik</p>


<br />
<p>On February 27th, 2011, 5:13 p.m., Martin Gräßlin wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin and Fredrik Höglund.</div>
<div>By Martin Gräßlin.</div>


<p style="color: grey;"><i>Updated Feb. 27, 2011, 5:13 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">As Fredrik noticed QMatrix4x4 accepts data in row-major order but \
returns them in column-major order. As that was undocumented I expected that \
constData returns the data in row-major order resulting in all our vertex shaders \
doing the corrections incorrectly.

This fix tries to solve it. Please verify if the math is correct this time :-)</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">ortho shader still works, generic shader works (e.g. present window, \
coverswitch, cube). Sphere shader is broken, though seems to be unrelated as it&#39;s \
throwing GL_INVALID_ERRORS (I need to investigate).

Untested multi screen adjustments in e.g. coverswitch, though I expect them to \
work.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kwin/effects/blur/blurshader.cpp <span style="color: grey">(1542578)</span></li>

 <li>kwin/effects/cube/cube.cpp <span style="color: grey">(89edf32)</span></li>

 <li>kwin/effects/cube/data/cylinder.vert <span style="color: \
grey">(5d685d3)</span></li>

 <li>kwin/effects/cube/data/sphere.vert <span style="color: \
grey">(d634d25)</span></li>

 <li>kwin/libkwineffects/kwinglutils.cpp <span style="color: \
grey">(f8ddb69)</span></li>

 <li>kwin/scene-color-vertex.glsl <span style="color: grey">(651e22a)</span></li>

 <li>kwin/scene-generic-vertex.glsl <span style="color: grey">(6672dec)</span></li>

 <li>kwin/scene-vertex.glsl <span style="color: grey">(5869dcd)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/100759/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic