From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 82586] New: UBO matrix in std140 struct does not work Date: Wed, 13 Aug 2014 21:54:47 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0057322815==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id B1BE06E2B8 for ; Wed, 13 Aug 2014 14:54:47 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0057322815== Content-Type: multipart/alternative; boundary="1407966887.4fcaa0f0.1792"; charset="us-ascii" --1407966887.4fcaa0f0.1792 Date: Wed, 13 Aug 2014 21:54:47 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=82586 Priority: medium Bug ID: 82586 Assignee: dri-devel@lists.freedesktop.org Summary: UBO matrix in std140 struct does not work Severity: normal Classification: Unclassified OS: All Reporter: pavol@klacansky.com Hardware: Other Status: NEW Version: git Component: Drivers/Gallium/r600 Product: Mesa I am not sure if the problem is actually in my code, but I tested it on nVidia driver and it worked (but their compiler might have a fix for it internally). Here is vertex shader: #version 330 layout(location = 0) in vec4 position; layout(std140) uniform Matrices { mat4 model; mat4 view; mat4 projection; } matrices; out gl_PerVertex { vec4 gl_Position; }; /* interpolate to compute normal in fragment shader */ out vec3 v_position; void main(void) { v_position = vec3(matrices.view * matrices.model * position); gl_Position = matrices.projection * matrices.view * matrices.model * position; } If I use only one matrix from the uniform it works. I have printed UBOs values and they are just identity matrices. -- You are receiving this mail because: You are the assignee for the bug. --1407966887.4fcaa0f0.1792 Date: Wed, 13 Aug 2014 21:54:47 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Priority medium
Bug ID 82586
Assignee dri-devel@lists.freedesktop.org
Summary UBO matrix in std140 struct does not work
Severity normal
Classification Unclassified
OS All
Reporter pavol@klacansky.com
Hardware Other
Status NEW
Version git
Component Drivers/Gallium/r600
Product Mesa

I am not sure if the problem is actually in my code, but I tested it on nVidia
driver and it worked (but their compiler might have a fix for it internally).

Here is vertex shader:

#version 330

layout(location = 0) in vec4 position;

layout(std140) uniform Matrices {
    mat4 model;
    mat4 view;
    mat4 projection;
} matrices;

out gl_PerVertex {
    vec4 gl_Position;
};

/* interpolate to compute normal in fragment shader */
out vec3 v_position;

void main(void)
{
    v_position = vec3(matrices.view * matrices.model * position);
    gl_Position = matrices.projection * matrices.view * matrices.model *
position;
}


If I use only one matrix from the uniform it works. I have printed UBOs values
and they are just identity matrices.


You are receiving this mail because:
  • You are the assignee for the bug.
--1407966887.4fcaa0f0.1792-- --===============0057322815== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0057322815==--