Skip to content

Fix shader#6

Open
giraldeau wants to merge 2 commits into
ajclinto:masterfrom
giraldeau:fix-shader
Open

Fix shader#6
giraldeau wants to merge 2 commits into
ajclinto:masterfrom
giraldeau:fix-shader

Conversation

@giraldeau

Copy link
Copy Markdown

Hello!

I'm trying to make the shader work on my modest machine, with a cheap Intel card. The driver does not supports the GL_EXT_gpu_shader4 extension, and therefore usampler2DRect is not available. I tried to revert to sampler2DRect, but the window is blank (see screenshot below). Can we make it work with simply sampler2DRect?

The first patch is about reporting to the user if the shader does not load.

Thanks!

image

If the GL shader fails to load, terminate the children and report the error to
the user.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
usampler2DRect requires GL_EXT_gpu_shader4, see:

  https://www.opengl.org/wiki/GL_EXT_texture_integer

However, it is not available on cheap Linux/Intel cards/drivers.  When using
sampler2DRect, the shader loads, but the window is completely dark.

This fix is therefore incomplete. How can we make drawing work with
sampler2DRect only?

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
@ajclinto

ajclinto commented Sep 5, 2015

Copy link
Copy Markdown
Owner

I don't think it's possible to use sampler2DRect as a replacement for usampler2DRect. The host has set up the texture using unsigned integer values, and any conversion to/from float would cause other parts of the shader program to fail - eg. this stuff:

uint dtype = val & 7u;
uint type = (val >> 3u) & 3u;
bool freed = ((val >> 3u) & 4u) > 0u;
uint tid = (val >> 6u) & 0x3FFu;

And look at MemViewWidget::paintGL() and myImage.

Your other fix to add an error message when failing to load the program is probably a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants