<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 07. aug. 2018 11:31, Dave Airlie wrote:<br>
<blockquote type="cite"
cite="mid:CAPM=9twdPXcZbKvA2AwYh34h77qAqPQUko3H52gaqnL5rpLi-Q@mail.gmail.com">
<div dir="auto">
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue., 7 Aug. 2018, 18:44 Erik Faye-Lund,
<<a href="mailto:erik.faye-lund@collabora.com"
moz-do-not-send="true">erik.faye-lund@collabora.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">On 07.
aug. 2018 02:51, Dave Airlie wrote:<br>
> On 7 August 2018 at 04:38, Erik Faye-Lund <<a
href="mailto:erik.faye-lund@collabora.com"
target="_blank" rel="noreferrer" moz-do-not-send="true">erik.faye-lund@collabora.com</a>>
wrote:<br>
>> OpenGL ES 3.1 doesn't support using glUniform1i()
for binding<br>
>> images, so let's use layout qualifiers instead.
This should in<br>
>> theory be slightly more performant as well, as we
do less API<br>
>> calls.<br>
> I like this idea, I think we can get rid of a bunch
of stuff with<br>
> explicit bindings,<br>
><br>
> However I think explicit layout bindings on GL
require a shader extension,<br>
><br>
> At least on desktop GL a lot of tests fail after I
apply this.<br>
><br>
> Dave.<br>
<br>
Hmm, that's odd. I don't think there's any extensions that
should be <br>
required by this, but I'll take a look.<br>
<br>
Thanks for pointing this out.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Our baseline glsl version is 130 btw </div>
<div dir="auto"><br>
</div>
<br>
</div>
</blockquote>
Right.<br>
<br>
I think I got a relevant error here:<br>
<br>
vrend_compile_shader: context error reported 8 "Xorg" Illegal shader
0<br>
shader failed to compile<br>
0:9(1): error: the "binding" qualifier only applies to uniform
blocks, storage blocks, opaque variables, or arrays thereof<br>
<br>
GLSL:<br>
#version 330<br>
#extension GL_ARB_compute_shader : require<br>
#extension GL_ARB_shader_storage_buffer_object : require<br>
#extension GL_ARB_shader_bit_encoding : require<br>
#extension GL_ARB_shader_image_load_store : require<br>
layout (local_size_x = 2, local_size_y = 4, local_size_z = 1) in;<br>
vec4 temp0[3];<br>
uint ssbo_addr_temp;<br>
layout(binding=0, r32ui) uniform uimage2D csimg0;<br>
layout (binding = 6, std430) buffer csssbo6 { uint
csssbocontents6[]; };<br>
void main(void)<br>
{<br>
temp0[0].xy = vec2(uintBitsToFloat((uvec4(gl_WorkGroupID.x,
gl_WorkGroupID.y, gl_WorkGroupID.z, gl_WorkGroupID.z) *
(uvec4(2U,4U,1U,1U)) + uvec4(gl_LocalInvocationID.x,
gl_LocalInvocationID.y, gl_LocalInvocationID.z,
gl_LocalInvocationID.z)).xy));<br>
temp0[1].x = float(uintBitsToFloat((uvec4(uvec4(gl_NumWorkGroups.x,
gl_NumWorkGroups.x, gl_NumWorkGroups.x, gl_NumWorkGroups.x)) *
uvec4((uvec4(2U,2U,2U,2U))))).x);<br>
temp0[2].x = uintBitsToFloat(imageLoad(csimg0, ivec2(floatBitsToInt(
temp0[0].xyxx ))).x);<br>
temp0[0].x = float(uintBitsToFloat((floatBitsToUint(temp0[0].yyyy) *
floatBitsToUint(temp0[1].xxxx) +
floatBitsToUint(temp0[0].xxxx)).x));<br>
temp0[0].x =
float(uintBitsToFloat((uvec4(floatBitsToUint(temp0[0].xxxx)) *
uvec4((uvec4(16U,16U,16U,16U))))).x);<br>
csssbocontents6[uint(floatBitsToUint( temp0[0].xxxx ))>>2] =
floatBitsToUint( temp0[2].xxxx ).x;<br>
}<br>
<br>
Checking the mesa source that's from:<br>
<br>
---8<---<br>
} else if ((state->is_version(420, 310) ||<br>
state->ARB_shading_language_420pack_enable)
&&<br>
base_type->is_image()) {<br>
assert(ctx->Const.MaxImageUnits <= MAX_IMAGE_UNITS);<br>
if (max_index >= ctx->Const.MaxImageUnits) {<br>
_mesa_glsl_error(loc, state, "Image binding %d exceeds the
"<br>
"maximum number of image units (%d)",
max_index,<br>
ctx->Const.MaxImageUnits);<br>
return;<br>
}<br>
<br>
} else {<br>
_mesa_glsl_error(loc, state,<br>
"the \"binding\" qualifier only applies to
uniform "<br>
"blocks, storage blocks, opaque variables,
or arrays "<br>
"thereof");<br>
return;<br>
}<br>
---8<---<br>
<br>
... Yeah, seems we need GLSL 420 (or
ARB_shading_language_420pack_enable) to use this construct.<br>
<br>
So, question is... Should we<br>
a) make GLSL 420 a hard requirement for images, or<br>
b) keep the old approach if on GL 4.1 (or ealier) +
GL_ARB_shader_image_load_store?<br>
<br>
I guess a) is the "nicer" thing to do, but it makes the support
burden a bit worse.<br>
</body>
</html>