<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 9, 2018 at 9:14 PM, Karol Herbst <span dir="ltr"><<a href="mailto:kherbst@redhat.com" target="_blank">kherbst@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_3358929489960013296m_-5884872275189972570HOEnZb"><div class="m_3358929489960013296m_-5884872275189972570h5">On Tue, Apr 10, 2018 at 2:43 AM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>> wrote:<br>
> On Mon, Apr 9, 2018 at 8:39 PM, Karol Herbst <<a href="mailto:kherbst@redhat.com" target="_blank">kherbst@redhat.com</a>> wrote:<br>
>> unsigneds are needed by ARB_bindless_texture 64 bit vertex attribs, both for<br>
>> NV_vertex_attrib_integer64.<br>
>><br>
>> Fixes the new piglit sampler-vertex-attrib-input-ou<wbr>tput test I sent some days<br>
>> ago for bindless_texture.<br>
>><br>
>> The change inside vbo_attrtype_to_double_flag is what I am most concerned<br>
>> about. Maybe I should add another flag for 64 bit ints. Or rework what Doubles<br>
>> mean in gl_array_attributes. Or Rename that to is64Bit and rework all users of<br>
>> Doubles.<br>
>><br>
>> Any suggestions?<br>
>><br>
>> Signed-off-by: Karol Herbst <<a href="mailto:kherbst@redhat.com" target="_blank">kherbst@redhat.com</a>><br>
>> ---<br>
>> src/gallium/drivers/svga/svga_<wbr>format.c | 8 ++++++++<br>
>> src/gallium/include/pipe/p_for<wbr>mat.h | 9 +++++++++<br>
>> src/mesa/main/glformats.c | 3 +++<br>
>> src/mesa/state_tracker/st_atom<wbr>_array.c | 30 +++++++++++++++++++++++++++---<br>
>> src/mesa/vbo/vbo_private.h | 2 +-<br>
>> 5 files changed, 48 insertions(+), 4 deletions(-)<br>
>><br>
>> diff --git a/src/gallium/drivers/svga/svg<wbr>a_format.c b/src/gallium/drivers/svga/svg<wbr>a_format.c<br>
>> index 20a6e6b159f..f01a0e79c72 100644<br>
>> --- a/src/gallium/drivers/svga/svg<wbr>a_format.c<br>
>> +++ b/src/gallium/drivers/svga/svg<wbr>a_format.c<br>
>> @@ -369,6 +369,14 @@ static const struct vgpu10_format_entry format_conversion_table[] =<br>
>> { PIPE_FORMAT_A1B5G5R5_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> { PIPE_FORMAT_X1B5G5R5_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> { PIPE_FORMAT_A4B4G4R4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64B64_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64B64A64_UINT,<wbr> SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64B64_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> + { PIPE_FORMAT_R64G64B64A64_SINT,<wbr> SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
>> };<br>
>><br>
>><br>
>> diff --git a/src/gallium/include/pipe/p_f<wbr>ormat.h b/src/gallium/include/pipe/p_f<wbr>ormat.h<br>
>> index 57399800fa4..df698856b70 100644<br>
>> --- a/src/gallium/include/pipe/p_f<wbr>ormat.h<br>
>> +++ b/src/gallium/include/pipe/p_f<wbr>ormat.h<br>
>> @@ -396,6 +396,15 @@ enum pipe_format {<br>
>> PIPE_FORMAT_X1B5G5R5_UNORM = 310,<br>
>> PIPE_FORMAT_A4B4G4R4_UNORM = 311,<br>
>><br>
>> + PIPE_FORMAT_R64_UINT = 312,<br>
>> + PIPE_FORMAT_R64G64_UINT = 313,<br>
>> + PIPE_FORMAT_R64G64B64_UINT = 314,<br>
>> + PIPE_FORMAT_R64G64B64A64_UINT<wbr> = 315,<br>
>> + PIPE_FORMAT_R64_SINT = 316,<br>
>> + PIPE_FORMAT_R64G64_SINT = 317,<br>
>> + PIPE_FORMAT_R64G64B64_SINT = 318,<br>
>> + PIPE_FORMAT_R64G64B64A64_SINT<wbr> = 319,<br>
>> +<br>
>> PIPE_FORMAT_COUNT<br>
>> };<br>
>><br>
>> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c<br>
>> index 1e797c24c2a..feafd97f5ee 100644<br>
>> --- a/src/mesa/main/glformats.c<br>
>> +++ b/src/mesa/main/glformats.c<br>
>> @@ -543,6 +543,9 @@ _mesa_bytes_per_vertex_attrib(<wbr>GLint comps, GLenum type)<br>
>> case GL_INT:<br>
>> case GL_UNSIGNED_INT:<br>
>> return comps * sizeof(GLint);<br>
>> + /* ARB_bindless_texture */<br>
>> + case GL_UNSIGNED_INT64_ARB:<br>
>> + return comps * sizeof(GLuint64EXT);<br>
>> case GL_FLOAT:<br>
>> return comps * sizeof(GLfloat);<br>
>> case GL_HALF_FLOAT_ARB:<br>
>> diff --git a/src/mesa/state_tracker/st_at<wbr>om_array.c b/src/mesa/state_tracker/st_at<wbr>om_array.c<br>
>> index 2fd67e8d840..1c3f677d4bf 100644<br>
>> --- a/src/mesa/state_tracker/st_at<wbr>om_array.c<br>
>> +++ b/src/mesa/state_tracker/st_at<wbr>om_array.c<br>
>> @@ -230,6 +230,27 @@ static const uint16_t vertex_formats[][4][4] = {<br>
>> PIPE_FORMAT_R32G32B32A32_FIXE<wbr>D<br>
>> },<br>
>> },<br>
>> + {{0}}, /* gap */<br>
>> + { /* GL_INT64_ARB */<br>
>> + {0},<br>
>> + {0},<br>
>> + {<br>
>> + PIPE_FORMAT_R64_SINT,<br>
>> + PIPE_FORMAT_R64G64_SINT,<br>
>> + PIPE_FORMAT_R64G64B64_SINT,<br>
>> + PIPE_FORMAT_R64G64B64A64_SINT<br>
>> + },<br>
>> + },<br>
>> + { /* GL_UNSIGNED_INT64_ARB */<br>
>> + {0},<br>
>> + {0},<br>
>> + {<br>
>> + PIPE_FORMAT_R64_UINT,<br>
>> + PIPE_FORMAT_R64G64_UINT,<br>
>> + PIPE_FORMAT_R64G64B64_UINT,<br>
>> + PIPE_FORMAT_R64G64B64A64_UINT<br>
>> + },<br>
>> + },<br>
><br>
> Since these are never actually passed in via a single vertex attrib,<br>
> is there any way to not add these at all, and just handle the<br>
> conversion from 64-bit to 2x 32-bit entirely internally to st/mesa?<br>
> (Note that R64_FLOAT *can* be actually passed to a driver, and it is<br>
> *not* the ARB_attrib_fp64 case.)<br>
><br>
<br>
</div></div>I guess this might be possible somehow. Anyway, the current code<br>
depends on vbo_attrtype_to_double_flag returning true for the 64 -><br>
2x32 split to happen.<br>
<br>
init_velement_lowered is called with the double argument set to<br>
attrib->Doubles. I guess we could just |= or the input with a check if<br>
the format is UINT64 or SINT64? attrib->Type should get us this<br>
information. Let me try that.<br></blockquote><div><br></div></div>R64.._FLOAT formats are special, because they are converted to 32 bits by vertex fetches.<br><br></div><div class="gmail_extra">Real 64-bit double vertex formats are not representable in Gallium. st/mesa uses 2x and 4x 32_UINT for double and dvec2, respectively.<br><br></div><div class="gmail_extra">Marek<br></div></div>