GithubHelp home page GithubHelp logo

Comments (12)

mosra avatar mosra commented on June 17, 2024

Operating system, graphics card, driver version? What does Magnum Info for NaCl print?

from kotel.

bagobor avatar bagobor commented on June 17, 2024

Win8.1 x64/NVidia GF750ti/Driver v335.23

Magnum Info for NaCl print:

https://gist.github.com/bagobor/7b2955576a501f9a4c40

from kotel.

bagobor avatar bagobor commented on June 17, 2024

Chromium
Version 36.0.1933.0 (262640)

from kotel.

mosra avatar mosra commented on June 17, 2024

Huh. So, on my 64bit Linux, Chrome 34 and NVidia 740M it works without any issues, while the same version on 64bit Win 8 freezes to death on any attempt to use NaCl, so I can't test anything. Does it print anything else to the console except the assertion error? Can you try running Chrome without ANGLE?

chrome.exe --use-gl=desktop

I will try to find some hardware on which Chrome won't freeze, there might definitely be some issue with the shader. Thanks for reporting :)

from kotel.

bagobor avatar bagobor commented on June 17, 2024

Updated console log:

AbstractShaderProgram::link(): linking failed with the following message:
(26,2-71): error X3500: array reference cannot be used as an l-value; not natively addressable
Warning: D3D shader compilation failed with
default
flags.
Failed to create D3D shaders.
Assertion link() failed in ../src/Magnum/Shaders/MeshVisualizer.cpp on line 107
NativeClient: could not create instance.

from kotel.

mosra avatar mosra commented on June 17, 2024

Thanks! Yup, this looks like an issue with ANGLE library which translates GLSL to D3D/HLSL. It would work if Chrome is run with --use-gl=desktop (i.e. using native OpenGL instead of ANGLE), but apparently that's broken since Chromium 32 and causes the browser to freeze completely.

Still, I will try to work around that.

from kotel.

bagobor avatar bagobor commented on June 17, 2024

do you found file(shader)/line with causes that error?
im curious to find out but have no nacl toolchain installed

from kotel.

mosra avatar mosra commented on June 17, 2024

This one: src/Magnum/Shaders/MeshVisualizer.vert#L62. It's array subscripting of vec3 and I just checked that it's legal syntax even in GLSL ES 1.0. So definitely an ANGLE bug.

from kotel.

bagobor avatar bagobor commented on June 17, 2024

check this: http://goo.gl/gH6FCk (online shader editor)

i tested on my macbook pro and got an error (for line 'barycentric[int(mod(vertexIndex, 3.0))] = 1.0;')
"index expression must be constant"

so ANGLE is not the reason :)

from kotel.

mosra avatar mosra commented on June 17, 2024

From GLSL ES 1.0 specification, section 5.5, as I checked yesterday:

Array subscripting syntax can also be applied to vectors to provide numeric indexing. So in

vec4 pos;

pos[2] refers to the third element of pos and is equivalent to pos.z. This allows variable indexing into a vector, as well as a generic way of accessing components. Any integer expression can be used as the subscript. The first component is at index zero. Reading from or writing to a vector using a constant integral expression with a value that is negative or greater than or equal to the size of the vector is illegal. When indexing with non-constant expressions, behavior is undefined if the index is negative or greater than or equal to the size of the vector.

(Emphasis mine.) So it is allowed by the specs and thus it should be also supported by ANGLE. I assume you tried it on OSX, which unfortunately has also several well-known driver bugs and this might be one of them.

Sorry, I am extremely busy right now. Hopefully on Thursday I will have enough free time to look into this (among other things) and invent some workaround.

from kotel.

mosra avatar mosra commented on June 17, 2024

Sorry that this is taking so long. The workaround might be rather slow, so I'd rather have it only where it is really needed. So to fix this properly I first need to detect that ANGLE is being might be used. Sadly browser vendors actively fight against any autodetection (because of "security" and whatnot), which makes reliable workarounds nearly impossible. I tried to find some info about that, but there doesn't seem to be any easy way.

The workaround might then look like this, instead of

barycentric[int(mod(vertexIndex, 3.0))] = 1.0;

it would be this ugly branch

int i = int(mod(vertexIndex, 3.0));
     if(i == 0) barycentric.x = 1.0;
else if(i == 1) barycentric.y = 1.0;
else            barycentric.z = 1.0;

Maybe they will fix this in the meantime, which would be the best scenario :)

from kotel.

mosra avatar mosra commented on June 17, 2024

I moved the issue to Magnum itself, as it is not related to this project in particular: mosra/magnum#56

from kotel.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.