From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 67215] New: UBO access seems to mask address on nouveau Date: Tue, 23 Jul 2013 11:57:50 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1367984639==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Errors-To: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1367984639== Content-Type: multipart/alternative; boundary="1374580670.DFFDE0.31228"; charset="us-ascii" --1374580670.DFFDE0.31228 Date: Tue, 23 Jul 2013 11:57:50 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=67215 Priority: medium Bug ID: 67215 Assignee: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Summary: UBO access seems to mask address on nouveau Severity: normal Classification: Unclassified OS: Linux (All) Reporter: wickmarkus-S0/GAf8tV78@public.gmane.org Hardware: x86-64 (AMD64) Status: NEW Version: git Component: Drivers/DRI/nouveau Product: Mesa Hi, The UBO support seems to be broken when used with dolphin-emu. To try it yourself, I created an apitrace dump: http://markus.members.selfnet.de/dolphin/dolphin-emu.trace (~48M) This works fine on i965 and r600g, but it only show some random polygons on nouveau. This bug only happens when the uniform buffer is bigger than 64k bytes. More precisely it happens when any read offset (related to buffer begin) goes above the 64k mark. The offset per uniform block is restricted to 64k, but the offsets per uniform buffers should allow to access the complete memory. It seems that the shader fetch mask locations to the first 64k bytes of the buffer. To proove this, I moved the uniform block to offset 63k so that the first 1k bytes are read correctly and everything else starts at zero. My uniform buffer was 128k big and I copyed as I wanted to proove and I got a correct rendering. I think the mask is because of 16bit indices for uniform locations. This is valid for uniform block offsets, but not for uniform buffer offsets. eg: u16 uniform_block_offset_per_variable; // hard coded in shader u32 uniform_buffer_offset_per_uniform_block; // set by glBindBufferRange u8* uniform_buffer_base; // location of this uniform buffer // The way I think it's done: u8* fetched_location = uniform_buffer_base + u16(uniform_buffer_offset_per_uniform_block + uniform_block_offset_per_variable); // The correct way: u8* fetched_location = uniform_buffer_base + uniform_buffer_offset_per_uniform_block + u32(uniform_block_offset_per_variable); -- You are receiving this mail because: You are the assignee for the bug. --1374580670.DFFDE0.31228 Date: Tue, 23 Jul 2013 11:57:50 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Priority medium
Bug ID 67215
Assignee nouveau@lists.freedesktop.org
Summary UBO access seems to mask address on nouveau
Severity normal
Classification Unclassified
OS Linux (All)
Reporter wickmarkus@web.de
Hardware x86-64 (AMD64)
Status NEW
Version git
Component Drivers/DRI/nouveau
Product Mesa

Hi,

The UBO support seems to be broken when used with dolphin-emu. To try it
yourself, I created an apitrace dump:
http://markus.members.selfnet.de/dolphin/dolphin-emu.trace (~48M)
This works fine on i965 and r600g, but it only show some random polygons on
nouveau.

This bug only happens when the uniform buffer is bigger than 64k bytes. More
precisely it happens when any read offset (related to buffer begin) goes above
the 64k mark.
The offset per uniform block is restricted to 64k, but the offsets per uniform
buffers should allow to access the complete memory.

It seems that the shader fetch mask locations to the first 64k bytes of the
buffer. To proove this, I moved the uniform block to offset 63k so that the
first 1k bytes are read correctly and everything else starts at zero.
My uniform buffer was 128k big and I copyed as I wanted to proove and I got a
correct rendering.

I think the mask is because of 16bit indices for uniform locations. This is
valid for uniform block offsets, but not for uniform buffer offsets.
eg:

u16 uniform_block_offset_per_variable; // hard coded in shader
u32 uniform_buffer_offset_per_uniform_block; // set by glBindBufferRange
u8* uniform_buffer_base; // location of this uniform buffer

// The way I think it's done:
u8* fetched_location = uniform_buffer_base +
u16(uniform_buffer_offset_per_uniform_block +
uniform_block_offset_per_variable);

// The correct way:
u8* fetched_location = uniform_buffer_base +
uniform_buffer_offset_per_uniform_block +
u32(uniform_block_offset_per_variable);


You are receiving this mail because:
  • You are the assignee for the bug.
--1374580670.DFFDE0.31228-- --===============1367984639== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Nouveau mailing list Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org http://lists.freedesktop.org/mailman/listinfo/nouveau --===============1367984639==--