Re: [Mesa-dev] [PATCH] android: fix droid_create_image_from_prime_fd_yuv for YV12
Reviewed-by: Marta Lofstedt > -Original Message- > From: Palli, Tapani > Sent: Thursday, February 2, 2017 2:27 PM > To: mesa-dev@lists.freedesktop.org > Cc: tf...@chromium.org; Lofstedt, Marta ; Palli, > Tapani > Subject: [PATCH] android: fix droid_create_image_from_prime_fd_yuv for > YV12 > > Earlier changes introduced is_ycrcb flag which checks the component order > of u and v components. Condition for setting the flag was incorrect, with > ycrcb we are supposed to have cr before cb. > > This patch (together with a fix in our gralloc) fixes corrupted rendering from > 'test-opengl-gl2_yuvtex' native test and corrupted gallery thumbnail in > application switcher on Android-IA. > > Fixes: 51727b1cf57e8c4630767eb9ead207b102ffa489 > Signed-off-by: Tapani Pälli > --- > src/egl/drivers/dri2/platform_android.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/egl/drivers/dri2/platform_android.c > b/src/egl/drivers/dri2/platform_android.c > index 36bd119..511b696 100644 > --- a/src/egl/drivers/dri2/platform_android.c > +++ b/src/egl/drivers/dri2/platform_android.c > @@ -629,7 +629,7 @@ > droid_create_image_from_prime_fd_yuv(_EGLDisplay *disp, _EGLContext > *ctx, > * so they can be interpreted as offsets. */ > offsets[0] = (size_t)ycbcr.y; > /* We assume here that all the planes are located in one DMA-buf. */ > - is_ycrcb = (size_t)ycbcr.cb < (size_t)ycbcr.cr; > + is_ycrcb = (size_t)ycbcr.cr < (size_t)ycbcr.cb; > if (is_ycrcb) { >offsets[1] = (size_t)ycbcr.cr; >offsets[2] = (size_t)ycbcr.cb; > -- > 2.9.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] mesa/image: Make _mesa_clip_readpixels() work with renderbuffers
Thanks Nanley, I confirm that this patch-set fix the Bugzilla:92193 /Marta > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Nanley Chery > Sent: Monday, February 8, 2016 11:38 PM > To: mesa-dev@lists.freedesktop.org > Cc: 11.0 11.1 ; Chery, Nanley G > > Subject: [Mesa-dev] [PATCH 1/4] mesa/image: Make > _mesa_clip_readpixels() work with renderbuffers > > From: Nanley Chery > > v2: Use gl_renderbuffer::{Width,Height} (Jason) > > Cc: "11.0 11.1" > Signed-off-by: Nanley Chery > --- > src/mesa/main/image.c | 22 +- > 1 file changed, 17 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index > e79e3e6..99f253c 100644 > --- a/src/mesa/main/image.c > +++ b/src/mesa/main/image.c > @@ -670,7 +670,7 @@ _mesa_clip_drawpixels(const struct gl_context *ctx, > * so that the image region is entirely within the window bounds. > * Note: this is different from _mesa_clip_drawpixels() in that the > * scissor box is ignored, and we use the bounds of the current readbuffer > - * surface. > + * surface or the attached image. > * > * \return GL_TRUE if region to read is in bounds > * GL_FALSE if region is completely out of bounds (nothing to read) > @@ -682,6 +682,18 @@ _mesa_clip_readpixels(const struct gl_context *ctx, >struct gl_pixelstore_attrib *pack) { > const struct gl_framebuffer *buffer = ctx->ReadBuffer; > + struct gl_renderbuffer *rb = buffer->_ColorReadBuffer; > + GLsizei clip_width; > + GLsizei clip_height; > + > + if (rb) { > + clip_width = rb->Width; > + clip_height = rb->Height; > + } else { > + clip_width = buffer->Width; > + clip_height = buffer->Height; > + } > + > > if (pack->RowLength == 0) { >pack->RowLength = *width; > @@ -694,8 +706,8 @@ _mesa_clip_readpixels(const struct gl_context *ctx, >*srcX = 0; > } > /* right clipping */ > - if (*srcX + *width > (GLsizei) buffer->Width) > - *width -= (*srcX + *width - buffer->Width); > + if (*srcX + *width > clip_width) > + *width -= (*srcX + *width - clip_width); > > if (*width <= 0) >return GL_FALSE; > @@ -707,8 +719,8 @@ _mesa_clip_readpixels(const struct gl_context *ctx, >*srcY = 0; > } > /* top clipping */ > - if (*srcY + *height > (GLsizei) buffer->Height) > - *height -= (*srcY + *height - buffer->Height); > + if (*srcY + *height > clip_height) > + *height -= (*srcY + *height - clip_height); > > if (*height <= 0) >return GL_FALSE; > -- > 2.7.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/4] i965: Provide sse2 version for rgba8 <-> bgra8 swizzle
Hi Roland and Matt, I am sorry, but this patch segfaults/asserts Kronos CTS - ES2-CTS.gtf.GL2FixedTests.scissor.scissor I created this bug: https://bugs.freedesktop.org/show_bug.cgi?id=93962 I also added the bug to the OpenGL ES 3.1 tracker bug, since it blocks CTS testing. https://bugs.freedesktop.org/show_bug.cgi?id=92788 /Marta > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Roland Scheidegger > Sent: Friday, January 29, 2016 2:18 AM > To: Matt Turner > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 2/4] i965: Provide sse2 version for rgba8 <-> > bgra8 swizzle > > Am 29.01.2016 um 00:31 schrieb Matt Turner: > > On Sun, Jan 17, 2016 at 1:49 PM, wrote: > >> From: Roland Scheidegger > >> > >> The existing code used ssse3, and because it isn't compiled in a > >> separate file compiled with that, it is usually not used (that, of > >> course, could be fixed...), whereas sse2 is always present at least with > 64bit builds. > >> It is actually trivial to do with sse2 without pshufb, on some cpus > >> (I'm looking at you, atom!) it might not even be slower. > >> This is compile-tested only, it doesn't actually do what I really > >> want (which is glReadPixels without doing byte access from an > >> uncached region, which is what you'll get on intel chips not having > >> llc, if your cpu doesn't support sse41 (in which case the rb would be > >> copied over with movntdqa instead of mapped, so mesa format_utils > >> byte swapping conversion will then access the cached region instead > >> of the uncached one) - really need sse2-optimized convert_ubyte > >> functions for a proper fix, otherwise google maps in firefox is > >> reduced to fps below 1 fps), but hey why not. I don't have a gpu which > could possibly hit this, albeit I succesfully used the exact same code > elsewhere. > > > > Bah, wall of text! > > > > I don't think we need all this. The commit title says everything I > > think it needs to say. > > > >> v2: fix andnot argument order, add comments > >> --- > >> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 18 +++ > >> src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 73 > >> +- > >> 2 files changed, 79 insertions(+), 12 deletions(-) > >> > >> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c > >> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c > >> index 108dd87..5fc4212 100644 > >> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c > >> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c > >> @@ -2773,6 +2773,24 @@ intel_miptree_map(struct brw_context *brw, > >> } else if (!(mode & GL_MAP_WRITE_BIT) && > >>!mt->compressed && cpu_has_sse4_1 && > >>(mt->pitch % 16 == 0)) { > >> + /* > >> + * XXX: without sse4_1, in some situations still really want to copy > >> + * regardless. Presumably this is not done for performance reasons - > >> + * with movntdqa thanks to the 64byte streaming load buffer the > >> + * uncached->cached copy followed by cached->cached later is always > >> + * faster than doing "ordinary" uncached->cached copy. > >> + * Without movntdqa, of course an additional copy doesn't help, > albeit > >> + * it has to be said the uncached->cached one is an order of > magnitude > >> + * slower than the later cached->cached one in any case. > >> + * But mesa may not do a simple memcpy on that memory later - > some > >> + * glReadPixels paths for instance will well hit per-byte access > >> which > >> + * is a complete performance killer on uncached memory. So in these > >> + * cases really want to copy regardless, unless the map below could > >> + * play some tricks making the memory cached. > >> + * (Or otherwise ensure mesa can't hit these paths often, for > >> instance > >> + * glReadPixels requiring conversions could be handled by meta, so > >> in > >> + * end it really would be just memcpy.) > >> + */ > > > > Walls of text are really hard to read... > > > > I don't think adding this comment to the code is particularly > > valuable, but it does make me wonder if we should just add a memcpy > > fallback after this path? Maybe we don't care once we have this patch. > > Ok I'll remove that. It was rather difficult for me to figure out how mesa > ends > up doing the per-byte access out of uncached memory, which is why I wrote > it. > I don't know if the always memcpy is an acceptable solution (hence didn't do > anything about it). It will only add a quite small extra cost but OTOH that > perf > hit will be on the fast path which you probably expect to hit often (i.e. mesa > accessing things with a memcpy anyway). > My guess is the fastest solution would be trying to remap as cacheable > somehow, but I don't really know much about the driver (but I know tricks > like that get ugly real fast with all the fences, clflushes etc
Re: [Mesa-dev] [PATCH v5] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Tuesday, January 26, 2016 6:01 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Marek Olšák > Subject: Re: [Mesa-dev] [PATCH v5] mesa: enable enums for > OES_geometry_shader > > On Tue, Jan 26, 2016 at 3:48 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Enable GL_OES_geometry_shader enums for OpenGL ES 3.1. > > > > V4: EXTRA tokens updated according to comments from Ilia Mirkin. > > > > V5: Account for check_extra does not evaluate "or" lazy. Fix issues > > with EXTRA_EXT_FB_NO_ATTACH_CS. > > Oh! So all of those were essentially broken since they overrode any other > results. Tricky. I was wondering why we were seeing failures since the > conditions *seemed* correct. > > Assuming the only thing you changed from the last attempt was merging my > layers change to still be exposed in gl compat and fixing api_found = x into > if > (x) api_found = true, then this still has my R-b. (Little good it did last > time > though...) > Thanks Ilia, This was of course all my bad, I should of course have run piglit on what I actually was merging and not with also having oes_geometry_shader enabled in i965. > -ilia > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] glsl: add GL_OES_geometry_point_size and conditionalize gl_PointSize
Reviewed-by: Marta Lofstedt > -Original Message- > From: Ilia Mirkin [mailto:ibmir...@gmail.com] On Behalf Of Ilia Mirkin > Sent: Friday, January 22, 2016 9:24 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Ilia Mirkin > Subject: [PATCH v2] glsl: add GL_OES_geometry_point_size and > conditionalize gl_PointSize > > For now this will be enabled in tandem with GL_OES_geometry_shader. > Should a driver come along that wants to separate them out, another enable > can be added. > > Also adds the missed GL_OES_geometry_shader define in glcpp. > > Signed-off-by: Ilia Mirkin > --- > > v1 -> v2: add glcpp defines for both exts > > src/glsl/builtin_variables.cpp | 7 ++- > src/glsl/glcpp/glcpp-parse.y | 7 +++ > src/glsl/glsl_parser_extras.cpp | 1 + > src/glsl/glsl_parser_extras.h| 2 ++ > src/mesa/main/extensions_table.h | 1 + > 5 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp > index > ccc04c0..25d92cc 100644 > --- a/src/glsl/builtin_variables.cpp > +++ b/src/glsl/builtin_variables.cpp > @@ -1201,7 +1201,12 @@ builtin_variable_generator::generate_varyings() > /* gl_Position and gl_PointSize are not visible from fragment shaders. */ > if (state->stage != MESA_SHADER_FRAGMENT) { >add_varying(VARYING_SLOT_POS, vec4_t, "gl_Position"); > - add_varying(VARYING_SLOT_PSIZ, float_t, "gl_PointSize"); > + if (!state->es_shader || > + state->stage == MESA_SHADER_VERTEX || > + (state->stage == MESA_SHADER_GEOMETRY && > + state->OES_geometry_point_size_enable)) { > + add_varying(VARYING_SLOT_PSIZ, float_t, "gl_PointSize"); > + } > } > > if (state->is_version(130, 0)) { > diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index > ef1a657..43a1aa9 100644 > --- a/src/glsl/glcpp/glcpp-parse.y > +++ b/src/glsl/glcpp/glcpp-parse.y > @@ -2386,6 +2386,13 @@ > _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, > intmax_t versio > add_builtin_define(parser, > "GL_OES_texture_storage_multisample_2d_array", 1); >if (extensions->ARB_blend_func_extended) > add_builtin_define(parser, "GL_EXT_blend_func_extended", 1); > + > + if (version >= 310) { > + if (extensions->OES_geometry_shader) { > +add_builtin_define(parser, "GL_OES_geometry_point_size", > 1); > +add_builtin_define(parser, "GL_OES_geometry_shader", 1); > + } > + } > } > } else { > add_builtin_define(parser, "GL_ARB_draw_buffers", 1); diff > --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp > index > 6038954..7dad466 100644 > --- a/src/glsl/glsl_parser_extras.cpp > +++ b/src/glsl/glsl_parser_extras.cpp > @@ -598,6 +598,7 @@ static const _mesa_glsl_extension > _mesa_glsl_supported_extensions[] = { > /* OES extensions go here, sorted alphabetically. > */ > EXT(OES_EGL_image_external, false, true, > OES_EGL_image_external), > + EXT(OES_geometry_point_size,false, true, > OES_geometry_shader), > EXT(OES_geometry_shader,false, true, > OES_geometry_shader), > EXT(OES_standard_derivatives, false, true, > OES_standard_derivatives), > EXT(OES_texture_3D, false, true, dummy_true), > diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h > index > 3f88e01..a905b56 100644 > --- a/src/glsl/glsl_parser_extras.h > +++ b/src/glsl/glsl_parser_extras.h > @@ -591,6 +591,8 @@ struct _mesa_glsl_parse_state { > */ > bool OES_EGL_image_external_enable; > bool OES_EGL_image_external_warn; > + bool OES_geometry_point_size_enable; > + bool OES_geometry_point_size_warn; > bool OES_geometry_shader_enable; > bool OES_geometry_shader_warn; > bool OES_standard_derivatives_enable; diff --git > a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h > index 7a4b8a2..7fb4de2 100644 > --- a/src/mesa/main/extensions_table.h > +++ b/src/mesa/main/extensions_table.h > @@ -312,6 +312,7 @@ EXT(OES_element_index_uint , dummy_true > EXT(OES_fbo_render_mipmap , dummy_true > , x , x , > ES1, ES2, 2005) > EXT(OES_fixed_point , dummy_true > , x
Re: [Mesa-dev] [PATCH 2/4] mesa: enable enums for OES_geometry_shader
I am sorry for this. I am sending up a v5 where I have accounted for that check_extra doesn't evaluate lazily FYI I believe that the the EXTRA_EXT_*_TESS tokens may need to be looked over, since they are bound to cause similar trouble when we enable oes_tesselation_shader for GLES 3.1. I also moved MAX_FRAMEBUFFER_LAYER to [GL, GL_CORE, GLES31] and fixed up the EXTRA_EXT_FB_NO_ATTACH_CS. And of course I have no longer any piglit regressions. > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Marek Olšák > Sent: Sunday, January 24, 2016 3:48 PM > To: Ilia Mirkin > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 2/4] mesa: enable enums for > OES_geometry_shader > > Hi, > > I have decided to revert this patch, because it breaks a bunch GS piglit > tests. > > Next time please make sure there are no piglit regressions. > > Thanks, > Marek > > On Sat, Jan 23, 2016 at 1:41 AM, Ilia Mirkin wrote: > > On Thu, Jan 21, 2016 at 10:17 AM, Marta Lofstedt > > wrote: > >> From: Marta Lofstedt > >> > >> Enable GL_OES_geometry_shader enums for OpenGL ES 3.1. > >> > >> V4: EXTRA tokens updated according to comments from Ilia Mirkin. > >> > >> Signed-off-by: Marta Lofstedt > >> Reviewed-by: Tapani Pälli > >> --- > >> src/mesa/main/get.c | 65 > ++-- > >> src/mesa/main/get_hash_params.py | 52 > >> +++- > >> 2 files changed, 87 insertions(+), 30 deletions(-) > >> > >> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index > >> 95cb18c..d8f9e25a 100644 > >> --- a/src/mesa/main/get.c > >> +++ b/src/mesa/main/get.c > >> @@ -147,11 +147,14 @@ enum value_extra { > >> EXTRA_VALID_CLIP_DISTANCE, > >> EXTRA_FLUSH_CURRENT, > >> EXTRA_GLSL_130, > >> - EXTRA_EXT_UBO_GS4, > >> - EXTRA_EXT_ATOMICS_GS4, > >> - EXTRA_EXT_SHADER_IMAGE_GS4, > >> + EXTRA_EXT_UBO_GS, > >> + EXTRA_EXT_ATOMICS_GS, > >> + EXTRA_EXT_SHADER_IMAGE_GS, > >> EXTRA_EXT_ATOMICS_TESS, > >> EXTRA_EXT_SHADER_IMAGE_TESS, > >> + EXTRA_EXT_SSBO_GS, > >> + EXTRA_EXT_FB_NO_ATTACH_GS, > >> + EXTRA_EXT_ES_GS, > >> }; > >> > >> #define NO_EXTRA NULL > >> @@ -308,7 +311,7 @@ static const int > >> extra_ARB_transform_feedback2_api_es3[] = { }; > >> > >> static const int > extra_ARB_uniform_buffer_object_and_geometry_shader[] = { > >> - EXTRA_EXT_UBO_GS4, > >> + EXTRA_EXT_UBO_GS, > >> EXTRA_END > >> }; > >> > >> @@ -343,12 +346,12 @@ static const int extra_EXT_texture_array_es3[] > >> = { }; > >> > >> static const int > extra_ARB_shader_atomic_counters_and_geometry_shader[] = { > >> - EXTRA_EXT_ATOMICS_GS4, > >> + EXTRA_EXT_ATOMICS_GS, > >> EXTRA_END > >> }; > >> > >> static const int > extra_ARB_shader_image_load_store_and_geometry_shader[] = { > >> - EXTRA_EXT_SHADER_IMAGE_GS4, > >> + EXTRA_EXT_SHADER_IMAGE_GS, > >> EXTRA_END > >> }; > >> > >> @@ -375,6 +378,29 @@ static const int > extra_ARB_shader_storage_buffer_object_es31[] = { > >> EXTRA_END > >> }; > >> > >> +static const int > extra_ARB_shader_storage_buffer_object_and_geometry_shader[] = { > >> + EXTRA_EXT_SSBO_GS, > >> + EXTRA_END > >> +}; > >> + > >> + > >> +static const int > extra_ARB_framebuffer_no_attachments_and_geometry_shader[] = { > >> + EXTRA_EXT_FB_NO_ATTACH_GS, > >> + EXTRA_END > >> +}; > >> + > >> +static const int extra_ARB_viewport_array_or_oes_geometry_shader[] > = { > >> + EXT(ARB_viewport_array), > >> + EXTRA_EXT_ES_GS, > >> + EXTRA_END > >> +}; > >> + > >> +static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = { > >> + EXT(ARB_gpu_shader5), > >> + EXTRA_EXT_ES_GS, > >> + EXTRA_END > >> +}; > >> + > >> EXTRA_EXT(ARB_texture_cube_map); > >> EXTRA_EXT(EXT_texture_array); > >> EXTRA_EXT(NV_fog_distance); > >> @@ -424,6 +450,7 @@ EXTRA_EXT(ARB_tessellation_shader); > >> EXTRA_EXT(ARB_shader_subroutine); > >> EXTRA_EXT(ARB_shader_storage_buffer_object); > >> EXTRA_EXT(ARB_indirect_parameters); > >> +EXTRA_EXT(OES_geometry_shader); > >> > >> static const int > >> extra_ARB_color_buffer_float_or_glcore[] = { @@ -455,6 +482,12 @@ > >> static const int extra_gl32_es3[] = { > >> EXTRA_END, > >> }; > >> > >> +static const int extra_version_32_OES_geometry_shader[] = { > >> +EXTRA_VERSION_32, > >> +EXT(OES_geometry_shader), > >> +EXTRA_END > >> +}; > >> + > >> static const int extra_gl40_ARB_sample_shading[] = { > >> EXTRA_VERSION_40, > >> EXT(ARB_sample_shading), > >> @@ -1154,17 +1187,17 @@ check_extra(struct gl_context *ctx, const char > *func, const struct value_desc *d > >> if (ctx->Const.GLSLVersion >= 130) > >> api_found = GL_TRUE; > >> break; > >> - case EXTRA_EXT_UBO_GS4: > >> + case EXTRA_EXT_UBO_GS: > >> api_check = GL_TRUE; > >> api_found = (ctx->Extensions.ARB_uniform_buffer_object && > >>_mesa_has_geo
Re: [Mesa-dev] [PATCH 3/4] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 4:33 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > Subject: Re: [PATCH 3/4] glsl: add support for GL_OES_geometry_shader > > On Thu, Jan 21, 2016 at 10:17 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > This adds glsl support of GL_OES_geometry_shader for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > Reviewed-by: Ian Romanick > > --- > > src/glsl/builtin_variables.cpp | 25 + > > src/glsl/glsl_parser.yy | 4 ++-- > > src/glsl/glsl_parser_extras.cpp | 1 + > > src/glsl/glsl_parser_extras.h | 7 +++ > > 4 files changed, 23 insertions(+), 14 deletions(-) > > > > diff --git a/src/glsl/builtin_variables.cpp > > b/src/glsl/builtin_variables.cpp index 221aab0..ccc04c0 100644 > > --- a/src/glsl/builtin_variables.cpp > > +++ b/src/glsl/builtin_variables.cpp > > @@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > > } > > > > - if (state->is_version(150, 0)) { > > + if (state->has_geometry_shader()) { > >add_const("gl_MaxVertexOutputComponents", > > state->Const.MaxVertexOutputComponents); > >add_const("gl_MaxGeometryInputComponents", > > @@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBindings", > > state->Const.MaxAtomicBufferBindings); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounters", > > state->Const.MaxGeometryAtomicCounters); > > + } > > + if (!state->es_shader) { > > add_const("gl_MaxTessControlAtomicCounters", > > state->Const.MaxTessControlAtomicCounters); > > add_const("gl_MaxTessEvaluationAtomicCounters", > > @@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBufferSize", > > state->Const.MaxAtomicCounterBufferSize); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounterBuffers", > > state->Const.MaxGeometryAtomicCounterBuffers); > > + } > > + if (!state->es_shader) { > > add_const("gl_MaxTessControlAtomicCounterBuffers", > > state->Const.MaxTessControlAtomicCounterBuffers); > > add_const("gl_MaxTessEvaluationAtomicCounterBuffers", > > @@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxCombinedImageUniforms", > > state->Const.MaxCombinedImageUniforms); > > > > + if (state->has_geometry_shader()) { > > + add_const("gl_MaxGeometryImageUniforms", > > + state->Const.MaxGeometryImageUniforms); > > + } > > So this is *really* pedantic, and I think you can disregard my comment. > However, I'd like to say it for posterity anyways: > > ARB_shader_image_load_store defines a bunch of interactions, and none of > them talk about removing gl_MaxGeometryImageUniforms when you don't > have GL 3.2. I suspect similar is true of atomic counters but I didn't check > explicitly. > > If you want to be super-accurate, you'd make the formerly "if (!state- > >es_shader)" blocks read something like > > if (!state->es_shader || state->has_geometry_shader()) > > I also vaguely recall Ian talking about this. I forget what he said. > If he said anything that conflicts with what I said, trust him, not me. > > Either way, this is > > Reviewed-by: Ilia Mirkin Thanks for the review and the comments. Since Ian already reviewed this patch and didn't comment on your comments. I will go for what I already had. /Marta ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/4] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 4:24 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > Subject: Re: [PATCH 2/4] mesa: enable enums for OES_geometry_shader > > On Thu, Jan 21, 2016 at 10:17 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Enable GL_OES_geometry_shader enums for OpenGL ES 3.1. > > > > V4: EXTRA tokens updated according to comments from Ilia Mirkin. > > > > Signed-off-by: Marta Lofstedt > > Reviewed-by: Tapani Pälli > > --- > > src/mesa/main/get.c | 65 > ++-- > > src/mesa/main/get_hash_params.py | 52 > > +++- > > 2 files changed, 87 insertions(+), 30 deletions(-) > > > > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index > > 95cb18c..d8f9e25a 100644 > > --- a/src/mesa/main/get.c > > +++ b/src/mesa/main/get.c > > @@ -147,11 +147,14 @@ enum value_extra { > > EXTRA_VALID_CLIP_DISTANCE, > > EXTRA_FLUSH_CURRENT, > > EXTRA_GLSL_130, > > - EXTRA_EXT_UBO_GS4, > > - EXTRA_EXT_ATOMICS_GS4, > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_UBO_GS, > > + EXTRA_EXT_ATOMICS_GS, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_EXT_ATOMICS_TESS, > > EXTRA_EXT_SHADER_IMAGE_TESS, > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_EXT_FB_NO_ATTACH_GS, > > + EXTRA_EXT_ES_GS, > > }; > > > > #define NO_EXTRA NULL > > @@ -308,7 +311,7 @@ static const int > > extra_ARB_transform_feedback2_api_es3[] = { }; > > > > static const int > extra_ARB_uniform_buffer_object_and_geometry_shader[] = { > > - EXTRA_EXT_UBO_GS4, > > + EXTRA_EXT_UBO_GS, > > EXTRA_END > > }; > > > > @@ -343,12 +346,12 @@ static const int extra_EXT_texture_array_es3[] = > > { }; > > > > static const int > extra_ARB_shader_atomic_counters_and_geometry_shader[] = { > > - EXTRA_EXT_ATOMICS_GS4, > > + EXTRA_EXT_ATOMICS_GS, > > EXTRA_END > > }; > > > > static const int > extra_ARB_shader_image_load_store_and_geometry_shader[] = { > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_END > > }; > > > > @@ -375,6 +378,29 @@ static const int > extra_ARB_shader_storage_buffer_object_es31[] = { > > EXTRA_END > > }; > > > > +static const int > extra_ARB_shader_storage_buffer_object_and_geometry_shader[] = { > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_END > > +}; > > + > > + > > +static const int > extra_ARB_framebuffer_no_attachments_and_geometry_shader[] = { > > + EXTRA_EXT_FB_NO_ATTACH_GS, > > + EXTRA_END > > +}; > > + > > +static const int extra_ARB_viewport_array_or_oes_geometry_shader[] = > { > > + EXT(ARB_viewport_array), > > + EXTRA_EXT_ES_GS, > > + EXTRA_END > > +}; > > + > > +static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = { > > + EXT(ARB_gpu_shader5), > > + EXTRA_EXT_ES_GS, > > + EXTRA_END > > +}; > > + > > EXTRA_EXT(ARB_texture_cube_map); > > EXTRA_EXT(EXT_texture_array); > > EXTRA_EXT(NV_fog_distance); > > @@ -424,6 +450,7 @@ EXTRA_EXT(ARB_tessellation_shader); > > EXTRA_EXT(ARB_shader_subroutine); > > EXTRA_EXT(ARB_shader_storage_buffer_object); > > EXTRA_EXT(ARB_indirect_parameters); > > +EXTRA_EXT(OES_geometry_shader); > > > > static const int > > extra_ARB_color_buffer_float_or_glcore[] = { @@ -455,6 +482,12 @@ > > static const int extra_gl32_es3[] = { > > EXTRA_END, > > }; > > > > +static const int extra_version_32_OES_geometry_shader[] = { > > +EXTRA_VERSION_32, > > +EXT(OES_geometry_shader), > > Since you now have EXTRA_EXT_ES_GS, you should just use that instead of > EXT(OES_geometry_shader). > > With this fixed and the "EXTRA_EXT(OES_geometry_shader)" above > removed, this change is > > Reviewed-by: Ilia Mirkin Thanks, Ilia. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v4] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 2:32 PM > To: Lofstedt, Marta > Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > > On Thu, Jan 21, 2016 at 8:28 AM, Lofstedt, Marta > wrote: > > > > > >> -Original Message- > >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of > >> Ilia Mirkin > >> Sent: Thursday, January 21, 2016 2:03 PM > >> To: Lofstedt, Marta > >> Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > >> Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > >> > >> On Thu, Jan 21, 2016 at 7:57 AM, Lofstedt, Marta > >> > >> wrote: > >> >> -Original Message- > >> >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of > >> >> Ilia Mirkin > >> >> Sent: Thursday, January 21, 2016 1:46 PM > >> >> To: Lofstedt, Marta > >> >> Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > >> >> Subject: Re: [PATCH v4] mesa: enable enums for > OES_geometry_shader > >> >> > >> >> On Thu, Jan 21, 2016 at 7:41 AM, Lofstedt, Marta > >> >> > >> >> wrote: > >> >> >> -Original Message- > >> >> >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf > >> >> >> Of Ilia Mirkin > >> >> >> Sent: Thursday, January 21, 2016 1:25 PM > >> >> >> To: Marta Lofstedt > >> >> >> Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > >> >> >> Subject: Re: [PATCH v4] mesa: enable enums for > >> OES_geometry_shader > >> >> >> > >> >> >> On Thu, Dec 10, 2015 at 11:11 AM, Marta Lofstedt > >> >> >> wrote: > >> >> >> > + case EXTRA_EXT_GPU5_GS: > >> >> >> > + api_check = GL_TRUE; > >> >> >> > + api_found = (ctx->Extensions.ARB_gpu_shader5 || > >> >> >> > + _mesa_has_OES_geometry_shader(ctx)); > >> >> >> > + break; > >> >> >> > + case EXTRA_EXT_VIEWPORT_GS: > >> >> >> > + api_check = GL_TRUE; > >> >> >> > + api_found = (ctx->Extensions.ARB_viewport_array || > >> >> >> > + _mesa_has_OES_geometry_shader(ctx)); > >> >> >> > + break; > >> >> >> > >> >> >> You can do these without the special tokens. Or did you mean && > >> here? > >> >> > > >> >> > I am pretty sure that our previous discussions on this topic > >> >> > ended up with > >> >> || to be preferable in these cases, but if you want && I will change. > >> >> > >> >> I actually don't want either. What I'm saying is that if you want > >> >> ||, then you don't have to add these EXTRA_EXT_GPU5_GS things -- > >> >> using the regular mechanism for composing tokens will get you ||. > >> >> You only need to use these special tokens if you want &&. > >> >> > >> > If by the "regular" mechanism mean: > >> > +static const int extra_ARB_viewport_array_or_geometry_shader[] = { > >> > + EXT(ARB_viewport_array), > >> > + EXT(OES_geometry_shader), > >> > + EXTRA_END > >> > +}; > >> > I had that in an earlier patch, where I interpreted your comment as > >> > a > >> rejection. > >> > >> Nope, that's precisely what I mean. The only distinction between the > >> two is the extra check for the ES context. If you want to preserve > >> that, just create a single EXTRA_EXT_ES_GS token which just does > >> > >> api_found = _mesa_has_OES_geometry_shader(ctx) > >> > >> and then you can use that instead of EXT(OES_geometry_shader). The > >> distinction is pretty minor, of course. Exposing one or two enums > >> that you're supposed to error on is probably not the end of the world. > >> Either way is good with me though. > >> > > So, to check if we understand each other. Would it be OK to you, if I > replace: > > EXTRA_EXT_VIEWPORT_GS and EXTRA_EXT_GPU5_GS, both in > value_extra and > > the check_extra(...) switch, > > > > with: EXTRA_EXT_ES_GS in value_extra and according to your suggestion > > above in check_extra(...) > > > > And use EXTRA_EXT_ES_GS instead of EXT(OES_geometry_shader) in: > > extra_ARB_viewport_array_or_geometry_shader[] and similar to: > > extra_ARB_gpu_shader5_and_geometry_shader [] > > Yep, that's precisely my suggestion. I think we understand each other > perfectly. > That's good. I now have this on my github: https://github.com/MartaLo/mesa/tree/oes_geometry_shader_Ilia_enums > > I hope you're not seeing this as random busy-work -- if you are, please speak > up -- but I think it's best to minimize the number of the custom tokens to the > ones that we *actually* need. Otherwise there's too many ways to do the > same thing, and the getter logic doesn't need any more of those! > > > Cheers, > > -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v4] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 2:03 PM > To: Lofstedt, Marta > Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > > On Thu, Jan 21, 2016 at 7:57 AM, Lofstedt, Marta > wrote: > >> -Original Message- > >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of > >> Ilia Mirkin > >> Sent: Thursday, January 21, 2016 1:46 PM > >> To: Lofstedt, Marta > >> Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > >> Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > >> > >> On Thu, Jan 21, 2016 at 7:41 AM, Lofstedt, Marta > >> > >> wrote: > >> >> -Original Message- > >> >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of > >> >> Ilia Mirkin > >> >> Sent: Thursday, January 21, 2016 1:25 PM > >> >> To: Marta Lofstedt > >> >> Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > >> >> Subject: Re: [PATCH v4] mesa: enable enums for > OES_geometry_shader > >> >> > >> >> On Thu, Dec 10, 2015 at 11:11 AM, Marta Lofstedt > >> >> wrote: > >> >> > + case EXTRA_EXT_GPU5_GS: > >> >> > + api_check = GL_TRUE; > >> >> > + api_found = (ctx->Extensions.ARB_gpu_shader5 || > >> >> > + _mesa_has_OES_geometry_shader(ctx)); > >> >> > + break; > >> >> > + case EXTRA_EXT_VIEWPORT_GS: > >> >> > + api_check = GL_TRUE; > >> >> > + api_found = (ctx->Extensions.ARB_viewport_array || > >> >> > + _mesa_has_OES_geometry_shader(ctx)); > >> >> > + break; > >> >> > >> >> You can do these without the special tokens. Or did you mean && > here? > >> > > >> > I am pretty sure that our previous discussions on this topic ended > >> > up with > >> || to be preferable in these cases, but if you want && I will change. > >> > >> I actually don't want either. What I'm saying is that if you want ||, > >> then you don't have to add these EXTRA_EXT_GPU5_GS things -- using > >> the regular mechanism for composing tokens will get you ||. You only > >> need to use these special tokens if you want &&. > >> > > If by the "regular" mechanism mean: > > +static const int extra_ARB_viewport_array_or_geometry_shader[] = { > > + EXT(ARB_viewport_array), > > + EXT(OES_geometry_shader), > > + EXTRA_END > > +}; > > I had that in an earlier patch, where I interpreted your comment as a > rejection. > > Nope, that's precisely what I mean. The only distinction between the two is > the extra check for the ES context. If you want to preserve that, just create > a > single EXTRA_EXT_ES_GS token which just does > > api_found = _mesa_has_OES_geometry_shader(ctx) > > and then you can use that instead of EXT(OES_geometry_shader). The > distinction is pretty minor, of course. Exposing one or two enums that you're > supposed to error on is probably not the end of the world. > Either way is good with me though. > So, to check if we understand each other. Would it be OK to you, if I replace: EXTRA_EXT_VIEWPORT_GS and EXTRA_EXT_GPU5_GS, both in value_extra and the check_extra(...) switch, with: EXTRA_EXT_ES_GS in value_extra and according to your suggestion above in check_extra(...) And use EXTRA_EXT_ES_GS instead of EXT(OES_geometry_shader) in: extra_ARB_viewport_array_or_geometry_shader[] and similar to: extra_ARB_gpu_shader5_and_geometry_shader [] > > I doubt I flat-out rejected the quoted approach earlier, but I may have > commented about how it's not the perfect thing :) > > -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v4] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 1:46 PM > To: Lofstedt, Marta > Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > > On Thu, Jan 21, 2016 at 7:41 AM, Lofstedt, Marta > wrote: > >> -Original Message- > >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of > >> Ilia Mirkin > >> Sent: Thursday, January 21, 2016 1:25 PM > >> To: Marta Lofstedt > >> Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > >> Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > >> > >> On Thu, Dec 10, 2015 at 11:11 AM, Marta Lofstedt > >> wrote: > >> > + case EXTRA_EXT_GPU5_GS: > >> > + api_check = GL_TRUE; > >> > + api_found = (ctx->Extensions.ARB_gpu_shader5 || > >> > + _mesa_has_OES_geometry_shader(ctx)); > >> > + break; > >> > + case EXTRA_EXT_VIEWPORT_GS: > >> > + api_check = GL_TRUE; > >> > + api_found = (ctx->Extensions.ARB_viewport_array || > >> > + _mesa_has_OES_geometry_shader(ctx)); > >> > + break; > >> > >> You can do these without the special tokens. Or did you mean && here? > > > > I am pretty sure that our previous discussions on this topic ended up with > || to be preferable in these cases, but if you want && I will change. > > I actually don't want either. What I'm saying is that if you want ||, then you > don't have to add these EXTRA_EXT_GPU5_GS things -- using the regular > mechanism for composing tokens will get you ||. You only need to use these > special tokens if you want &&. > If by the "regular" mechanism mean: +static const int extra_ARB_viewport_array_or_geometry_shader[] = { + EXT(ARB_viewport_array), + EXT(OES_geometry_shader), + EXTRA_END +}; I had that in an earlier patch, where I interpreted your comment as a rejection. If you mean something else, please enlighten me. > > I haven't thought about which one is desirable though. (Or rather, I've > forgotten all thoughts I had on the matter.) > > -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v4] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Thursday, January 21, 2016 1:25 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > Subject: Re: [PATCH v4] mesa: enable enums for OES_geometry_shader > > On Thu, Dec 10, 2015 at 11:11 AM, Marta Lofstedt > wrote: > > + case EXTRA_EXT_GPU5_GS: > > + api_check = GL_TRUE; > > + api_found = (ctx->Extensions.ARB_gpu_shader5 || > > + _mesa_has_OES_geometry_shader(ctx)); > > + break; > > + case EXTRA_EXT_VIEWPORT_GS: > > + api_check = GL_TRUE; > > + api_found = (ctx->Extensions.ARB_viewport_array || > > + _mesa_has_OES_geometry_shader(ctx)); > > + break; > > You can do these without the special tokens. Or did you mean && here? I am pretty sure that our previous discussions on this topic ended up with || to be preferable in these cases, but if you want && I will change. /Marta ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] re-visit oes_geometry_shader patches
Due to my involvement in recent trigger happy merging incidents, I am now afraid to merged below patches that all has only one reviewer: http://patchwork.freedesktop.org/patch/66412/ http://patchwork.freedesktop.org/patch/66740/ http://patchwork.freedesktop.org/patch/67671/ http://patchwork.freedesktop.org/patch/67672/ The updated patches are available here: https://github.com/MartaLo/mesa/tree/oes_geometry_shader_resend I have tested piglit and Khronos CTS without regressions. If there are no objections to above patches I will merge them tomorrow afternoon, CET. BR, Marta --- Intel Sweden AB Registered Office: Knarrarnasgatan 15, 164 40 Kista, Stockholm, Sweden Registration Number: 556189-6027 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Tuesday, January 19, 2016 9:16 PM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH] mesa: Move sanity check of > BindVertexBuffer for OpenGL ES 3.1 > > On 01/08/2016 05:55 AM, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > Sanity check of BindVertexBuffer for OpenGL ES in > > _mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance. > > What was previously broken, and why does this fix it? I think it's also worth > mentioning that this is a revert of > 6c3de8996fbe9447e092cc75ccdd6f720fabaf4d. > I believe this is discussed in the Bug. > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426 > > Signed-off-by: Marta Lofstedt > > --- > > src/mesa/main/bufferobj.c | 2 +- > > src/mesa/main/varray.c| 8 +++- > > 2 files changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c > > index d7c5680..3ca1b3a 100644 > > --- a/src/mesa/main/bufferobj.c > > +++ b/src/mesa/main/bufferobj.c > > @@ -953,7 +953,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context > > *ctx, { > > struct gl_buffer_object *buf = *buf_handle; > > > > - if (!buf && (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx))) { > > + if (!buf && (ctx->API == API_OPENGL_CORE)) { > >_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", > caller); > >return false; > > } > > diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index > > c71e16a..a8d757b 100644 > > --- a/src/mesa/main/varray.c > > +++ b/src/mesa/main/varray.c > > @@ -1754,8 +1754,14 @@ vertex_array_vertex_buffer(struct gl_context > *ctx, > > * Otherwise, we fall back to the same compat profile behavior as > > other > > * object references (automatically gen it). > > */ > > - if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) > > + if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) { > > + return; > > + } > > + > > + if (!vbo && _mesa_is_gles31(ctx)) { > > + _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", > > + func); > > return; > > + } > > } else { > >/* The ARB_vertex_attrib_binding spec says: > > * > > > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] i965: Implement compute sampler state atom.
Reviewed-by: Marta Lofstedt > -Original Message- > From: Francisco Jerez [mailto:curroje...@riseup.net] > Sent: Monday, January 18, 2016 9:37 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Justen, Jordan L > Subject: [PATCH 2/2] i965: Implement compute sampler state atom. > > Fixes a number of GLES31 CTS failures and hangs on various hardware: > > ES31-CTS.texture_gather.plain-gather-depth-2d > ES31-CTS.texture_gather.plain-gather-depth-2darray > ES31-CTS.texture_gather.plain-gather-depth-cube > ES31-CTS.texture_gather.offset-gather-depth-2d > ES31-CTS.texture_gather.offset-gather-depth-2darray > ES31- > CTS.layout_binding.sampler2D_layout_binding_texture_ComputeShader > ES31- > CTS.layout_binding.sampler2DArray_layout_binding_texture_ComputeShad > er > ES31-CTS.explicit_uniform_location.uniform-loc-types-samplers > ES31-CTS.compute_shader.resources-texture > > Some of them were actually passing by luck on some generations even > though we weren't uploading sampler state tables explicitly for the compute > stage, most likely because they relied on the cached sampler state left from > previous rendering to be close enough. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92589 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93312 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93325 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93407 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93725 > Reported-by: Marta Lofstedt > --- > src/mesa/drivers/dri/i965/brw_context.h | 2 +- > src/mesa/drivers/dri/i965/brw_sampler_state.c | 20 > > src/mesa/drivers/dri/i965/brw_state.h | 1 + > src/mesa/drivers/dri/i965/brw_state_upload.c | 2 ++ > 4 files changed, 24 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_context.h > b/src/mesa/drivers/dri/i965/brw_context.h > index b80db00..2a29dfe 100644 > --- a/src/mesa/drivers/dri/i965/brw_context.h > +++ b/src/mesa/drivers/dri/i965/brw_context.h > @@ -1264,7 +1264,7 @@ struct brw_context > > int num_atoms[BRW_NUM_PIPELINES]; > const struct brw_tracked_state render_atoms[76]; > - const struct brw_tracked_state compute_atoms[10]; > + const struct brw_tracked_state compute_atoms[11]; > > /* If (INTEL_DEBUG & DEBUG_BATCH) */ > struct { > diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c > b/src/mesa/drivers/dri/i965/brw_sampler_state.c > index 24798a5..c20a028 100644 > --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c > +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c > @@ -693,3 +693,23 @@ const struct brw_tracked_state brw_tes_samplers = > { > }, > .emit = brw_upload_tes_samplers, > }; > + > +static void > +brw_upload_cs_samplers(struct brw_context *brw) { > + /* BRW_NEW_COMPUTE_PROGRAM */ > + struct gl_program *cs = (struct gl_program *) brw->compute_program; > + if (!cs) > + return; > + > + brw_upload_sampler_state_table(brw, cs, &brw->cs.base); } > + > +const struct brw_tracked_state brw_cs_samplers = { > + .dirty = { > + .mesa = _NEW_TEXTURE, > + .brw = BRW_NEW_BATCH | > + BRW_NEW_COMPUTE_PROGRAM, > + }, > + .emit = brw_upload_cs_samplers, > +}; > diff --git a/src/mesa/drivers/dri/i965/brw_state.h > b/src/mesa/drivers/dri/i965/brw_state.h > index 7d61b7c..f44ccd6 100644 > --- a/src/mesa/drivers/dri/i965/brw_state.h > +++ b/src/mesa/drivers/dri/i965/brw_state.h > @@ -75,6 +75,7 @@ extern const struct brw_tracked_state > brw_vs_samplers; extern const struct brw_tracked_state > brw_tcs_samplers; extern const struct brw_tracked_state > brw_tes_samplers; extern const struct brw_tracked_state > brw_gs_samplers; > +extern const struct brw_tracked_state brw_cs_samplers; > extern const struct brw_tracked_state brw_vs_ubo_surfaces; extern const > struct brw_tracked_state brw_vs_abo_surfaces; extern const struct > brw_tracked_state brw_vs_image_surfaces; diff --git > a/src/mesa/drivers/dri/i965/brw_state_upload.c > b/src/mesa/drivers/dri/i965/brw_state_upload.c > index 876e130..ee75ca8 100644 > --- a/src/mesa/drivers/dri/i965/brw_state_upload.c > +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c > @@ -282,6 +282,7 @@ static const struct brw_tracked_state > *gen7_compute_atoms[] = > &brw_cs_abo_surfaces, > &brw_texture_surfaces, > &brw_cs_work_groups_surface, > + &brw_cs_samplers, > &brw_cs_state, > }; > > @@ -396,6 +397,7 @@ static const struct brw_tracked_state > *gen8_compute_atoms[] = > &brw_cs_abo_surfaces, > &brw_texture_surfaces, > &brw_cs_work_groups_surface, > + &brw_cs_samplers, > &brw_cs_state, > }; > > -- > 2.7.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] i965: Trigger CS state reemission when new sampler state is uploaded.
Thanks Curro, Reviewed-by: Marta Lofstedt > -Original Message- > From: Francisco Jerez [mailto:curroje...@riseup.net] > Sent: Monday, January 18, 2016 9:37 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Justen, Jordan L > Subject: [PATCH 1/2] i965: Trigger CS state reemission when new sampler > state is uploaded. > > This reuses the NEW_SAMPLER_STATE_TABLE state bit (currently only used > on pre-Gen7 hardware) to signal that the sampler state tables have changed > in order to make sure that the GPGPU interface descriptor is updated. > --- > src/mesa/drivers/dri/i965/brw_sampler_state.c | 2 +- > src/mesa/drivers/dri/i965/gen7_cs_state.c | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c > b/src/mesa/drivers/dri/i965/brw_sampler_state.c > index d181468..24798a5 100644 > --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c > +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c > @@ -582,7 +582,7 @@ brw_upload_sampler_state_table(struct > brw_context *brw, >batch_offset_for_sampler_state += size_in_bytes; > } > > - if (brw->gen >= 7) { > + if (brw->gen >= 7 && stage_state->stage != MESA_SHADER_COMPUTE) { >/* Emit a 3DSTATE_SAMPLER_STATE_POINTERS_XS packet. */ >gen7_emit_sampler_state_pointers_xs(brw, stage_state); > } else { > diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c > b/src/mesa/drivers/dri/i965/gen7_cs_state.c > index a025bb9..6d6988c 100644 > --- a/src/mesa/drivers/dri/i965/gen7_cs_state.c > +++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c > @@ -196,6 +196,7 @@ const struct brw_tracked_state brw_cs_state = { >.brw = BRW_NEW_BATCH | > BRW_NEW_CS_PROG_DATA | > BRW_NEW_PUSH_CONSTANT_ALLOCATION | > + BRW_NEW_SAMPLER_STATE_TABLE | > BRW_NEW_SURFACES, > }, > .emit = brw_upload_cs_state > -- > 2.7.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] glsl: move uniform calculation to link_uniforms
This seem a bit suboptimal, since the same space is potentially searched multiple times. However, I believe that a better solution would be to use some other data structure which would probably require quite a big effort, so for now, this is: Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Tuesday, January 19, 2016 11:17 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH v2] glsl: move uniform calculation to > link_uniforms > > Patch moves uniform calculation to happen during link_uniforms, this is > possible with help of UniformRemapTable that has all the reserved locations. > > Location assignment for implicit locations is changed so that we utilize also > the 'holes' that explicit uniform location assignment might have left in > UniformRemapTable, this makes it possible to fit more uniforms as > previously we were lazy here and wasting space. > > Fixes following CTS tests: >ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max >ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max- > array > > v2: code cleanups (Matt), increment NumUniformRemapTable correctly > (Timothy), fix find_empty_block to work like intended (sigh) and > add some more comments. > > Signed-off-by: Tapani Pälli > --- > src/glsl/link_uniforms.cpp | 87 > -- > src/glsl/linker.cpp| 19 -- > src/glsl/linker.h | 3 +- > 3 files changed, 85 insertions(+), 24 deletions(-) > > diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index > 33b2d4c..76ee70d 100644 > --- a/src/glsl/link_uniforms.cpp > +++ b/src/glsl/link_uniforms.cpp > @@ -1057,9 +1057,40 @@ assign_hidden_uniform_slot_id(const char > *name, unsigned hidden_id, > uniform_size->map->put(hidden_uniform_start + hidden_id, name); } > > +/** > + * Search UniformRemapTable for empty block big enough to hold given > uniform. > + * TODO Optimize this algorithm later if it turns out to be a major > bottleneck. > + */ > +static int > +find_empty_block(struct gl_shader_program *prog, > + struct gl_uniform_storage *uniform) { > + const unsigned entries = MAX2(1, uniform->array_elements); > + for (unsigned i = 0, j; i < prog->NumUniformRemapTable; i++) { > + /* We found empty space in UniformRemapTable. */ > + if (prog->UniformRemapTable[i] == NULL) { > + for (j = i; j < entries && j < prog->NumUniformRemapTable; j++) { > +if (prog->UniformRemapTable[j] != NULL) { > + /* Entries do not fit in this space, continue searching > +* after this location. > +*/ > + i = j + 1; > + break; > +} > + } > + /* Entries fit, we can return this location. */ > + if (i != j + 1) { > +return i; > + } > + } > + } > + return -1; > +} > + > void > link_assign_uniform_locations(struct gl_shader_program *prog, > - unsigned int boolean_true) > + unsigned int boolean_true, > + unsigned int max_locations) > { > ralloc_free(prog->UniformStorage); > prog->UniformStorage = NULL; > @@ -1150,6 +1181,20 @@ link_assign_uniform_locations(struct > gl_shader_program *prog, > > parcel_out_uniform_storage parcel(prog->UniformHash, uniforms, data); > > + unsigned total_entries = 0; > + > + /* Calculate amount of 'holes' left after explicit locations were > +* reserved from UniformRemapTable. > +*/ > + unsigned empty_locs = 0; > + for (unsigned i = 0; i < prog->NumUniformRemapTable; i++) > + if (prog->UniformRemapTable[i] == NULL) > + empty_locs++; > + > + /* Add all the reserved explicit locations - empty locations in remap > table. > */ > + if (prog->NumUniformRemapTable) > + total_entries = (prog->NumUniformRemapTable - 1) - empty_locs; > + > for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { >if (prog->_LinkedShaders[i] == NULL) >continue; > @@ -1213,21 +1258,43 @@ link_assign_uniform_locations(struct > gl_shader_program *prog, >/* how many new entries for this uniform? */ >const unsigned entries = MAX2(1, uniforms[i].array_elements); > > - /* resize remap table to fit new entries */ > - prog->UniformRemapTable = > - reralloc(prog, > - prog->UniformRemapTable, > - gl_uniform_storage *, > - prog->NumUniformRemapTable + entries); > + /* Find UniformRemapTable for empty blocks where we can fit this > uniform. */ > + int chosen_location = -1; > + > + if (empty_locs) > + chosen_location = find_empty_block(prog, &uniforms[i]); > + > + if (chosen_location != -1) { > + empty_locs -= entries; > +
Re: [Mesa-dev] [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1
Note to myself the new tests need to go before the old one. > -Original Message- > From: Marta Lofstedt [mailto:marta.lofst...@linux.intel.com] > Sent: Friday, January 8, 2016 2:56 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta > Subject: [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL > ES 3.1 > > From: Marta Lofstedt > > Sanity check of BindVertexBuffer for OpenGL ES in > _mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426 > Signed-off-by: Marta Lofstedt > --- > src/mesa/main/bufferobj.c | 2 +- > src/mesa/main/varray.c| 8 +++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index > d7c5680..3ca1b3a 100644 > --- a/src/mesa/main/bufferobj.c > +++ b/src/mesa/main/bufferobj.c > @@ -953,7 +953,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context > *ctx, { > struct gl_buffer_object *buf = *buf_handle; > > - if (!buf && (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx))) { > + if (!buf && (ctx->API == API_OPENGL_CORE)) { >_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", > caller); >return false; > } > diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index > c71e16a..a8d757b 100644 > --- a/src/mesa/main/varray.c > +++ b/src/mesa/main/varray.c > @@ -1754,8 +1754,14 @@ vertex_array_vertex_buffer(struct gl_context > *ctx, > * Otherwise, we fall back to the same compat profile behavior as other > * object references (automatically gen it). > */ > - if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) > + if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) { > + return; > + } > + > + if (!vbo && _mesa_is_gles31(ctx)) { > + _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", > + func); > return; > + } > } else { >/* The ARB_vertex_attrib_binding spec says: > * > -- > 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH V3] glapi: add GL_OES_geometry_shader extension
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Tuesday, January 12, 2016 7:09 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Romanick, Ian D; Lofstedt, Marta > Subject: Re: [PATCH V3] glapi: add GL_OES_geometry_shader extension > > On Tue, Jan 12, 2016 at 9:13 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Add xml definitions for the GL_OES_geometry_shader extension and > > expose the extension for OpenGL ES 3.1. > > > > V3: Added dependency to OES_shader_io_blocks and updated to correct > > Khronos extension number. > > May I ask why you did this? OES_shader_io_blocks is a purely shader > compiler/linker feature, I expect it will be enabled whenever GLES 3.1 is > enabled, no? Why would it be tied to geometry shaders? Sure, geometry > shaders require it to work, but just because you have OES_shader_io_blocks > doesn't necessarily mean you also have geometry shaders... > My intension was to address the co-dependency between oes_geometry_shader and oes_shader_io_block. But as always, you are right Ilia. The dependency issue need to be fixed in the driver. So, please disregard this V3, I will push the V2 with the changes suggested by Ilia in the comments. FYI here are quotes from the oes_geometry_shader specification: " OES_shader_io_blocks or EXT_shader_io_blocks is required." " This extension relies on the OES_shader_io_blocks extension to provide the required functionality for declaring input and output blocks and interfacing between shaders." " If the OES_geometry_shader extension is enabled, the OES_shader_io_blocks extension is also implicitly enabled. > In practical terms, there's a non-trivial chance that A4xx will get > tessellation > before geometry shaders, which would also require OES_shader_io_blocks > to be exposed. Yes, but for desktop we already have the "shader_io_block" functionality. So, the dependency is a GLES issue, and tessellation is not yet exposed under GLES. > > -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: add packed varyings for outputs with single stage program
Reviewed-by: Marta Lofstedt > -Original Message- > From: Palli, Tapani > Sent: Tuesday, January 12, 2016 10:03 AM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Palli, Tapani > Subject: [PATCH] glsl: add packed varyings for outputs with single stage > program > > Commit 8926dc8 added a check where we add packed varyings of output > stage only when we have multiple stages, however duplicates are already > handled by changes in commit 0508d950 and we want to add outputs also in > case where we have only one stage. > > Fixes regression caused by 8926dc8 for following test: >ES31-CTS.program_interface_query.separate-programs-vertex > > Signed-off-by: Tapani Pälli > --- > src/glsl/linker.cpp | 9 ++--- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index eb1bdc0..e8c0b98 > 100644 > --- a/src/glsl/linker.cpp > +++ b/src/glsl/linker.cpp > @@ -3753,13 +3753,8 @@ build_program_resource_list(struct > gl_shader_program *shProg) >if (!add_packed_varyings(shProg, input_stage, GL_PROGRAM_INPUT)) > return; > > - /* Only when dealing with multiple stages, otherwise we would have > - * duplicate gl_shader_variable entries. > - */ > - if (input_stage != output_stage) { > - if (!add_packed_varyings(shProg, output_stage, > GL_PROGRAM_OUTPUT)) > -return; > - } > + if (!add_packed_varyings(shProg, output_stage, > GL_PROGRAM_OUTPUT)) > + return; > } > > if (!add_fragdata_arrays(shProg)) > -- > 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 2/6] glapi: add GL_OES_geometry_shader extension
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Monday, November 30, 2015 8:38 PM > To: Ilia Mirkin; Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 2/6] glapi: add > GL_OES_geometry_shader extension > > On 11/27/2015 09:58 AM, Ilia Mirkin wrote: > > On Fri, Nov 27, 2015 at 9:31 AM, Marta Lofstedt > > wrote: > >> From: Marta Lofstedt > >> > >> Add xml definitions for the GL_OES_geometry_shader extension and > >> expose the extension for OpenGL ES 3.1. > >> > >> Signed-off-by: Marta Lofstedt > >> --- > >> src/mapi/glapi/gen/apiexec.py | 2 +- > >> src/mapi/glapi/gen/es_EXT.xml | 43 > + > >> src/mesa/main/extensions_table.h| 1 + > >> src/mesa/main/mtypes.h | 1 + > >> src/mesa/main/tests/dispatch_sanity.cpp | 3 +++ > >> 5 files changed, 49 insertions(+), 1 deletion(-) > >> > >> diff --git a/src/mapi/glapi/gen/apiexec.py > >> b/src/mapi/glapi/gen/apiexec.py index 58ec08b..fa046fa 100644 > >> --- a/src/mapi/glapi/gen/apiexec.py > >> +++ b/src/mapi/glapi/gen/apiexec.py > >> @@ -72,7 +72,7 @@ functions = { > >> > >> # OpenGL 3.2 / GL_ARB_geometry_shader4. Mesa does not support > >> # GL_ARB_geometry_shader4, so OpenGL 3.2 is required. > >> -"FramebufferTexture": exec_info(core=32), > >> +"FramebufferTexture": exec_info(core=32, es2=31), > >> > >> # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this > >> # extension with core profile. > >> diff --git a/src/mapi/glapi/gen/es_EXT.xml > >> b/src/mapi/glapi/gen/es_EXT.xml index 577d825..f6c49c2 100644 > >> --- a/src/mapi/glapi/gen/es_EXT.xml > >> +++ b/src/mapi/glapi/gen/es_EXT.xml > >> @@ -940,4 +940,47 @@ > >> > >> > >> > >> + > >> + >> +name="GL_OES_geometry_shader" number="175"> > >> + value="0x8DD9"/> > >> + value="0x0004"/> > >> + value="0x8916"/> > >> + value="0x8917"/> > >> + value="0x8918"/> > >> + value="0x887F"/> > >> + value="0x825E"/> > >> + value="0x8A2C"/> > >> + name="MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES" > value="0x8A32"/> > >> + value="0x9123"/> > >> + value="0x9124"/> > >> + value="0x8DE0"/> > >> + name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES" > value="0x8DE1"/> > >> + value="0x8E5A"/> > >> + value="0x8C29"/> > >> + value="0x92CF"/> > >> + value="0x92D5"/> > >> + value="0x90CD"/> > >> + value="0x90D7"/> > >> + value="0x8E4D"/> > >> + value="0x8E4E"/> > >> + value="0x8260"/> > >> + value="0x8C87"/> > >> + >> value="0xA"/> > >> + value="0xB"/> > >> + value="0xC"/> > >> + value="0xD"/> > >> + value="0x9312"/> > >> + value="0x9317"/> > >> + value="0x8DA8"/> > >> + value="0x8DA7"/> > >> + value="0x9309"/> > >> + > >> + alias="FramebufferTexture" es2="3.1"> > >> + > >> + > >> + > >> + > >> + > >> + > >> > >> diff --git a/src/mesa/main/extensions_table.h > >> b/src/mesa/main/extensions_table.h > >> index 051d69a..d3cbb25 100644 > >> --- a/src/mesa/main/extensions_table.h > >> +++ b/src/mesa/main/extensions_table.h > >> @@ -307,6 +307,7 @@ EXT(OES_element_index_uint , > dummy_true > >> EXT(OES_fbo_render_mipmap , dummy_true > >>, x , > x , ES1, ES2, 2005) > >> EXT(OES_fixed_point , dummy_true > >>, x , x , > ES1, x , 2002) > >> EXT(OES_framebuffer_object , dummy_true > >>, x , x > , ES1, x , 2005) > >> +EXT(OES_geometry_shader , dummy_true > >>, x , > x , x , 31, 2015) > > > > This should surely depend on OES_geometry_shader, not dummy_true... > Actually, I believe it should be a dependency to OES_shader_io_blocks. I will send up a V3. > I was going to make the same comment. I was also going to pose the > question: do we expect that every Mesa implementer of GLES3.1 will also > support GL_OES_geometry_shader out-of-the-box? If that's the case, then > we can use dummy_true and gl_extensions::OES_geometry_shader (below) > should be removed. > > > Not a huge fan of adding the extra entry to gl_extensions, but I don't > > see a great way around it. It'll all be hidden behind > > _mesa_has_geometry_shaders anyways, so it shouldn't be too bad. > > > >> EXT(OES_get_program_binary , dummy_true > >>, x , > x , x , ES2, 2008) > >> EXT(OES_mapbuffer , dummy_true > >>, x , x , > ES1, ES2, 2005) > >> EXT(OES_packed_depth_stencil, dummy_true > >>, x , > x , ES1, ES2, 2007) > >> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index >
Re: [Mesa-dev] [PATCH] mesa: do not validate io of non-compute and compute stage
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Monday, January 4, 2016 8:56 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] mesa: do not validate io of non-compute and > compute stage > > Fixes regression on SSO tests that have both non-compute and compute > programs in a program pipeline. > > Signed-off-by: Tapani Pälli > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93532 > --- > src/mesa/main/shader_query.cpp | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/src/mesa/main/shader_query.cpp > b/src/mesa/main/shader_query.cpp index e526119..570acfa 100644 > --- a/src/mesa/main/shader_query.cpp > +++ b/src/mesa/main/shader_query.cpp > @@ -1496,6 +1496,13 @@ _mesa_validate_pipeline_io(struct > gl_pipeline_object *pipeline) > > for (idx = prev + 1; idx < ARRAY_SIZE(pipeline->CurrentProgram); idx++) { >if (shProg[idx]) { > + /* Pipeline might include both non-compute and a compute program, > do > + * not attempt to validate varyings between non-compute and > compute > + * stage. > + */ > + if (shProg[idx]->_LinkedShaders[idx]->Stage == > MESA_SHADER_COMPUTE) > +break; > + > if (!validate_io(shProg[prev]->_LinkedShaders[prev], >shProg[idx]->_LinkedShaders[idx], >shProg[prev]->IsES || shProg[idx]->IsES)) > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: add image_format check in cross_validate_globals()
Thanks Samuel, I confirm that your patch fixes the testcase for both BDW and SKL. /Marta From: Samuel Iglesias Gonsálvez [sigles...@igalia.com] Sent: Tuesday, January 05, 2016 2:32 PM To: mesa-dev@lists.freedesktop.org Cc: Lofstedt, Marta; Samuel Iglesias Gonsálvez Subject: [PATCH] glsl: add image_format check in cross_validate_globals() Fixes CTS test: ES31-CTS.shader_image_load_store.negative-linkErrors Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93410 Signed-off-by: Samuel Iglesias Gonsálvez --- src/glsl/linker.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index a6e81b4..cf4d68d 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1133,6 +1133,12 @@ cross_validate_globals(struct gl_shader_program *prog, mode_string(var), var->name); return; } +if (existing->data.image_format != var->data.image_format) { + linker_error(prog, "declarations for %s `%s` have " +"mismatching image format qualifiers\n", +mode_string(var), var->name); + return; +} } else variables.add_variable(var); } -- 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/gen8: Always use BRW_REGISTER_TYPE_UW for MUL on GEN8+
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Tuesday, December 29, 2015 5:39 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Romanick, Ian D > Subject: Re: [Mesa-dev] [PATCH] i965/gen8: Always use > BRW_REGISTER_TYPE_UW for MUL on GEN8+ > > On Tue, Dec 29, 2015 at 10:15 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > The imulExtended test of the shader bitfield tests of the OpenGL ES > > 3.1 CTS, fail on gen8+, when BRW_REGISTER_TYPE_W is used for > > SHADER_OPECODE_MULH. > > > > See: > > https://bugs.freedesktop.org/show_bug.cgi?id=92595 > > > > Signed-off-by: Marta Lofstedt > > You might also consider removing the type_is_signed helper -- this was the > only use. While I'm no i965 expert, I suspect using it is almost always going > to > be a bug, since the type here is maintained very differently than in the glsl > ir. > Thanks for the idea Ilia. The obsolete function is now gone! BR, Marta > Cheers, > > -ilia > > > --- > > src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp > > b/src/mesa/drivers/dri/i965/brw_fs.cpp > > index 6ac2f85..511979d 100644 > > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp > > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp > > @@ -3436,8 +3436,7 @@ fs_visitor::lower_integer_multiplication() > > */ > > assert(mul->src[1].type == BRW_REGISTER_TYPE_D || > > mul->src[1].type == BRW_REGISTER_TYPE_UD); > > -mul->src[1].type = (type_is_signed(mul->src[1].type) ? > > -BRW_REGISTER_TYPE_W : > > BRW_REGISTER_TYPE_UW); > > +mul->src[1].type = BRW_REGISTER_TYPE_UW; > > mul->src[1].stride *= 2; > > > > } else if (devinfo->gen == 7 && !devinfo->is_haswell && > > -- > > 2.5.0 > > > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/3] i965/wm: use proper API buffer size for the surfaces.
Reviewed-by: Marta Lofstedt > -Original Message- > From: Samuel Iglesias Gonsálvez [mailto:sigles...@igalia.com] > Sent: Tuesday, December 22, 2015 8:40 AM > To: Iago Toral Quiroga; mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Palli, Tapani > Subject: Re: [PATCH 3/3] i965/wm: use proper API buffer size for the > surfaces. > > This patch is still unreviewed. > > Sam > > On Tue, 2015-12-15 at 12:51 +0100, Iago Toral Quiroga wrote: > > From: Samuel Iglesias Gonsálvez > > > > Commit 5bb5eeea fix a bug indicating that the surfaces should have the > > API buffer size. Hovewer it picked the wrong value. > > > > This patch adds a new variable, which takes into account > > glBindBufferRange() values. Fixes the following regressions: > > > > ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength- > cs- > > std430-vec-bindrangeOffset > > ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength- > cs- > > std430-vec-bindrangeSize > > > > Signed-off-by: Samuel Iglesias Gonsálvez > > --- > > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 12 > > src/mesa/drivers/dri/i965/intel_buffer_objects.c | 1 + > > src/mesa/main/bufferobj.c| 4 +++- > > src/mesa/main/mtypes.h | 1 + > > 4 files changed, 13 insertions(+), 5 deletions(-) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > index c4ebbf3..9072860 100644 > > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > @@ -949,12 +949,14 @@ brw_upload_ubo_surfaces(struct brw_context > *brw, > > } else { > > struct intel_buffer_object *intel_bo = > > intel_buffer_object(binding->BufferObject); > > + GLsizeiptrARB size = MIN2(binding->BufferObject- > > >BufferRangeSize, > > + binding->BufferObject->Size - > > binding->Offset); > > drm_intel_bo *bo = > > intel_bufferobj_buffer(brw, intel_bo, > > binding->Offset, > > - binding->BufferObject->Size - > > binding->Offset); > > + size); > > brw_create_constant_surface(brw, bo, binding->Offset, > > - binding->BufferObject->Size - > > binding->Offset, > > + size, > > &ubo_surf_offsets[i]); > > } > > } > > @@ -971,12 +973,14 @@ brw_upload_ubo_surfaces(struct brw_context > *brw, > > } else { > > struct intel_buffer_object *intel_bo = > > intel_buffer_object(binding->BufferObject); > > + GLsizeiptrARB size = MIN2(binding->BufferObject- > > >BufferRangeSize, > > + binding->BufferObject->Size - > > binding->Offset); > > drm_intel_bo *bo = > > intel_bufferobj_buffer(brw, intel_bo, > > binding->Offset, > > - binding->BufferObject->Size - > > binding->Offset); > > + size); > > brw_create_buffer_surface(brw, bo, binding->Offset, > > - binding->BufferObject->Size - > > binding->Offset, > > + size, > > &ssbo_surf_offsets[i]); > > } > > } > > diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c > > b/src/mesa/drivers/dri/i965/intel_buffer_objects.c > > index 7a5b3fc..b26c939 100644 > > --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c > > +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c > > @@ -198,6 +198,7 @@ brw_buffer_data(struct gl_context *ctx, > > (void) target; > > > > intel_obj->Base.Size = size; > > + intel_obj->Base.BufferRangeSize = size; > > intel_obj->Base.Usage = usage; > > intel_obj->Base.StorageFlags = storageFlags; > > > > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c > > index e0639c8..7f42673 100644 > > --- a/src/mesa/main/bufferobj.c > > +++ b/src/mesa/main/bufferobj.c > > @@ -43,7 +43,7 @@ &g
Re: [Mesa-dev] [PATCH] mesa: update gl_HelperInvocation support status in docs
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Wednesday, December 16, 2015 7:42 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] mesa: update gl_HelperInvocation support > status in docs > > Was enabled for i965 and nvc0 by following commits: > > c875e3cdd21811ad6669160d59fa39a4526ef872 > 39f51ec96f00f601b9c4d4e321dacb3af9dc866f > > Signed-off-by: Tapani Pälli > --- > docs/GL3.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/GL3.txt b/docs/GL3.txt index 5ec3613..5444a08 100644 > --- a/docs/GL3.txt > +++ b/docs/GL3.txt > @@ -233,7 +233,7 @@ GLES3.1, GLSL ES 3.1 >glMemoryBarrierByRegion DONE >glGetTexLevelParameter[fi]v - needs updates DONE >glGetBooleani_v - restrict to GLES enums > - gl_HelperInvocation support > + gl_HelperInvocation support DONE (i965, nvc0) > > GLES3.2, GLSL ES 3.2 >GL_EXT_color_buffer_floatDONE (all drivers) > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] i965/gen8/cs: Gen8 requires 64 byte alignment for push constant data
Reviewed-by: Marta Lofstedt > -Original Message- > From: Iago Toral Quiroga [mailto:ito...@igalia.com] > Sent: Wednesday, December 16, 2015 10:02 AM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Palli, Tapani; Justen, Jordan L; Iago Toral Quiroga > Subject: [PATCH v2] i965/gen8/cs: Gen8 requires 64 byte alignment for push > constant data > > The BDW PRM Vol2a: Command Reference: Instructions, section > MEDIA_CURBE_LOAD, says that 'CURBE Total Data Length' and 'CURBE Data > Start Address' are 64-byte aligned. This is different from previous gens, that > were 32-byte aligned. > > v2 (Jordan): > - CURBE Data Start Address is also 64-byte aligned. > - The call to brw_state_batch should also use 64-byte alignment. > - Improve PRM reference. > > Fixes the following SSBO CTS tests on BDW: > ES31-CTS.shader_storage_buffer_object.basic-atomic-case1-cs > ES31-CTS.shader_storage_buffer_object.basic-operations-case1-cs > ES31-CTS.shader_storage_buffer_object.basic-operations-case2-cs > ES31-CTS.shader_storage_buffer_object.basic-stdLayout_UBO_SSBO-case2- > cs > ES31-CTS.shader_storage_buffer_object.advanced-write-fragment-cs > ES31-CTS.shader_storage_buffer_object.advanced-indirectAddressing- > case2-cs > ES31-CTS.shader_storage_buffer_object.advanced-matrix-cs > > And many other CS CTS tests as reported by Marta Lofstedt. > --- > src/mesa/drivers/dri/i965/gen7_cs_state.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c > b/src/mesa/drivers/dri/i965/gen7_cs_state.c > index 1fde69c..df0f301 100644 > --- a/src/mesa/drivers/dri/i965/gen7_cs_state.c > +++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c > @@ -68,7 +68,7 @@ brw_upload_cs_state(struct brw_context *brw) > > uint32_t *bind = (uint32_t*) brw_state_batch(brw, > AUB_TRACE_BINDING_TABLE, > > prog_data->binding_table.size_bytes, > -32, > &stage_state->bind_bo_offset); > +64, > + &stage_state->bind_bo_offset); > > unsigned local_id_dwords = 0; > > @@ -77,7 +77,8 @@ brw_upload_cs_state(struct brw_context *brw) > > unsigned push_constant_data_size = >(prog_data->nr_params + local_id_dwords) * sizeof(gl_constant_value); > - unsigned reg_aligned_constant_size = ALIGN(push_constant_data_size, > 32); > + unsigned reg_aligned_constant_size = > + ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64); > unsigned push_constant_regs = reg_aligned_constant_size / 32; > unsigned threads = get_cs_thread_count(cs_prog_data); > > @@ -138,11 +139,13 @@ brw_upload_cs_state(struct brw_context *brw) > ADVANCE_BATCH(); > > if (reg_aligned_constant_size > 0) { > + const unsigned aligned_push_const_offset = > + ALIGN(stage_state->push_const_offset, brw->gen < 8 ? 32 : 64); >BEGIN_BATCH(4); >OUT_BATCH(MEDIA_CURBE_LOAD << 16 | (4 - 2)); >OUT_BATCH(0); >OUT_BATCH(reg_aligned_constant_size * threads); > - OUT_BATCH(stage_state->push_const_offset); > + OUT_BATCH(aligned_push_const_offset); >ADVANCE_BATCH(); > } > > @@ -241,7 +244,8 @@ brw_upload_cs_push_constants(struct brw_context > *brw, > >const unsigned push_constant_data_size = > (local_id_dwords + prog_data->nr_params) * > sizeof(gl_constant_value); > - const unsigned reg_aligned_constant_size = > ALIGN(push_constant_data_size, 32); > + const unsigned reg_aligned_constant_size = > + ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64); >const unsigned param_aligned_count = > reg_aligned_constant_size / sizeof(*param); > > -- > 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/5] i965/screen: Allow OpenGLES 3.1 for gen8+
Reviewed-by: Marta Lofstedt > -Original Message- > From: Justen, Jordan L > Sent: Wednesday, December 16, 2015 1:08 AM > To: mesa-dev@lists.freedesktop.org > Cc: Justen, Jordan L; Ian Romanick; Lofstedt, Marta > Subject: [PATCH 5/5] i965/screen: Allow OpenGLES 3.1 for gen8+ > > OpenGLES 3.1 cannot be enabled for gen 7 (Ivy Bridge, Haswell) since they > are still missing ARB_stencil_texturing. > > Signed-off-by: Jordan Justen > Cc: Ian Romanick > Cc: Marta Lofstedt > --- > src/mesa/drivers/dri/i965/intel_screen.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/intel_screen.c > b/src/mesa/drivers/dri/i965/intel_screen.c > index 825a7c1..13498f4 100644 > --- a/src/mesa/drivers/dri/i965/intel_screen.c > +++ b/src/mesa/drivers/dri/i965/intel_screen.c > @@ -1338,6 +1338,11 @@ set_max_gl_versions(struct intel_screen *screen) > switch (screen->devinfo->gen) { > case 9: > case 8: > + psp->max_gl_core_version = 33; > + psp->max_gl_compat_version = 30; > + psp->max_gl_es1_version = 11; > + psp->max_gl_es2_version = 31; > + break; > case 7: > case 6: >psp->max_gl_core_version = 33; > -- > 2.6.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/5] i965: Enable compute shaders in more cases for OpenGLES 3.1
Reviewed-by: Marta Lofstedt > -Original Message- > From: Justen, Jordan L > Sent: Wednesday, December 16, 2015 1:08 AM > To: mesa-dev@lists.freedesktop.org > Cc: Justen, Jordan L; Lofstedt, Marta > Subject: [PATCH 4/5] i965: Enable compute shaders in more cases for > OpenGLES 3.1 > > Previously we were checking the desktop OpenGL ARB_compute_shader > requirements, but for OpenGLES 3.1, the requirements are lower. > > Signed-off-by: Jordan Justen > Cc: Marta Lofstedt > --- > src/mesa/drivers/dri/i965/brw_context.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_context.c > b/src/mesa/drivers/dri/i965/brw_context.c > index 0abe601..5105625 100644 > --- a/src/mesa/drivers/dri/i965/brw_context.c > +++ b/src/mesa/drivers/dri/i965/brw_context.c > @@ -377,7 +377,10 @@ brw_initialize_context_constants(struct > brw_context *brw) >[MESA_SHADER_GEOMETRY] = brw->gen >= 6, >[MESA_SHADER_FRAGMENT] = true, >[MESA_SHADER_COMPUTE] = > - (ctx->Const.MaxComputeWorkGroupSize[0] >= 1024) || > + (ctx->API == API_OPENGL_CORE && > + ctx->Const.MaxComputeWorkGroupSize[0] >= 1024) || > + (ctx->API == API_OPENGLES2 && > + ctx->Const.MaxComputeWorkGroupSize[0] >= 128) || > _mesa_extension_override_enables.ARB_compute_shader, > }; > > -- > 2.6.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] main: Allow compute shaders to be compiled with OpenGLES 3.1
Reviewed-by: Marta Lofstedt > -Original Message- > From: Justen, Jordan L > Sent: Wednesday, December 16, 2015 1:08 AM > To: mesa-dev@lists.freedesktop.org > Cc: Justen, Jordan L; Lofstedt, Marta > Subject: [PATCH 2/5] main: Allow compute shaders to be compiled with > OpenGLES 3.1 > > Previous OpenGLES 3.1 testing had been done when ARB_compute_shader > was overridden to enabled. > > Signed-off-by: Jordan Justen > Cc: Marta Lofstedt > --- > src/mesa/main/shaderapi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index > a732d83..e258ad9 100644 > --- a/src/mesa/main/shaderapi.c > +++ b/src/mesa/main/shaderapi.c > @@ -208,7 +208,7 @@ _mesa_validate_shader_target(const struct > gl_context *ctx, GLenum type) > case GL_TESS_EVALUATION_SHADER: >return ctx == NULL || _mesa_has_tessellation(ctx); > case GL_COMPUTE_SHADER: > - return ctx == NULL || ctx->Extensions.ARB_compute_shader; > + return ctx == NULL || _mesa_has_compute_shaders(ctx); > default: >return false; > } > -- > 2.6.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/gen8/cs: fix constant push buffer
Thanks Iago! This patch does not only fix the ssbo test mentioned below, but a lot of other GLES 3.1 CTS tests. > -Original Message- > From: Iago Toral Quiroga [mailto:ito...@igalia.com] > Sent: Tuesday, December 15, 2015 12:55 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Justen, Jordan L; Palli, Tapani; Iago Toral Quiroga > Subject: [PATCH] i965/gen8/cs: fix constant push buffer > > Page 502 of the Command Reference Broadwell PRM says that CURBE Total > Data Length must be 64-bit aligned. > > Fixes the following CTS tests: > ES31-CTS.shader_storage_buffer_object.basic-atomic-case1-cs > ES31-CTS.shader_storage_buffer_object.basic-operations-case1-cs > ES31-CTS.shader_storage_buffer_object.basic-operations-case2-cs > ES31-CTS.shader_storage_buffer_object.basic-stdLayout_UBO_SSBO-case2- > cs > ES31-CTS.shader_storage_buffer_object.advanced-write-fragment-cs > ES31-CTS.shader_storage_buffer_object.advanced-indirectAddressing- > case2-cs > ES31-CTS.shader_storage_buffer_object.advanced-matrix-cs > --- > src/mesa/drivers/dri/i965/gen7_cs_state.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c > b/src/mesa/drivers/dri/i965/gen7_cs_state.c > index 1fde69c..dbd1967 100644 > --- a/src/mesa/drivers/dri/i965/gen7_cs_state.c > +++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c > @@ -77,7 +77,8 @@ brw_upload_cs_state(struct brw_context *brw) > > unsigned push_constant_data_size = >(prog_data->nr_params + local_id_dwords) * sizeof(gl_constant_value); > - unsigned reg_aligned_constant_size = ALIGN(push_constant_data_size, > 32); > + unsigned reg_aligned_constant_size = > + ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64); > unsigned push_constant_regs = reg_aligned_constant_size / 32; > unsigned threads = get_cs_thread_count(cs_prog_data); > > @@ -241,7 +242,8 @@ brw_upload_cs_push_constants(struct brw_context > *brw, > >const unsigned push_constant_data_size = > (local_id_dwords + prog_data->nr_params) * > sizeof(gl_constant_value); > - const unsigned reg_aligned_constant_size = > ALIGN(push_constant_data_size, 32); > + const unsigned reg_aligned_constant_size = > + ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64); >const unsigned param_aligned_count = > reg_aligned_constant_size / sizeof(*param); > > -- > 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: Relax requirement on Centroid matching between shader stages
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Friday, November 6, 2015 6:47 PM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH] glsl: Relax requirement on Centroid > matching between shader stages > > On 11/04/2015 01:04 AM, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > In OpenGL 4.4, section 4.5, the requirement for interpolation > > qualifiers to match over shader stages was removed. > > In OpenGL ES 3.1, section 9.2.1 there is a table showing that centroid > > does not have to match between shader stages. > > I haven't checked this yet... does either spec provide guidance as to what > happens when only the vertex shader stage specifies centroid? Is the > interpolation centroid or not? GLSL ES 3.1 and GLSL 4.4 section 4.3.4: " When auxiliary qualifiers do not match, those provided in the fragment shader supersede those provided in previous stages. If any such qualifiers are completely missing in the fragment shaders, then the default is used, rather than any qualifiers that may have been declared in previous stages" > > ...and are we doing the right thing? :) > That is a deep question, Ian... I guess I could add a complicated test enforcing matching for versions prior to GLSL ES 3.1 and GLSL 4.4. But since the discussion in bug 92743 suggests that the matching requirement is fuzzy in the prior versions of the standars, I see no point in messing things up. > > > Also see bug 92743 for more discussions. > > Please note this, after your s-o-b, as > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92743 > > I think this is also a candidate for stable: > > Cc: mesa-sta...@lists.freedesktop.org > > > Signed-off-by: Marta Lofstedt > > --- > > src/glsl/link_varyings.cpp | 14 -- > > 1 file changed, 14 deletions(-) > > > > diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp > > index 7e77a67..d0edc71 100644 > > --- a/src/glsl/link_varyings.cpp > > +++ b/src/glsl/link_varyings.cpp > > @@ -96,20 +96,6 @@ cross_validate_types_and_qualifiers(struct > gl_shader_program *prog, > >} > > } > > > > - /* Check that all of the qualifiers match between stages. > > -*/ > > - if (input->data.centroid != output->data.centroid) { > > - linker_error(prog, > > - "%s shader output `%s' %s centroid qualifier, " > > - "but %s shader input %s centroid qualifier\n", > > - _mesa_shader_stage_to_string(producer_stage), > > - output->name, > > - (output->data.centroid) ? "has" : "lacks", > > - _mesa_shader_stage_to_string(consumer_stage), > > - (input->data.centroid) ? "has" : "lacks"); > > - return; > > - } > > - > > if (input->data.sample != output->data.sample) { > >linker_error(prog, > > "%s shader output `%s' %s sample qualifier, " > > > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v3] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Tuesday, December 1, 2015 5:34 PM > To: Lofstedt, Marta > Cc: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [PATCH v3] mesa: enable enums for OES_geometry_shader > > On Tue, Dec 1, 2015 at 11:24 AM, Lofstedt, Marta > wrote: > >> > +static const int extra_ARB_viewport_array_or_geometry_shader[] = { > >> > + EXT(ARB_viewport_array), > >> > + EXT(OES_geometry_shader), > >> > + EXTRA_END > >> > +}; > >> > >> This won't do what you want... unless drivers only ever set > >> OES_geometry_shader to true in ES contexts, which is not the way it's > >> usually done in mesa. That said they *are* careful about only setting > >> ARB_viewport_array in core contexts (due to the GS dependency). > > > > I am now confused about what you really want here. > > Do you want me to only check these enums for oes_geometry_shader? > > We have the same situation for gpu_shader5, right? > > As always, what I really want is for it to work :) Any way you choose to > achieve that is fine by me. As it stands, I could have a situation where > ARB_viewport_array = false, OES_geometry_shader = true, and I'm in a > desktop GL 3.2 core context, and now all of a sudden that > extra_ARB_viewport_array_or_geometry_shader thing is true. But... you > don't want it to be. > > -ilia I of course also want this to work. So, let us continue the discussion on how to solve this. So how about I get the EXTRA_EXT_VIEWPORT_GS back and then do: api_found = ctx->Extensions.ARB_viewport_array || _mesa_has_OES_geometry_shader(ctx) My understanding is that Nanleys new _mesa_has_##name_str helper will check the versions in the extension_table. Since oes_geometry_shader is only enabled for GLES 3.1, your example above will fail on both tests. Here is a quote from oes_geometry_shader spec: "LAYER_PROVOKING_VERTEX_OES query from ARB_provoking_vertex ARB_viewport_array (but did not add ProvokingVertex control, just this query)." My interpretation is that this enum does not need ARB_viewport_array. For the gpu_shader5 enum I haven't found in any clear quots from the spec. BR, Marta ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] mesa/version: Update gl_extensions::Version during version override
Thanks Nanley, This works fine! Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Nanley Chery > Sent: Tuesday, December 1, 2015 9:22 PM > To: mesa-dev@lists.freedesktop.org > Cc: Chery, Nanley G; 11.1; Emil Velikov > Subject: [Mesa-dev] [PATCH v2] mesa/version: Update > gl_extensions::Version during version override > > On Tue, Dec 01, 2015 at 10:44:43AM -0800, Nanley Chery wrote: > From: Nanley Chery > > Commit a16ffb743ced9fde80b2485dfc2d86ae74e86f25, which introduced > gl_extensions::Version, updates the field when the context version is > computed and when entering/exiting meta. Update this field when the > version is overridden as well. > > Cc: Marta Lofstedt > Cc: Emil Velikov > Cc: "11.1" > Signed-off-by: Nanley Chery > --- > > Cc'd mesa-stable. > > src/mesa/main/version.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index > 314b26d..e92bb11 100644 > --- a/src/mesa/main/version.c > +++ b/src/mesa/main/version.c > @@ -199,6 +199,7 @@ _mesa_override_gl_version(struct gl_context *ctx) > * " > */ >create_version_string(ctx, _mesa_is_gles(ctx) ? "OpenGL ES " : ""); > + ctx->Extensions.Version = ctx->Version; > } > } > > -- > 2.6.2 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v3] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Tuesday, December 1, 2015 7:52 PM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Cc: Emil Velikov > Subject: Re: [Mesa-dev] [PATCH v3] glsl: add support for > GL_OES_geometry_shader > > On 12/01/2015 06:49 AM, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > This adds glsl support of GL_OES_geometry_shader for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/glsl/builtin_variables.cpp | 25 + > > src/glsl/glsl_parser.yy | 4 ++-- > > src/glsl/glsl_parser_extras.cpp | 1 + > > src/glsl/glsl_parser_extras.h | 7 +++ > > 4 files changed, 23 insertions(+), 14 deletions(-) > > > > diff --git a/src/glsl/builtin_variables.cpp > > b/src/glsl/builtin_variables.cpp index e8eab80..6f87600 100644 > > --- a/src/glsl/builtin_variables.cpp > > +++ b/src/glsl/builtin_variables.cpp > > @@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > > } > > > > - if (state->is_version(150, 0)) { > > + if (state->has_geometry_shader()) { > >add_const("gl_MaxVertexOutputComponents", > > state->Const.MaxVertexOutputComponents); > >add_const("gl_MaxGeometryInputComponents", > > @@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBindings", > > state->Const.MaxAtomicBufferBindings); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounters", > > state->Const.MaxGeometryAtomicCounters); > > + } > > + if (!state->es_shader) { > > add_const("gl_MaxTessControlAtomicCounters", > > state->Const.MaxTessControlAtomicCounters); > > I think you got a little over excited here. I don't see MaxTess*Atomic > anywhere in any GLES extension... not even in GL_EXT_tessellation_shader, > which seems like a bug in that extension spec. > > https://www.khronos.org/bugzilla/show_bug.cgi?id=1427 > Ian, I am not sure I understand your comment. My patch enables gl_MaxGeometryAtomicCounters and gl_MaxGeometryAtomicCounterBuffers if you have geometry shader. These are part of the GL_OES_geometry_shader extension, but was previously not exposed for ES shaders. The "tess" stuff stays the same as it was before my patch, i.e. they are not exposed to ES shaders. > > add_const("gl_MaxTessEvaluationAtomicCounters", > > @@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBufferSize", > > state->Const.MaxAtomicCounterBufferSize); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounterBuffers", > > state->Const.MaxGeometryAtomicCounterBuffers); > > + } > > + if(!state->es_shader) { > > Here too. > > With these two things reverted, this patch is > > Reviewed-by: Ian Romanick > > > add_const("gl_MaxTessControlAtomicCounterBuffers", > > state->Const.MaxTessControlAtomicCounterBuffers); > > add_const("gl_MaxTessEvaluationAtomicCounterBuffers", > > @@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxCombinedImageUniforms", > > state->Const.MaxCombinedImageUniforms); > > > > + if (state->has_geometry_shader()) { > > + add_const("gl_MaxGeometryImageUniforms", > > + state->Const.MaxGeometryImageUniforms); > > + } > > + > >if (!state->es_shader) { > > add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", > > state->Const.MaxCombinedShaderOutputResources); > > add_const("gl_MaxImageSamples", > > state->Const.MaxImageSamples); > > - add_const("gl_MaxGeometryImageUniforms", > > - state->Const.MaxGeometryImageUniforms); > >} > > > >if (state->is_version(450, 310)) { @@ -1057,7 +1058,7 @@ > > builtin_variable_generator::generate_fs_special_vars() > > if (state->is_version(120, 100)) > >add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord"); > > > > - if (state->is_version(150, 0)) { > > + if (state->has_geometry_shader()) { > >var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); > >var->data.interpolation = INTERP_QUALIFIER_F
Re: [Mesa-dev] [PATCH v3] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Tuesday, December 1, 2015 4:53 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Lofstedt, Marta > Subject: Re: [PATCH v3] mesa: enable enums for OES_geometry_shader > > On Tue, Dec 1, 2015 at 10:37 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Enable GL_OES_geometry_shader enums for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mesa/main/get.c | 64 > ++-- > > src/mesa/main/get_hash_params.py | 53 > > +++-- > > 2 files changed, 86 insertions(+), 31 deletions(-) > > > > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index > > c6a2e5b..7be7971 100644 > > --- a/src/mesa/main/get.c > > +++ b/src/mesa/main/get.c > > @@ -147,11 +147,14 @@ enum value_extra { > > EXTRA_VALID_CLIP_DISTANCE, > > EXTRA_FLUSH_CURRENT, > > EXTRA_GLSL_130, > > - EXTRA_EXT_UBO_GS4, > > - EXTRA_EXT_ATOMICS_GS4, > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_UBO_GS, > > + EXTRA_EXT_ATOMICS_GS, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_EXT_ATOMICS_TESS, > > EXTRA_EXT_SHADER_IMAGE_TESS, > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_EXT_GPU5_GS, > > + EXTRA_EXT_FB_NO_ATTACH_GS, > > }; > > > > #define NO_EXTRA NULL > > @@ -308,7 +311,7 @@ static const int > > extra_ARB_transform_feedback2_api_es3[] = { }; > > > > static const int > extra_ARB_uniform_buffer_object_and_geometry_shader[] = { > > - EXTRA_EXT_UBO_GS4, > > + EXTRA_EXT_UBO_GS, > > EXTRA_END > > }; > > > > @@ -343,12 +346,12 @@ static const int extra_EXT_texture_array_es3[] = > > { }; > > > > static const int > extra_ARB_shader_atomic_counters_and_geometry_shader[] = { > > - EXTRA_EXT_ATOMICS_GS4, > > + EXTRA_EXT_ATOMICS_GS, > > EXTRA_END > > }; > > > > static const int > extra_ARB_shader_image_load_store_and_geometry_shader[] = { > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_END > > }; > > > > @@ -375,6 +378,27 @@ static const int > extra_ARB_shader_storage_buffer_object_es31[] = { > > EXTRA_END > > }; > > > > +static const int extra_ARB_gpu_shader5_and_geometry_shader[] = { > > + EXTRA_EXT_GPU5_GS, > > + EXTRA_END > > +}; > > + > > +static const int > extra_ARB_shader_storage_buffer_object_and_geometry_shader[] = { > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_END > > +}; > > + > > +static const int extra_ARB_viewport_array_or_geometry_shader[] = { > > + EXT(ARB_viewport_array), > > + EXT(OES_geometry_shader), > > + EXTRA_END > > +}; > > This won't do what you want... unless drivers only ever set > OES_geometry_shader to true in ES contexts, which is not the way it's usually > done in mesa. That said they *are* careful about only setting > ARB_viewport_array in core contexts (due to the GS dependency). I am now confused about what you really want here. Do you want me to only check these enums for oes_geometry_shader? We have the same situation for gpu_shader5, right? > > > + > > +static const int > extra_ARB_framebuffer_no_attachments_and_geometry_shader[] = { > > + EXTRA_EXT_FB_NO_ATTACH_GS, > > + EXTRA_END > > +}; > > + > > EXTRA_EXT(ARB_texture_cube_map); > > EXTRA_EXT(EXT_texture_array); > > EXTRA_EXT(NV_fog_distance); > > @@ -423,6 +447,7 @@ EXTRA_EXT(ARB_framebuffer_no_attachments); > > EXTRA_EXT(ARB_tessellation_shader); > > EXTRA_EXT(ARB_shader_subroutine); > > EXTRA_EXT(ARB_shader_storage_buffer_object); > > +EXTRA_EXT(OES_geometry_shader); > > > > static const int > > extra_ARB_color_buffer_float_or_glcore[] = { @@ -454,6 +479,12 @@ > > static const int extra_gl32_es3[] = { > > EXTRA_END, > > }; > > > > +static const int extra_version_32_OES_geometry_shader[] = { > > +EXTRA_VERSION_32, > > +EXT(OES_geometry_shader), > > +EXTRA_END > > +}; > > + > > static const int extra_gl40_ARB_sample_shading[] = { > > EXTRA_VERSION_40, > > EXT(ARB_sample_shading), > > @@ -1149,17 +1180,17 @@ check_extra(struct gl_context *ctx, const char > *func, const struct value_desc *d > > if (ctx->Const.GLSLVersion >= 130)
Re: [Mesa-dev] [PATCH v2 5/6] mesa: Update _mesa_has_geometry_shaders
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Lofstedt, Marta > Sent: Tuesday, December 1, 2015 4:48 PM > To: Emil Velikov; Marta Lofstedt > Cc: ML mesa-dev > Subject: Re: [Mesa-dev] [PATCH v2 5/6] mesa: Update > _mesa_has_geometry_shaders > > > > > -Original Message- > > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > > Behalf Of Emil Velikov > > Sent: Friday, November 27, 2015 4:19 PM > > To: Marta Lofstedt > > Cc: ML mesa-dev > > Subject: Re: [Mesa-dev] [PATCH v2 5/6] mesa: Update > > _mesa_has_geometry_shaders > > > > On 27 November 2015 at 14:31, Marta Lofstedt > > wrote: > > > From: Marta Lofstedt > > > > > > Updates the _mesa_has_geometry_shaders function to also look for > > > OpenGL ES 3.1 contexts that has OES_geometry_shader enabled. > > > --- > > > src/mesa/main/context.h | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index > > > 8b64f45..23b2718 100644 > > > --- a/src/mesa/main/context.h > > > +++ b/src/mesa/main/context.h > > > @@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx) > > > static inline bool _mesa_has_geometry_shaders(const struct > > > gl_context > > > *ctx) { > > > - return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32; > > > + return (_mesa_is_gles31(ctx) && > > > + ctx->Extensions.OES_geometry_shader) || > > > > Please use the new _mesa_has_##name_str helpers from Nanley. They > > already have the appropriate API and version check - > > _mesa_has_OES_geometry_shader is what we want here. > > > Oh, that's a cool new feature. > I'll send up a V3. > Unfortunately I have problem getting the name_str helper to work and I am > not entirely sure if it is for all gles context or only because I am on gles > version override. I will send up a patch for this where we can discuss > further. > Hi Nanley, I can't seem to get you ##name_str helper to work. I was planning to send up a patch changing ctx->Extension.Version to ctx->Version in the helper, because that works. But then I noticed that you had ctx->Version before you added the ctx->Extension.Version. So, now I am not sure how to use your nice feature. /Marta > > > > -Emil > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 5/6] mesa: Update _mesa_has_geometry_shaders
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Emil Velikov > Sent: Friday, November 27, 2015 4:19 PM > To: Marta Lofstedt > Cc: ML mesa-dev > Subject: Re: [Mesa-dev] [PATCH v2 5/6] mesa: Update > _mesa_has_geometry_shaders > > On 27 November 2015 at 14:31, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Updates the _mesa_has_geometry_shaders function to also look for > > OpenGL ES 3.1 contexts that has OES_geometry_shader enabled. > > --- > > src/mesa/main/context.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index > > 8b64f45..23b2718 100644 > > --- a/src/mesa/main/context.h > > +++ b/src/mesa/main/context.h > > @@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx) > > static inline bool _mesa_has_geometry_shaders(const struct gl_context > > *ctx) { > > - return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32; > > + return (_mesa_is_gles31(ctx) && > > + ctx->Extensions.OES_geometry_shader) || > > Please use the new _mesa_has_##name_str helpers from Nanley. They > already have the appropriate API and version check - > _mesa_has_OES_geometry_shader is what we want here. > Oh, that's a cool new feature. I'll send up a V3. Unfortunately I have problem getting the name_str helper to work and I am not entirely sure if it is for all gles context or only because I am on gles version override. I will send up a patch for this where we can discuss further. > > -Emil > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 4/6] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Friday, November 27, 2015 7:08 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 4/6] mesa: enable enums for > OES_geometry_shader > > On Fri, Nov 27, 2015 at 9:31 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Enable GL_OES_geometry_shader enums for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mesa/main/get.c | 58 > +--- > > src/mesa/main/get_hash_params.py | 50 > > +- > > 2 files changed, 80 insertions(+), 28 deletions(-) > > > > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index > > c6a2e5b..3770fba 100644 > > --- a/src/mesa/main/get.c > > +++ b/src/mesa/main/get.c > > @@ -147,11 +147,14 @@ enum value_extra { > > EXTRA_VALID_CLIP_DISTANCE, > > EXTRA_FLUSH_CURRENT, > > EXTRA_GLSL_130, > > - EXTRA_EXT_UBO_GS4, > > - EXTRA_EXT_ATOMICS_GS4, > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_UBO_GS, > > + EXTRA_EXT_ATOMICS_GS, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_EXT_ATOMICS_TESS, > > EXTRA_EXT_SHADER_IMAGE_TESS, > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_EXT_GPU5_GS, > > + EXTRA_EXT_VIEWPORT_GS, > > }; > > > > #define NO_EXTRA NULL > > @@ -308,7 +311,7 @@ static const int > > extra_ARB_transform_feedback2_api_es3[] = { }; > > > > static const int > extra_ARB_uniform_buffer_object_and_geometry_shader[] = { > > - EXTRA_EXT_UBO_GS4, > > + EXTRA_EXT_UBO_GS, > > EXTRA_END > > }; > > > > @@ -343,12 +346,12 @@ static const int extra_EXT_texture_array_es3[] = > > { }; > > > > static const int > extra_ARB_shader_atomic_counters_and_geometry_shader[] = { > > - EXTRA_EXT_ATOMICS_GS4, > > + EXTRA_EXT_ATOMICS_GS, > > EXTRA_END > > }; > > > > static const int > extra_ARB_shader_image_load_store_and_geometry_shader[] = { > > - EXTRA_EXT_SHADER_IMAGE_GS4, > > + EXTRA_EXT_SHADER_IMAGE_GS, > > EXTRA_END > > }; > > > > @@ -375,6 +378,21 @@ static const int > extra_ARB_shader_storage_buffer_object_es31[] = { > > EXTRA_END > > }; > > > > +static const int extra_ARB_gpu_shader5_and_geometry_shader[] = { > > + EXTRA_EXT_GPU5_GS, > > + EXTRA_END > > +}; > > + > > +static const int > extra_ARB_shader_storage_buffer_object_and_geometry_shader[] = { > > + EXTRA_EXT_SSBO_GS, > > + EXTRA_END > > +}; > > + > > +static const int extra_ARB_viewport_array_and_geometry_shader[] = { > > + EXTRA_EXT_VIEWPORT_GS, > > + EXTRA_END > > +}; > > + > > EXTRA_EXT(ARB_texture_cube_map); > > EXTRA_EXT(EXT_texture_array); > > EXTRA_EXT(NV_fog_distance); > > @@ -423,6 +441,7 @@ EXTRA_EXT(ARB_framebuffer_no_attachments); > > EXTRA_EXT(ARB_tessellation_shader); > > EXTRA_EXT(ARB_shader_subroutine); > > EXTRA_EXT(ARB_shader_storage_buffer_object); > > +EXTRA_EXT(OES_geometry_shader); > > > > static const int > > extra_ARB_color_buffer_float_or_glcore[] = { @@ -454,6 +473,12 @@ > > static const int extra_gl32_es3[] = { > > EXTRA_END, > > }; > > > > +static const int extra_version_32_OES_geometry_shader[] = { > > +EXTRA_VERSION_32, > > +EXT(OES_geometry_shader), > > +EXTRA_END > > +}; > > + > > static const int extra_gl40_ARB_sample_shading[] = { > > EXTRA_VERSION_40, > > EXT(ARB_sample_shading), > > @@ -1149,17 +1174,17 @@ check_extra(struct gl_context *ctx, const char > *func, const struct value_desc *d > > if (ctx->Const.GLSLVersion >= 130) > > api_found = GL_TRUE; > > break; > > - case EXTRA_EXT_UBO_GS4: > > + case EXTRA_EXT_UBO_GS: > > api_check = GL_TRUE; > > api_found = (ctx->Extensions.ARB_uniform_buffer_object && > >_mesa_has_geometry_shaders(ctx)); > > break; > > - case EXTRA_EXT_ATOMICS_GS4: > > + case EXTRA_EXT_ATOMICS_GS: > > api_check = GL_TRUE; > > api_found = (ctx->Extensions.ARB_shader_atomic_counters && > >_mesa_has_geometry_shaders(ctx)); > > break; > > - case EXTRA_EXT_SHADER_IMAGE_GS4: > > + case EXTRA_EXT_SHADER_IMAGE_GS: > > api_check = GL_TRUE; > > api_found = (ctx->Extensions.ARB_shader_image_load_store && > >_mesa_has_geometry_shaders(ctx)); @@ -1174,6 > > +1199,21 @@ check_extra(struct gl_context *ctx, const char *func, const > struct value_desc *d > > api_found = ctx->Extensions.ARB_shader_image_load_store && > > _mesa_has_tessellation(ctx); > > break; > > + case EXTRA_EXT_GPU5_GS: > > + api_check = GL_TRUE; > > + api_found = (ctx->Extensions.ARB_framebuffer_no_attachments && > > + _mesa_has_geometry_shaders(ctx)); > > What does this have to do with ARB_gpu_shader5? > My bad, thanks for spotting this! > > > +
Re: [Mesa-dev] [PATCH v3] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia > Mirkin > Sent: Tuesday, December 1, 2015 4:15 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Romanick, Ian D; Emil Velikov; Lofstedt, > Marta > Subject: Re: [PATCH v3] glsl: add support for GL_OES_geometry_shader > > Doesn't strictly have to be in this patch, but you also need to modify > >if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable) > add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, > "gl_InvocationID"); > > and the invocations layout qualifier, as I believe that OES_geometry_shader > includes invocation support. > > -ilia Thanks Ilia, I am aware of this, I have it in another set of patches I plan to send up when I have all the tests passing, and when I have sorted out shader_io_blocks. /Marta > > > On Tue, Dec 1, 2015 at 9:49 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > This adds glsl support of GL_OES_geometry_shader for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/glsl/builtin_variables.cpp | 25 + > > src/glsl/glsl_parser.yy | 4 ++-- > > src/glsl/glsl_parser_extras.cpp | 1 + > > src/glsl/glsl_parser_extras.h | 7 +++ > > 4 files changed, 23 insertions(+), 14 deletions(-) > > > > diff --git a/src/glsl/builtin_variables.cpp > > b/src/glsl/builtin_variables.cpp index e8eab80..6f87600 100644 > > --- a/src/glsl/builtin_variables.cpp > > +++ b/src/glsl/builtin_variables.cpp > > @@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > > } > > > > - if (state->is_version(150, 0)) { > > + if (state->has_geometry_shader()) { > >add_const("gl_MaxVertexOutputComponents", > > state->Const.MaxVertexOutputComponents); > >add_const("gl_MaxGeometryInputComponents", > > @@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBindings", > > state->Const.MaxAtomicBufferBindings); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounters", > > state->Const.MaxGeometryAtomicCounters); > > + } > > + if (!state->es_shader) { > > add_const("gl_MaxTessControlAtomicCounters", > > state->Const.MaxTessControlAtomicCounters); > > add_const("gl_MaxTessEvaluationAtomicCounters", > > @@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBufferSize", > > state->Const.MaxAtomicCounterBufferSize); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (state->has_geometry_shader()) { > > add_const("gl_MaxGeometryAtomicCounterBuffers", > > state->Const.MaxGeometryAtomicCounterBuffers); > > + } > > + if(!state->es_shader) { > > add_const("gl_MaxTessControlAtomicCounterBuffers", > > state->Const.MaxTessControlAtomicCounterBuffers); > > add_const("gl_MaxTessEvaluationAtomicCounterBuffers", > > @@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxCombinedImageUniforms", > > state->Const.MaxCombinedImageUniforms); > > > > + if (state->has_geometry_shader()) { > > + add_const("gl_MaxGeometryImageUniforms", > > + state->Const.MaxGeometryImageUniforms); > > + } > > + > >if (!state->es_shader) { > > add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", > > state->Const.MaxCombinedShaderOutputResources); > > add_const("gl_MaxImageSamples", > > state->Const.MaxImageSamples); > > - add_
Re: [Mesa-dev] [PATCH v2 3/6] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Monday, November 30, 2015 8:48 PM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 3/6] glsl: add support for > GL_OES_geometry_shader > > On 11/27/2015 06:31 AM, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > This adds glsl support of GL_OES_geometry_shader for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/glsl/builtin_variables.cpp | 17 + > > src/glsl/glsl_parser.yy | 4 ++-- > > src/glsl/glsl_parser_extras.cpp | 1 + > > src/glsl/glsl_parser_extras.h | 2 ++ > > 4 files changed, 10 insertions(+), 14 deletions(-) > > > > diff --git a/src/glsl/builtin_variables.cpp > > b/src/glsl/builtin_variables.cpp index e8eab80..6a53789 100644 > > --- a/src/glsl/builtin_variables.cpp > > +++ b/src/glsl/builtin_variables.cpp > > @@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > > } > > > > - if (state->is_version(150, 0)) { > > + if (state->is_version(150, 320) || > > + state->OES_geometry_shader_enable) { > > I think it would be better to have a separate patch that adds a > _mesa_glsl_parse_state::has_geometry_shader() method. This patch would > then (mostly) just update that function to know about the new OES > extension. > > I'm suggesting this because I think there are some apps that use the EXT > version, so we may want to add support for that later. It also makes the code > less cluttered. > I agree Ian. In this case I believe it looks better with a has_geometry_shader(). V3 coming up. > > >add_const("gl_MaxVertexOutputComponents", > > state->Const.MaxVertexOutputComponents); > >add_const("gl_MaxGeometryInputComponents", > > @@ -729,11 +729,7 @@ builtin_variable_generator::generate_constants() > > state->Const.MaxCombinedAtomicCounters); > >add_const("gl_MaxAtomicCounterBindings", > > state->Const.MaxAtomicBufferBindings); > > - > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxGeometryAtomicCounters", > > state->Const.MaxGeometryAtomicCounters); > > add_const("gl_MaxTessControlAtomicCounters", > > @@ -753,10 +749,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBufferSize", > > state->Const.MaxAtomicCounterBufferSize); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxGeometryAtomicCounterBuffers", > > state->Const.MaxGeometryAtomicCounterBuffers); > > add_const("gl_MaxTessControlAtomicCounterBuffers", > > @@ -814,7 +807,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxCombinedImageUniforms", > > state->Const.MaxCombinedImageUniforms); > > > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", > > state->Const.MaxCombinedShaderOutputResources); > > add_const("gl_MaxImageSamples", @@ -1057,7 +1050,7 @@ > > builtin_variable_generator::generate_fs_special_vars() > > if (state->is_version(120, 100)) > >add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord"); > > > > - if (state->is_version(150, 0)) { > > + if (state->is_version(150, 320) || > > + state->OES_geometry_shader_enable) { > >var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); > >var->data.interpolation = INTERP_QUALIFIER_FLAT; > > } > > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > > 5a8f980..fae6d0b 100644 > > --- a/src/glsl/glsl_parser.yy > > +++ b/src/glsl/glsl_parser.yy > > @@ -1262,7 +1262,7 @@ layout_qualifier_id: > > } > > } > > > > - if ($$.flags.i && !state->is_version(150, 0)) { > > + if ($$.flags.i && !state->is_version(150, 320) && > > + !state->OES_geometry_shader_enable) { > > _mesa_glsl_error(& @1, state, "#version 150 layout " > > "qualifier `%s' used", $1); > > } > > @@ -1499,7 +1499,7 @@ layout_qualifier_id: > >if (match_layout_qualifier("max_vertices", $1, state) == 0) { > > $$.flags.q.max_vertices = 1; > > $$.max_vertices
Re: [Mesa-dev] [PATCH v2 3/6] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Friday, November 27, 2015 8:16 PM > To: Emil Velikov > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 3/6] glsl: add support for > GL_OES_geometry_shader > > On Fri, Nov 27, 2015 at 2:12 PM, Emil Velikov > wrote: > > On 27 November 2015 at 19:00, Ilia Mirkin wrote: > >> On Fri, Nov 27, 2015 at 1:55 PM, Emil Velikov > wrote: > >>> On 27 November 2015 at 18:36, Ilia Mirkin > wrote: > On Fri, Nov 27, 2015 at 1:31 PM, Emil Velikov > wrote: > > On 27 November 2015 at 18:02, Ilia Mirkin > wrote: > >> On Fri, Nov 27, 2015 at 9:31 AM, Marta Lofstedt > >> wrote: > >>> From: Marta Lofstedt > >>> > >>> This adds glsl support of GL_OES_geometry_shader for OpenGL ES > >>> 3.1. > >>> > >>> Signed-off-by: Marta Lofstedt > >>> --- > >>> src/glsl/builtin_variables.cpp | 17 + > >>> src/glsl/glsl_parser.yy | 4 ++-- > >>> src/glsl/glsl_parser_extras.cpp | 1 + > >>> src/glsl/glsl_parser_extras.h | 2 ++ > >>> 4 files changed, 10 insertions(+), 14 deletions(-) > >>> > >>> diff --git a/src/glsl/builtin_variables.cpp > >>> b/src/glsl/builtin_variables.cpp index e8eab80..6a53789 100644 > >>> --- a/src/glsl/builtin_variables.cpp > >>> +++ b/src/glsl/builtin_variables.cpp > >>> @@ -667,7 +667,7 @@ > builtin_variable_generator::generate_constants() > >>>add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > >>> } > >>> > >>> - if (state->is_version(150, 0)) { > >>> + if (state->is_version(150, 320) || > >>> + state->OES_geometry_shader_enable) { > >>>add_const("gl_MaxVertexOutputComponents", > >>> state->Const.MaxVertexOutputComponents); > >>>add_const("gl_MaxGeometryInputComponents", > >>> @@ -729,11 +729,7 @@ > builtin_variable_generator::generate_constants() > >>> state->Const.MaxCombinedAtomicCounters); > >>>add_const("gl_MaxAtomicCounterBindings", > >>> state->Const.MaxAtomicBufferBindings); > >>> - > >>> - /* When Mesa adds support for GL_OES_geometry_shader > and > >>> - * GL_OES_tessellation_shader, this will need to change. > >>> - */ > >>> - if (!state->es_shader) { > >>> + if (!state->es_shader || > >>> + state->OES_geometry_shader_enable) { > >>> add_const("gl_MaxGeometryAtomicCounters", > >>> state->Const.MaxGeometryAtomicCounters); > >>> add_const("gl_MaxTessControlAtomicCounters", > >> > >> Do you really want to be adding this in for OES_geometry_shader? > >> > >>> @@ -753,10 +749,7 @@ > builtin_variable_generator::generate_constants() > >>>add_const("gl_MaxAtomicCounterBufferSize", > >>> state->Const.MaxAtomicCounterBufferSize); > >>> > >>> - /* When Mesa adds support for GL_OES_geometry_shader > and > >>> - * GL_OES_tessellation_shader, this will need to change. > >>> - */ > >>> - if (!state->es_shader) { > >>> + if (!state->es_shader || > >>> + state->OES_geometry_shader_enable) { > >>> add_const("gl_MaxGeometryAtomicCounterBuffers", > >>> state->Const.MaxGeometryAtomicCounterBuffers); > >>> add_const("gl_MaxTessControlAtomicCounterBuffers", > >>> @@ -814,7 +807,7 @@ > builtin_variable_generator::generate_constants() > >>>add_const("gl_MaxCombinedImageUniforms", > >>> state->Const.MaxCombinedImageUniforms); > >>> > >>> - if (!state->es_shader) { > >>> + if (!state->es_shader || > >>> + state->OES_geometry_shader_enable) { > >>> > add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", > >>> state->Const.MaxCombinedShaderOutputResources); > >>> add_const("gl_MaxImageSamples", @@ -1057,7 +1050,7 @@ > >>> builtin_variable_generator::generate_fs_special_vars() > >>> if (state->is_version(120, 100)) > >>>add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord"); > >>> > >>> - if (state->is_version(150, 0)) { > >>> + if (state->is_version(150, 320) || > >>> + state->OES_geometry_shader_enable) { > >>>var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, > "gl_PrimitiveID"); > >>>var->data.interpolation = INTERP_QUALIFIER_FLAT; > >>> } > >>> diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy > >>> index 5a8f980..fae6d0b 100644 > >>> --- a/src/glsl/glsl_parser.yy > >>> +++ b/src/glsl/glsl_parser.yy > >>> @@ -1262,7 +1262,7 @@ layout_qualifier_id: > >>> } > >>> } > >>> > >>> -
Re: [Mesa-dev] [PATCH v2 1/6] gles2: Update gl2ext.h to revision: 32120
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Monday, November 30, 2015 2:55 PM > To: Emil Velikov > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 1/6] gles2: Update gl2ext.h to revision: > 32120 > > On Fri, Nov 27, 2015 at 1:37 PM, Ilia Mirkin wrote: > > On Fri, Nov 27, 2015 at 1:35 PM, Emil Velikov > wrote: > >> On 27 November 2015 at 17:50, Ilia Mirkin wrote: > >>> On Fri, Nov 27, 2015 at 9:31 AM, Marta Lofstedt > >>> wrote: > From: Marta Lofstedt > > This is needed to be able to implement the accepted OES extensions. > > Signed-off-by: Marta Lofstedt > --- > include/GLES2/gl2ext.h | 940 > - > 1 file changed, 934 insertions(+), 6 deletions(-) > > diff --git a/include/GLES2/gl2ext.h b/include/GLES2/gl2ext.h index > 2b67c6e..2d05596 100644 > --- a/include/GLES2/gl2ext.h > +++ b/include/GLES2/gl2ext.h > @@ -6,7 +6,7 @@ extern "C" { > #endif > > /* > -** Copyright (c) 2013-2014 The Khronos Group Inc. > +** Copyright (c) 2013-2015 The Khronos Group Inc. > ** > ** Permission is hereby granted, free of charge, to any person > obtaining a > ** copy of this software and/or associated documentation files > (the @@ -33,14 +33,14 @@ extern "C" { > ** used to make the header, and the header can be found at > ** http://www.opengl.org/registry/ > ** > -** Khronos $Revision: 28335 $ on $Date: 2014-09-26 18:55:45 -0700 > (Fri, 26 Sep 2014) $ > +** Khronos $Revision: 32120 $ on $Date: 2015-10-15 04:27:13 -0700 > +(Thu, 15 Oct 2015) $ > */ > >>> > >>> What is this header used for? Do we ship it, or is it purely > >>> internal to mesa? If we ship it, might need to cc this to stable... > >>> e.g. buffer storage and a couple other things are in here that we expose > in 11.1. > >> > >> We ship it. Although everyone (distributions?) can freely grab them > >> from the Khronos public section. > > > > OK, then we need to get this into 11.1 since we added > > GL_EXT_blend_func_extended there (and GL_EXT_buffer_storage, but > that > > one's a bit more theoretical since there's no ES 3.1 support yet). > > Not sure why this got checked in with a cc to 11.0 stable, but this should > really > just go to 11.1, unless I'm missing something. > I My bad. > -ilia > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 2/6] glapi: add GL_OES_geometry_shader extension
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Emil Velikov > Sent: Friday, November 27, 2015 7:23 PM > To: Marta Lofstedt > Cc: ML mesa-dev > Subject: Re: [Mesa-dev] [PATCH v2 2/6] glapi: add > GL_OES_geometry_shader extension > > Hello Marta, > > On 27 November 2015 at 14:31, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Add xml definitions for the GL_OES_geometry_shader extension and > > expose the extension for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mapi/glapi/gen/apiexec.py | 2 +- > > src/mapi/glapi/gen/es_EXT.xml | 43 > + > > src/mesa/main/extensions_table.h| 1 + > > src/mesa/main/mtypes.h | 1 + > > src/mesa/main/tests/dispatch_sanity.cpp | 3 +++ > > 5 files changed, 49 insertions(+), 1 deletion(-) > > > > diff --git a/src/mapi/glapi/gen/apiexec.py > > b/src/mapi/glapi/gen/apiexec.py index 58ec08b..fa046fa 100644 > > --- a/src/mapi/glapi/gen/apiexec.py > > +++ b/src/mapi/glapi/gen/apiexec.py > > @@ -72,7 +72,7 @@ functions = { > > > > # OpenGL 3.2 / GL_ARB_geometry_shader4. Mesa does not support > > # GL_ARB_geometry_shader4, so OpenGL 3.2 is required. > > -"FramebufferTexture": exec_info(core=32), > > +"FramebufferTexture": exec_info(core=32, es2=31), > > > Please update the comment as well. > > > # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this > > # extension with core profile. > > diff --git a/src/mapi/glapi/gen/es_EXT.xml > > b/src/mapi/glapi/gen/es_EXT.xml index 577d825..f6c49c2 100644 > > --- a/src/mapi/glapi/gen/es_EXT.xml > > +++ b/src/mapi/glapi/gen/es_EXT.xml > > @@ -940,4 +940,47 @@ > > > > > > > > + > > + > > + > > + value="0x8DD9"/> > > + value="0x0004"/> > > + value="0x8916"/> > > + value="0x8917"/> > > + value="0x8918"/> > > + value="0x887F"/> > > + value="0x825E"/> > > + value="0x8A2C"/> > > + name="MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES" > value="0x8A32"/> > > + value="0x9123"/> > > + value="0x9124"/> > > + value="0x8DE0"/> > > + name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES" > value="0x8DE1"/> > > + value="0x8E5A"/> > > + value="0x8C29"/> > > + value="0x92CF"/> > > + value="0x92D5"/> > > + value="0x90CD"/> > > + value="0x90D7"/> > > + value="0x8E4D"/> > > + value="0x8E4E"/> > > + value="0x8260"/> > > + value="0x8C87"/> > > + > value="0xA"/> > > + value="0xB"/> > > + value="0xC"/> > > + value="0xD"/> > > + value="0x9312"/> > > + value="0x9317"/> > > + value="0x8DA8"/> > > + value="0x8DA7"/> > > + value="0x9309"/> > > + > Wondering if Eric's recent patches don't make these obsolete. Haven't look > closely at them yet, have you ? No, I haven't looked to closely at them either. Do you think I should wait with this util Erics stuff has landed? > > Cheers, > Emil > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] mesa: remove ARB_geometry_shader4
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Wednesday, November 25, 2015 8:03 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org; Kenneth Graunke; Emil Velikov > Subject: Re: [Mesa-dev] [PATCH v2] mesa: remove ARB_geometry_shader4 > > At first I thought it was a mistake to remove things from enum_strings.cpp, > but it looks like the ARB/EXT extensions actually had different enum values > than core GL 3.2 for the same things. > > I've looked over all of this with some care and it looks right. Will need a > bunch > of changes to support OES_geometry_shader, but that's for another change. I hope to get some time to rebase my old oes_geometry_shader patches, this week. Thanks again for the review, Ilia and Kenneth. BR, Marta > This one is > > Reviewed-by: Ilia Mirkin > > On Wed, Nov 25, 2015 at 6:16 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > No drivers currently implement ARB_geometry_shader4, nor are there any > > plans to implement it. We only support the version of geometry > > shaders that was incorporated into OpenGL 3.2 / GLSL 1.50. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 - > > > src/mapi/glapi/gen/Makefile.am | 1 - > > src/mapi/glapi/gen/gl_API.xml | 2 +- > > src/mesa/main/api_validate.c| 2 +- > > src/mesa/main/config.h | 2 +- > > src/mesa/main/context.h | 3 +- > > src/mesa/main/dlist.c | 55 > > > > src/mesa/main/get.c | 7 > > src/mesa/main/get_hash_params.py| 12 ++ > > src/mesa/main/mtypes.h | 3 +- > > src/mesa/main/tests/enum_strings.cpp| 6 --- > > 11 files changed, 9 insertions(+), 141 deletions(-) delete mode > > 100644 src/mapi/glapi/gen/ARB_geometry_shader4.xml > > > > diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > b/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > deleted file mode 100644 > > index 280e7a0..000 > > --- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > +++ /dev/null > > @@ -1,57 +0,0 @@ > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - value="0x8DDA"/> > > - > > - > > - value="0x8C29"/> > > - value="0x8DDD"/> > > - value="0x8DDE"/> > > - value="0x8B4B"/> > > - value="0x8DDF"/> > > - value="0x8DE0"/> > > - name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB" > value="0x8DE1"/> > > - > > - > > - > > - > > - value="0x8DA8"/> > > - value="0x8DA9"/> > > - value="0x8DA7"/> > > - value="0x8CD4"/> > > - > > - > > - > > - > > - > > - > > - alias="FramebufferTexture"> > > - > > - > > - > > - > > - > > - alias="FramebufferTextureLayer"> > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > diff --git a/src/mapi/glapi/gen/Makefile.am > > b/src/mapi/glapi/gen/Makefile.am index a5a26a6..40b0e65 100644 > > --- a/src/mapi/glapi/gen/Makefile.am > > +++ b/src/mapi/glapi/gen/Makefile.am > > @@ -133,7 +133,6 @@ API_XML = \ > > ARB_ES3_compatibility.xml \ > > ARB_framebuffer_no_attachments.xml \ > > ARB_framebuffer_object.xml \ > > - ARB_geometry_shader4.xml \ > > ARB_get_program_binary.xml \ > > ARB_get_texture_sub_image.xml \ > > ARB_gpu_shader_fp64.xml \ > > diff --git a/src/mapi/glapi/gen/gl_API.xml > > b/src/mapi/glapi/gen/gl_API.xml index ec83cd4..6243bdd 100644 > > --- a/src/mapi/glapi/gen/gl_API.xml > > +++ b/src/mapi/glapi/gen/gl_API.xml > > @@ -7975,7 +7975,7 @@ > > > > > > > > - > xmlns:xi="http://www.w3.org/2001/XInclude"/> > > + > > > > > > > > diff --git a/src/mesa/main/api_validate.c > > b/src/mesa/main/api_validate.c index a490189..cbfb6b5 100644 > > --- a/src/mesa/main/api_validate.c > > +++ b/src/mesa/main/api_validate.c > > @@ -170,7 +170,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, > GLenum mode, const char *name) > >return GL_FALSE; > > } > > > > - /* From the ARB_geometry_shader4 spec: > > + /* From the OpenGL 4.5 specification, section 11.3.1: > > * > > * The error INVALID_OPERATION is generated if Begin, or any command > that > > * implicitly calls Begin, is called when a geometry shader is active > > and: > > diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index > > f29de5f..2d53e2f 100644 > > --- a/src/mesa/main/config.h > > +++ b/src/mesa/main/config.h > > @@ -246,7 +246,7 @@ > > #define MAX_FEEDBACK_BUFFERS 4 > > #define MAX_FEEDBACK_ATTRIBS 32 > > > > -/** For GL_ARB_geometry_shader4 */ > > +/** For geometry sha
Re: [Mesa-dev] [PATCH] mesa/main: TexImage2DMultisample needs to pass OpenGL3.3 conformance test.
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Wednesday, November 25, 2015 12:24 PM > To: Timothy Arceri; Predut, Marius; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH] mesa/main: TexImage2DMultisample > needs to pass OpenGL3.3 conformance test. > > On 11/25/2015 01:11 PM, Timothy Arceri wrote: > > On Wed, 2015-11-25 at 12:47 +0200, Tapani Pälli wrote: > >> Hi; > >> > >> On 11/25/2015 01:15 PM, Marius Predut wrote: > >>> Open GL 3.3 reference document says: > >>> samples must be in the range zero to GL_MAX_TEXTURE_SIZE - 1. > >>> Open GL.4 clearly states: > >>> An INVALID_VALUE error is generated if samples is zero. > > See my comment in bugzilla [1] I believe this is just a bug in the > > reference pages, we implement things in Mesa going by what the spec > > says and the spec says nothing about samples being 0 in the 3.2 spec > > in fact it doen't even say anything in the 4.0 spec which you have > > changed the check to. > > > > Also the 4.5 reference pages also conflict with the spec so this is > > even more reason I think this change is wrong. > > > > [1] https://bugs.freedesktop.org/show_bug.cgi?id=91670 > > I believe there is some background to this change, AFAIK the reason to push > this would be to get desktop GL CTS test suite (which we currently run > against GL 3.x) behave better. Marius, is this right? > There is also the option of filing a BUG against the CTS. > > >> OpenGL ES 3.1 spec also says "An INVALID_VALUE error is generated if > >> samples is zero.". You'll need to change you check below to include > >> also ES 3.1. > >> > >>> Fixing the piglit test case gl-3.2-layered-rendering > >>> -framebuffertexture. > >>> > >>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93100 > >>> > >>> Signed-off-by: Marius Predut > >>> --- > >>>src/mesa/main/teximage.c | 2 +- > >>>1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c > >>> index d9453e3..69634ff 100644 > >>> --- a/src/mesa/main/teximage.c > >>> +++ b/src/mesa/main/teximage.c > >>> @@ -5211,7 +5211,7 @@ texture_image_multisample(struct gl_context > >>> *ctx, GLuint dims, > >>> return; > >>> } > >>> > >>> - if (samples < 1) { > >>> + if (samples < 1 && ctx->API == API_OPENGL_CORE && ctx->Version > = 40) { > >>> _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples < 1)", > >>> func); > >>> return; > >>> } > >> ___ > >> mesa-dev mailing list > >> mesa-dev@lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: remove ARB_geometry_shader4
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Kenneth Graunke > Sent: Tuesday, November 24, 2015 12:12 PM > To: mesa-dev@lists.freedesktop.org; Marta Lofstedt > Subject: Re: [Mesa-dev] [PATCH] mesa: remove ARB_geometry_shader4 > > On Tuesday, November 24, 2015 10:20:11 AM Marta Lofstedt wrote: > > From: Marta Lofstedt > > Hi Marta! > > Thanks for doing this! > > > Since all drivers support OpenGL 3.2 geometry shaders, there is no > > reason to keep the ARB_geometry_shader4. > > We do have drivers that don't support OpenGL 3.2 (such as Ironlake). > I might instead say something like: > > No drivers currently implement ARB_geometry_shader4, nor are there any > plans to implement it. We only support the version of geometry shaders that > was incorporated into OpenGL 3.2 / GLSL 1.50. Thanks Kenneth, I will fix V2 tomorrow anyways, since I forgot to remove some enum_strings.cpp stuff. > > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 - > > > src/mapi/glapi/gen/Makefile.am | 1 - > > src/mapi/glapi/gen/gl_API.xml | 2 - > > src/mesa/main/api_validate.c| 2 +- > > src/mesa/main/config.h | 2 +- > > src/mesa/main/context.h | 3 +- > > src/mesa/main/dlist.c | 6 +-- > > src/mesa/main/get.c | 7 > > src/mesa/main/get_hash_params.py| 12 ++ > > src/mesa/main/mtypes.h | 3 +- > > 10 files changed, 11 insertions(+), 84 deletions(-) delete mode > > 100644 src/mapi/glapi/gen/ARB_geometry_shader4.xml > > > > diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > b/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > deleted file mode 100644 > > index 280e7a0..000 > > --- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > > +++ /dev/null > > @@ -1,57 +0,0 @@ > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - value="0x8DDA"/> > > - > > - > > - value="0x8C29"/> > > - value="0x8DDD"/> > > - value="0x8DDE"/> > > - value="0x8B4B"/> > > - value="0x8DDF"/> > > - value="0x8DE0"/> > > - name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB" > value="0x8DE1"/> > > - > > - > > - > > - > > - value="0x8DA8"/> > > - value="0x8DA9"/> > > - value="0x8DA7"/> > > - value="0x8CD4"/> > > - > > - > > - > > - > > - > > - > > - alias="FramebufferTexture"> > > - > > - > > - > > - > > - > > - alias="FramebufferTextureLayer"> > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > diff --git a/src/mapi/glapi/gen/Makefile.am > > b/src/mapi/glapi/gen/Makefile.am index a5a26a6..40b0e65 100644 > > --- a/src/mapi/glapi/gen/Makefile.am > > +++ b/src/mapi/glapi/gen/Makefile.am > > @@ -133,7 +133,6 @@ API_XML = \ > > ARB_ES3_compatibility.xml \ > > ARB_framebuffer_no_attachments.xml \ > > ARB_framebuffer_object.xml \ > > - ARB_geometry_shader4.xml \ > > ARB_get_program_binary.xml \ > > ARB_get_texture_sub_image.xml \ > > ARB_gpu_shader_fp64.xml \ > > diff --git a/src/mapi/glapi/gen/gl_API.xml > > b/src/mapi/glapi/gen/gl_API.xml index ec83cd4..8ff110c 100644 > > --- a/src/mapi/glapi/gen/gl_API.xml > > +++ b/src/mapi/glapi/gen/gl_API.xml > > @@ -7975,8 +7975,6 @@ > > > > > > > > - > xmlns:xi="http://www.w3.org/2001/XInclude"/> > > - > > > > > > > xmlns:xi="http://www.w3.org/2001/XInclude"/> > > diff --git a/src/mesa/main/api_validate.c > > b/src/mesa/main/api_validate.c index a490189..cbfb6b5 100644 > > --- a/src/mesa/main/api_validate.c > > +++ b/src/mesa/main/api_validate.c > > @@ -170,7 +170,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, > GLenum mode, const char *name) > >return GL_FALSE; > > } > > > > - /* From the ARB_geometry_shader4 spec: > > + /* From the OpenGL 4.5 specification, section 11.3.1: > > * > > * The error INVALID_OPERATION is generated if Begin, or any command > that > > * implicitly calls Begin, is called when a geometry shader is active > > and: > > diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index > > f29de5f..2d53e2f 100644 > > --- a/src/mesa/main/config.h > > +++ b/src/mesa/main/config.h > > @@ -246,7 +246,7 @@ > > #define MAX_FEEDBACK_BUFFERS 4 > > #define MAX_FEEDBACK_ATTRIBS 32 > > > > -/** For GL_ARB_geometry_shader4 */ > > +/** For geometry shader */ > > /*@{*/ > > #define MAX_GEOMETRY_UNIFORM_COMPONENTS 512 > > #define MAX_GEOMETRY_OUTPUT_VERTICES 256 > > diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index > > 4798b1f..8b64f45 100644 > > --- a/src/mesa/main/conte
Re: [Mesa-dev] [PATCH] mesa: remove ARB_geometry_shader4
Hi, As previously discussed in: http://patchwork.freedesktop.org/patch/60183/ the ARB_geometry_shader4 should be removed. If I can land below patch I will rebase my previous OES_geometry_shader patches. /Marta > -Original Message- > From: Marta Lofstedt [mailto:marta.lofst...@linux.intel.com] > Sent: Tuesday, November 24, 2015 10:20 AM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Marta Lofstedt > Subject: [PATCH] mesa: remove ARB_geometry_shader4 > > From: Marta Lofstedt > > Since all drivers support OpenGL 3.2 geometry shaders, there is no reason to > keep the ARB_geometry_shader4. > > Signed-off-by: Marta Lofstedt > --- > src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 --- > -- > src/mapi/glapi/gen/Makefile.am | 1 - > src/mapi/glapi/gen/gl_API.xml | 2 - > src/mesa/main/api_validate.c| 2 +- > src/mesa/main/config.h | 2 +- > src/mesa/main/context.h | 3 +- > src/mesa/main/dlist.c | 6 +-- > src/mesa/main/get.c | 7 > src/mesa/main/get_hash_params.py| 12 ++ > src/mesa/main/mtypes.h | 3 +- > 10 files changed, 11 insertions(+), 84 deletions(-) delete mode 100644 > src/mapi/glapi/gen/ARB_geometry_shader4.xml > > diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > b/src/mapi/glapi/gen/ARB_geometry_shader4.xml > deleted file mode 100644 > index 280e7a0..000 > --- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml > +++ /dev/null > @@ -1,57 +0,0 @@ > - > - > - > - > - > - > - > - > - > - > - > - > - > - value="0x8C29"/> > - value="0x8DDD"/> > - value="0x8DDE"/> > - value="0x8B4B"/> > - value="0x8DDF"/> > - value="0x8DE0"/> > - value="0x8DE1"/> > - > - > - > - > - value="0x8DA8"/> > - value="0x8DA9"/> > - value="0x8DA7"/> > - value="0x8CD4"/> > - > - > - > - > - > - > - alias="FramebufferTexture"> > - > - > - > - > - > - alias="FramebufferTextureLayer"> > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > diff --git a/src/mapi/glapi/gen/Makefile.am > b/src/mapi/glapi/gen/Makefile.am index a5a26a6..40b0e65 100644 > --- a/src/mapi/glapi/gen/Makefile.am > +++ b/src/mapi/glapi/gen/Makefile.am > @@ -133,7 +133,6 @@ API_XML = \ > ARB_ES3_compatibility.xml \ > ARB_framebuffer_no_attachments.xml \ > ARB_framebuffer_object.xml \ > - ARB_geometry_shader4.xml \ > ARB_get_program_binary.xml \ > ARB_get_texture_sub_image.xml \ > ARB_gpu_shader_fp64.xml \ > diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml > index ec83cd4..8ff110c 100644 > --- a/src/mapi/glapi/gen/gl_API.xml > +++ b/src/mapi/glapi/gen/gl_API.xml > @@ -7975,8 +7975,6 @@ > > > > - xmlns:xi="http://www.w3.org/2001/XInclude"/> > - > > > xmlns:xi="http://www.w3.org/2001/XInclude"/> > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c > index a490189..cbfb6b5 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -170,7 +170,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, > GLenum mode, const char *name) >return GL_FALSE; > } > > - /* From the ARB_geometry_shader4 spec: > + /* From the OpenGL 4.5 specification, section 11.3.1: > * > * The error INVALID_OPERATION is generated if Begin, or any command > that > * implicitly calls Begin, is called when a geometry shader is active and: > diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index > f29de5f..2d53e2f 100644 > --- a/src/mesa/main/config.h > +++ b/src/mesa/main/config.h > @@ -246,7 +246,7 @@ > #define MAX_FEEDBACK_BUFFERS 4 > #define MAX_FEEDBACK_ATTRIBS 32 > > -/** For GL_ARB_geometry_shader4 */ > +/** For geometry shader */ > /*@{*/ > #define MAX_GEOMETRY_UNIFORM_COMPONENTS 512 > #define MAX_GEOMETRY_OUTPUT_VERTICES 256 > diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index > 4798b1f..8b64f45 100644 > --- a/src/mesa/main/context.h > +++ b/src/mesa/m
Re: [Mesa-dev] [PATCH 00/36] Computer shader shared variables
I can confirm that this patch-set does not cause any regression for GLES 3.1 CTS test on HSW and BDW. > -Original Message- > From: Justen, Jordan L > Sent: Saturday, November 14, 2015 10:44 PM > To: mesa-dev@lists.freedesktop.org > Cc: Kristian Høgsberg Kristensen; Lofstedt, Marta; Palli, Tapani; Justen, > Jordan > L > Subject: [PATCH 00/36] Computer shader shared variables > > git://people.freedesktop.org/~jljusten/mesa cs-shared-variables-v1 > http://patchwork.freedesktop.org/bundle/jljusten/cs-shared-variables-v1 > > Patches 1 - 13: > > * Rebased curro's "i965: L3 cache partitioning." (sent Sept 6) > > Patches 14 - 19: > > * Rework lower_ubo_reference to allow code sharing with >lower_shared_reference > > Patches 20 - 28: > > * Add shared variable support for i965. Add lower_shared_reference, >which works similar to lower_ubo_reference for SSBOs, except it >merges all shared variable into one shared variable region. (Rather >than separate BOs like SSBOs allows.) > > Patches 29 - 36: > > * Adds atomic support for shared variable on i965, which is >implemented similar to SSBOs. > > On Ivy Bridge fixes several piglit and OpenGLES 3.1 CTS tests: > > * spec/arb_compute_shader/compiler/shared-atomics.comp: fail pass > * spec/arb_compute_shader/execution/shared-atomic: crash pass > * spec/arb_compute_shader/execution/simple-barrier: crash pass > > * es31-cts/compute_shader/atomic-case1: fail pass > * es31-cts/compute_shader/atomic-case3: fail pass > * es31-cts/compute_shader/shared-indexing: fail pass > * es31-cts/compute_shader/shared-max: fail pass > * es31-cts/compute_shader/shared-simple: fail pass > * es31-cts/compute_shader/shared-struct: fail pass > * es31-cts/compute_shader/work-group-size: fail pass > > Francisco Jerez (13): > i965: Define symbolic constants for some useful L3 cache control > registers. > i965: Keep track of whether LRI is allowed in the context struct. > i965: Define state flag to signal that the URB size has been altered. > i965/gen8: Don't add workaround bits to PIPE_CONTROL stalls if DC > flush is set. > i965: Import tables enumerating the set of validated L3 > configurations. > i965: Implement programming of the L3 configuration. > i965/hsw: Enable L3 atomics. > i965: Implement selection of the closest L3 configuration based on a > vector of weights. > i965: Calculate appropriate L3 partition weights for the current > pipeline state. > i965: Implement L3 state atom. > i965: Add debug flag to print out the new L3 state during transitions. > i965: Work around L3 state leaks during context switches. > i965: Hook up L3 partitioning state atom. > > Jordan Justen (23): > glsl ubo/ssbo: Use enum to track current buffer access type > glsl ubo/ssbo: Split buffer access to insert_buffer_access > glsl ubo/ssbo: Add lower_buffer_access class > glsl ubo/ssbo: Move is_dereferenced_thing_row_major into > lower_buffer_access > glsl ubo/ssbo: Move common code into > lower_buffer_access::setup_buffer_access > glsl: Add default matrix ordering in lower_buffer_access > glsl: Don't lower_variable_index_to_cond_assign for shared variables > glsl: Add lowering pass for shared variable references > nir: Translate glsl shared var load intrinsic to nir intrinsic > nir: Translate glsl shared var store intrinsic to nir intrinsic > i965: Disable vector splitting on shared variables > i965/fs: Handle nir shared variable load intrinsic > i965/fs: Handle nir shared variable store intrinsic function > i965: Enable shared local memory for CS shared variables > i965: Lower shared variable references to intrinsic calls > glsl: Allow atomic functions to be used with shared variables > glsl: Replace atomic_ssbo and ssbo_atomic with atomic > glsl: Check for SSBO variable in SSBO atomic lowering > glsl: Translate atomic intrinsic functions on shared variables > glsl: Buffer atomics are supported for compute shaders > glsl: Disable several optimizations on shared variables > nir: Add nir intrinsics for shared variable atomic operations > i965/nir: Implement shared variable atomic operations > > src/glsl/Makefile.sources | 2 + > src/glsl/ast_function.cpp | 18 +- > src/glsl/builtin_functions.cpp | 236 - > src/glsl/ir_optimization.h | 1 + > src/glsl/linker.cpp| 4 + > src/glsl/lower_buffer_access.cpp | 565 > + > src/glsl/lower_buffer_access.h
Re: [Mesa-dev] [PATCH 2/2] glsl: fix 'shared' layout qualifier related regressions
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Samuel Iglesias Gonsálvez > Sent: Thursday, November 12, 2015 2:23 PM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 2/2] glsl: fix 'shared' layout qualifier related > regressions > > Commit 8b28b35 added 'shared' as a keyword for compute shaders but it > broke the existing 'shared' layout qualifier support for uniform and shader > storage blocks. > > This patch fixes 578 dEQP-GLES31.functional.ssbo.* tests. > > Signed-off-by: Samuel Iglesias Gonsálvez > --- > src/glsl/glsl_parser.yy | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > 4ac8e45..592630e 100644 > --- a/src/glsl/glsl_parser.yy > +++ b/src/glsl/glsl_parser.yy > @@ -1199,8 +1199,6 @@ layout_qualifier_id: >if (!$$.flags.i && state->has_uniform_buffer_objects()) { > if (match_layout_qualifier($1, "std140", state) == 0) { > $$.flags.q.std140 = 1; > - } else if (match_layout_qualifier($1, "shared", state) == 0) { > -$$.flags.q.shared = 1; > } else if (match_layout_qualifier($1, "std430", state) == 0) { > $$.flags.q.std430 = 1; > } else if (match_layout_qualifier($1, "column_major", state) == 0) > { @@ > -1618,6 +1616,15 @@ layout_qualifier_id: > "layout qualifier `%s' is used", $1); >} > } > + | SHARED > + { > + memset(& $$, 0, sizeof($$)); > + > + if (!$$.flags.i && state->has_uniform_buffer_objects()) { > + $$.flags.q.shared = 1; > + $$.flags.q.shared_storage = 0; > + } > + } > ; > > /* This is a separate language rule because we parse these as tokens > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] glsl: enable 'shared' keyword also for layout qualifiers
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Samuel Iglesias Gonsálvez > Sent: Thursday, November 12, 2015 2:23 PM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 1/2] glsl: enable 'shared' keyword also for layout > qualifiers > > 'shared' was added in ARB_uniform_buffer_object and also used in > ARB_shader_storage_buffer_object. > > A later patch will fix the shader layout qualifier regressions in dEQP. > > Signed-off-by: Samuel Iglesias Gonsálvez > --- > src/glsl/glsl_lexer.ll | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll index > e59f93e..fc58ea0 > 100644 > --- a/src/glsl/glsl_lexer.ll > +++ b/src/glsl/glsl_lexer.ll > @@ -414,7 +414,14 @@ writeonly KEYWORD_WITH_ALT(420, 300, 420, > 310, yyextra->ARB_shader_image_lo > > atomic_uint KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra- > >ARB_shader_atomic_counters_enable, ATOMIC_UINT); > > -shared KEYWORD_WITH_ALT(430, 310, 430, 310, yyextra- > >ARB_compute_shader_enable, SHARED); > +shared { > +if ((yyextra->is_version(430, 310)) > + || yyextra- > >ARB_uniform_buffer_object_enable > + || yyextra- > >ARB_shader_storage_buffer_object_enable > + || yyextra->ARB_compute_shader_enable) { > + return SHARED; > +} > + } > > struct return STRUCT; > void return VOID_TOK; > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Monday, November 2, 2015 12:36 PM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with > atomic counter buffers > > Patch sets matrix_stride as 0 for non matrix uniforms that are in a atomic > counter buffer. Matrix stride calculation for actual matrix uniforms is done > during link_assign_uniform_locations. > > From ARB_program_interface_query specification: > > GL_MATRIX_STRIDE: > >"For active variables not declared as a matrix or array of matrices, >zero is written to . For active variables not backed by a >buffer object, -1 is written to , regardless of the variable >type." > > Signed-off-by: Tapani Pälli > --- > src/glsl/link_atomics.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp index > cdcc06d..3aa52db 100644 > --- a/src/glsl/link_atomics.cpp > +++ b/src/glsl/link_atomics.cpp > @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct > gl_context *ctx, > storage->offset = var->data.atomic.offset; > storage->array_stride = (var->type->is_array() ? >var->type->without_array()->atomic_size() > : 0); > + if (!var->type->is_matrix()) > +storage->matrix_stride = 0; >} > >/* Assign stage-specific fields. */ > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/fs/nir: fix the number of register written by FS_OPCODE_GET_BUFFER_SIZE
Nice! This fixes 12 GLES 3.1 CTS tests. > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Samuel Iglesias Gonsálvez > Sent: Wednesday, November 11, 2015 4:07 PM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] i965/fs/nir: fix the number of register written > by FS_OPCODE_GET_BUFFER_SIZE > > FS_OPCODE_GET_BUFFER_SIZE is calculated with a resinfo's sampler > message. > > This patch adjusts the number of registers written by the opcode following > what the PRM spec says about the number of registers written by the SIMD8 > and SIMD16's writeback messages for sampler messages. > > Signed-off-by: Samuel Iglesias Gonsálvez > Cc: tapani.pa...@intel.com > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 +++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > index 02b9f5b..61c9f2e 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > @@ -2297,16 +2297,29 @@ fs_visitor::nir_emit_intrinsic(const fs_builder > &bld, nir_intrinsic_instr *instr >fs_reg source = fs_reg(0); > >int mlen = 1 * reg_width; > + > + /* A resinfo's sampler message is used to get the buffer size. > + * The SIMD8's writeback message consists of four registers and > + * SIMD16's writeback message consists of 8 destination registers > + * (two per each component), although we are only interested on the > + * first component, where resinfo returns the buffer size for > + * SURFTYPE_BUFFER. > + */ > + int regs_written = 4 * mlen; >fs_reg src_payload = fs_reg(GRF, alloc.allocate(mlen), >BRW_REGISTER_TYPE_UD); >bld.LOAD_PAYLOAD(src_payload, &source, 1, 0); > - > + fs_reg buffer_size = fs_reg(GRF, alloc.allocate(regs_written), > + BRW_REGISTER_TYPE_UD); >const unsigned index = prog_data->binding_table.ssbo_start + > ssbo_index; > - fs_inst *inst = bld.emit(FS_OPCODE_GET_BUFFER_SIZE, dest, > + fs_inst *inst = bld.emit(FS_OPCODE_GET_BUFFER_SIZE, buffer_size, > src_payload, fs_reg(index)); >inst->header_size = 0; >inst->mlen = mlen; > + inst->regs_written = regs_written; >bld.emit(inst); > + dest.type = buffer_size.type; > + bld.MOV(dest, buffer_size); > >brw_mark_surface_used(prog_data, index); >break; > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 2/2] mesa: Add spec citations for DispatchCompute*
Reviewed-by: Marta Lofstedt > -Original Message- > From: Justen, Jordan L > Sent: Monday, November 2, 2015 9:36 AM > To: mesa-dev@lists.freedesktop.org > Cc: Justen, Jordan L; Iago Toral Quiroga; Lofstedt, Marta > Subject: [PATCH v2 2/2] mesa: Add spec citations for DispatchCompute* > > Note: The OpenGL 4.3 - 4.5 specification language for DispatchCompute > appears to have an error regarding the max allowed values. When adding the > specification citation, we note why the code does not match the specification > language. > > v2: > * Updates based on review from Iago > > Signed-off-by: Jordan Justen > Cc: Iago Toral Quiroga > Cc: Marta Lofstedt > --- > src/mesa/main/api_validate.c | 34 + > - > 1 file changed, 29 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c > index a3ee8c0..a490189 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -918,6 +918,11 @@ check_valid_to_compute(struct gl_context *ctx, > const char *function) >return false; > } > > + /* From the OpenGL 4.3 Core Specification, Chapter 19, Compute Shaders: > +* > +* "An INVALID_OPERATION error is generated if there is no active > program > +* for the compute shader stage." > +*/ > prog = ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE]; > if (prog == NULL || prog->_LinkedShaders[MESA_SHADER_COMPUTE] == > NULL) { >_mesa_error(ctx, GL_INVALID_OPERATION, @@ -940,6 +945,24 @@ > _mesa_validate_DispatchCompute(struct gl_context *ctx, >return GL_FALSE; > > for (i = 0; i < 3; i++) { > + /* From the OpenGL 4.3 Core Specification, Chapter 19, Compute > Shaders: > + * > + * "An INVALID_VALUE error is generated if any of num_groups_x, > + * num_groups_y and num_groups_z are greater than or equal to the > + * maximum work group count for the corresponding dimension." > + * > + * However, the "or equal to" portions appears to be a specification > + * bug. In all other areas, the specification appears to indicate that > + * the number of workgroups can match the > MAX_COMPUTE_WORK_GROUP_COUNT > + * value. For example, under DispatchComputeIndirect: > + * > + * "If any of num_groups_x, num_groups_y or num_groups_z is greater > than > + * the value of MAX_COMPUTE_WORK_GROUP_COUNT for the > corresponding > + * dimension then the results are undefined." > + * > + * Additionally, the OpenGLES 3.1 specification does not contain "or > + * equal to" as an error condition. > + */ >if (num_groups[i] > ctx->Const.MaxComputeWorkGroupCount[i]) { > _mesa_error(ctx, GL_INVALID_VALUE, > "glDispatchCompute(num_groups_%c)", 'x' + i); @@ -977,6 > +1000,12 @@ valid_dispatch_indirect(struct gl_context *ctx, >return GL_FALSE; > } > > + /* From the OpenGL 4.3 Core Specification, Chapter 19, Compute Shaders: > +* > +* "An INVALID_OPERATION error is generated if no buffer is bound to the > +* DRAW_INDIRECT_BUFFER binding, or if the command would source > data > +* beyond the end of the buffer object." > +*/ > if (!_mesa_is_bufferobj(ctx->DispatchIndirectBuffer)) { >_mesa_error(ctx, GL_INVALID_OPERATION, >"%s: no buffer bound to DISPATCH_INDIRECT_BUFFER", name); > @@ -989,11 +1018,6 @@ valid_dispatch_indirect(struct gl_context *ctx, >return GL_FALSE; > } > > - /* From the ARB_compute_shader specification: > -* > -* "An INVALID_OPERATION error is generated if this command sources > data > -* beyond the end of the buffer object [...]" > -*/ > if (ctx->DispatchIndirectBuffer->Size < end) { >_mesa_error(ctx, GL_INVALID_OPERATION, >"%s(DISPATCH_INDIRECT_BUFFER too small)", name); > -- > 2.6.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/2] mesa: Update DispatchComputeIndirect errors for indirect parameter
Reviewed-by: Marta Lofstedt > -Original Message- > From: Justen, Jordan L > Sent: Monday, November 2, 2015 9:36 AM > To: mesa-dev@lists.freedesktop.org > Cc: Justen, Jordan L; Iago Toral Quiroga; Lofstedt, Marta > Subject: [PATCH v2 1/2] mesa: Update DispatchComputeIndirect errors for > indirect parameter > > There is some discrepancy between the return values for some error cases > for the DispatchComputeIndirect call in the ARB_compute_shader > specification. Regarding the indirect parameter, in one place the extension > spec lists that the error returned for invalid values should be > INVALID_OPERATION, while later it specifies INVALID_VALUE. > > The OpenGL 4.3 and OpenGLES 3.1 specifications appear to be consistent in > requiring the INVALID_VALUE error return in this case. > > Here we update the code to match the main specifications, and update the > citations use the main specification rather than the extension specification. > > v2: > * Updates based on review from Iago > > Signed-off-by: Jordan Justen > Cc: Iago Toral Quiroga > Cc: Marta Lofstedt > --- > src/mesa/main/api_validate.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c > index 1f729e8..a3ee8c0 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -960,20 +960,19 @@ valid_dispatch_indirect(struct gl_context *ctx, > if (!check_valid_to_compute(ctx, name)) >return GL_FALSE; > > - /* From the ARB_compute_shader specification: > + /* From the OpenGL 4.3 Core Specification, Chapter 19, Compute Shaders: > * > -* "An INVALID_OPERATION error is generated [...] if is less > -* than zero or not a multiple of the size, in basic machine units, of > -* uint." > +* "An INVALID_VALUE error is generated if indirect is negative or is not > a > +* multiple of four." > */ > if ((GLintptr)indirect & (sizeof(GLuint) - 1)) { > - _mesa_error(ctx, GL_INVALID_OPERATION, > + _mesa_error(ctx, GL_INVALID_VALUE, >"%s(indirect is not aligned)", name); >return GL_FALSE; > } > > if ((GLintptr)indirect < 0) { > - _mesa_error(ctx, GL_INVALID_OPERATION, > + _mesa_error(ctx, GL_INVALID_VALUE, >"%s(indirect is less than zero)", name); >return GL_FALSE; > } > -- > 2.6.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: remove redundant function inout assignments
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Timothy Arceri > Sent: Sunday, November 1, 2015 9:33 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: remove redundant function inout > assignments > > Handles the case with function inout params where array elements do an > assignment to themselves e.g. > > void array_mod(inout int b[2]) > { > b[0] = int(2); > b[1] = b[1]; > } > > Fixes assert in nir for: > ES31-CTS.arrays_of_arrays.InteractionFunctionCalls2 > > https://bugs.freedesktop.org/show_bug.cgi?id=92588 > --- > src/glsl/opt_copy_propagation_elements.cpp | 46 > ++ > 1 file changed, 46 insertions(+) > > Piglit test: https://patchwork.freedesktop.org/patch/63355/ > > diff --git a/src/glsl/opt_copy_propagation_elements.cpp > b/src/glsl/opt_copy_propagation_elements.cpp > index 353a5c6..a62b625 100644 > --- a/src/glsl/opt_copy_propagation_elements.cpp > +++ b/src/glsl/opt_copy_propagation_elements.cpp > @@ -439,6 +439,8 @@ ir_copy_propagation_elements_visitor::kill(kill_entry > *k) > /** > * Adds directly-copied channels between vector variables to the available > * copy propagation list. > + * > + * Also tidy up redundant function inout assignments while we are here. > */ > void > ir_copy_propagation_elements_visitor::add_copy(ir_assignment *ir) @@ - > 450,6 +452,50 @@ > ir_copy_propagation_elements_visitor::add_copy(ir_assignment *ir) > if (ir->condition) >return; > > + /* Handle a corner case with function inout params where array elements > +* do an assignment to themselves e.g. > +* > +* void array_mod(inout int b[2]) > +* { > +*b[0] = int(2); > +*b[1] = b[1]; > +* } > +*/ > + ir_rvalue *rhs_array = ir->rhs; > + ir_rvalue *lhs_array = ir->lhs; > + if (lhs_array->as_dereference_array() && > + rhs_array->as_dereference_array()) { > + /* Check arrays are indexed by a const and match otherwise return */ > + while (rhs_array->as_dereference_array() && > + lhs_array->as_dereference_array()) { > + > + ir_dereference_array *rhs_deref_array = > +rhs_array->as_dereference_array(); > + ir_dereference_array *lhs_deref_array = > +lhs_array->as_dereference_array(); > + > + ir_constant *lhs_ai_const = > +lhs_deref_array->array_index->as_constant(); > + ir_constant *rhs_ai_const = > +rhs_deref_array->array_index->as_constant(); > + if (lhs_ai_const == NULL || rhs_ai_const == NULL || > + lhs_ai_const->value.i[0] != rhs_ai_const->value.i[0]) > +return; > + lhs_array = lhs_deref_array->array; > + rhs_array = rhs_deref_array->array; > + } > + > + ir_dereference_variable *lhs_var = lhs_array- > >as_dereference_variable(); > + ir_dereference_variable *rhs_var = rhs_array- > >as_dereference_variable(); > + if(lhs_var && rhs_var && lhs_var->var == rhs_var->var){ > + /* Removing the assignment now would mess up the loop > iteration > + * calling us. Just flag it to not execute, and someone else > + * will clean up the mess. > + */ > + ir->condition = new(ralloc_parent(ir)) ir_constant(false); > + } > + } > + > ir_dereference_variable *lhs = ir->lhs->as_dereference_variable(); > if (!lhs || !(lhs->type->is_scalar() || lhs->type->is_vector())) >return; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: fix program resource queries for atomic counter buffers
> -Original Message- > From: Palli, Tapani > Sent: Friday, October 30, 2015 11:43 AM > To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > Cc: curroje...@riseup.net > Subject: Re: [PATCH] mesa: fix program resource queries for atomic counter > buffers > > > > On 10/30/2015 12:36 PM, Lofstedt, Marta wrote: > > > >> -Original Message- > >> From: Palli, Tapani > >> Sent: Friday, October 30, 2015 11:03 AM > >> To: mesa-dev@lists.freedesktop.org > >> Cc: Lofstedt, Marta; curroje...@riseup.net; Palli, Tapani > >> Subject: [PATCH] mesa: fix program resource queries for atomic > >> counter buffers > >> > >> gl_active_atomic_buffer contains index to UniformStorage, we need to > >> calculate resource index for that gl_uniform_storage. > >> > >> Fixes following CTS tests: > >> ES31-CTS.program_interface_query.atomic-counters > >> ES31-CTS.program_interface_query.atomic-counters-one-buffer > >> > >> No Piglit regressions. > >> > >> Signed-off-by: Tapani Pälli > >> --- > >> src/mesa/main/shader_query.cpp | 28 > ++-- > >> 1 file changed, 26 insertions(+), 2 deletions(-) > >> > >> diff --git a/src/mesa/main/shader_query.cpp > >> b/src/mesa/main/shader_query.cpp index 59ec3d7..6e0251a 100644 > >> --- a/src/mesa/main/shader_query.cpp > >> +++ b/src/mesa/main/shader_query.cpp > >> @@ -668,6 +668,20 @@ _mesa_program_resource_index(struct > >> gl_shader_program *shProg, > >> } > >> } > >> > >> +/** > >> + * Find a program resource that points to given data. > >> + */ > >> +static struct gl_program_resource* > >> +program_resource_find_data(struct gl_shader_program *shProg, void > >> +*data) { > >> + struct gl_program_resource *res = shProg->ProgramResourceList; > >> + for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) { > >> + if (res->Data == data) > >> + return res; > >> + } > >> + return NULL; > >> +} > >> + > >> /* Find a program resource with specific index in given interface. > >>*/ > >> struct gl_program_resource * > >> @@ -1065,8 +1079,18 @@ get_buffer_property(struct > gl_shader_program > >> *shProg, > >>*val = RESOURCE_ATC(res)->NumUniforms; > >>return 1; > >> case GL_ACTIVE_VARIABLES: > >> - for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) > >> -*val++ = RESOURCE_ATC(res)->Uniforms[i]; > >> + for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) { > >> +/* Active atomic buffer contains index to UniformStorage. Find > >> + * out gl_program_resource via data pointer and then calculate > >> + * index of that uniform. > >> + */ > >> +unsigned idx = RESOURCE_ATC(res)->Uniforms[i]; > >> +struct gl_program_resource *uni = > >> + program_resource_find_data(shProg, > >> + &shProg->UniformStorage[idx]); > >> +assert(uni); > >> +*val++ = _mesa_program_resource_index(shProg, uni); > >> + } > > > > The parts GL_SHADER_STORAGE_BLOCK looks very similar to the > GL_UNIFORM_BLOCK above. Should this code duplication, be avoided? > > You mean parts above not related to this patch? You are welcome to try > :) I had originally different looking version: > > http://lists.freedesktop.org/archives/mesa-dev/2015-March/079310.html > > I don't have strong preference though. > if you'd set an Glenum programInterface to GL_UNIFORM or GL_BUFFER_VARIABLE to send to _mesa_program_resource_find_name, you would not have had to write the same thing twice :) Then the GL_NUM_ACTIVE_VARIABLES and the GL_ACTIVE_VARIABLES cases are also very similar... Never mind, I don't have any strong opinions either... Reviewed-by: Marta Lofstedt > > >>return RESOURCE_ATC(res)->NumUniforms; > >> } > >> } > >> -- > >> 2.4.3 > > > > > // Tapani ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: fix program resource queries for atomic counter buffers
> -Original Message- > From: Palli, Tapani > Sent: Friday, October 30, 2015 11:03 AM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; curroje...@riseup.net; Palli, Tapani > Subject: [PATCH] mesa: fix program resource queries for atomic counter > buffers > > gl_active_atomic_buffer contains index to UniformStorage, we need to > calculate resource index for that gl_uniform_storage. > > Fixes following CTS tests: >ES31-CTS.program_interface_query.atomic-counters >ES31-CTS.program_interface_query.atomic-counters-one-buffer > > No Piglit regressions. > > Signed-off-by: Tapani Pälli > --- > src/mesa/main/shader_query.cpp | 28 ++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/main/shader_query.cpp > b/src/mesa/main/shader_query.cpp index 59ec3d7..6e0251a 100644 > --- a/src/mesa/main/shader_query.cpp > +++ b/src/mesa/main/shader_query.cpp > @@ -668,6 +668,20 @@ _mesa_program_resource_index(struct > gl_shader_program *shProg, > } > } > > +/** > + * Find a program resource that points to given data. > + */ > +static struct gl_program_resource* > +program_resource_find_data(struct gl_shader_program *shProg, void > +*data) { > + struct gl_program_resource *res = shProg->ProgramResourceList; > + for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) { > + if (res->Data == data) > + return res; > + } > + return NULL; > +} > + > /* Find a program resource with specific index in given interface. > */ > struct gl_program_resource * > @@ -1065,8 +1079,18 @@ get_buffer_property(struct gl_shader_program > *shProg, > *val = RESOURCE_ATC(res)->NumUniforms; > return 1; >case GL_ACTIVE_VARIABLES: > - for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) > -*val++ = RESOURCE_ATC(res)->Uniforms[i]; > + for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) { > +/* Active atomic buffer contains index to UniformStorage. Find > + * out gl_program_resource via data pointer and then calculate > + * index of that uniform. > + */ > +unsigned idx = RESOURCE_ATC(res)->Uniforms[i]; > +struct gl_program_resource *uni = > + program_resource_find_data(shProg, > + &shProg->UniformStorage[idx]); > +assert(uni); > +*val++ = _mesa_program_resource_index(shProg, uni); > + } The parts GL_SHADER_STORAGE_BLOCK looks very similar to the GL_UNIFORM_BLOCK above. Should this code duplication, be avoided? > return RESOURCE_ATC(res)->NumUniforms; >} > } > -- > 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: DispatchComputeIndirect should return INVALID_VALUE on unaligned
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Jordan Justen > Sent: Friday, October 30, 2015 8:32 AM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH] mesa: DispatchComputeIndirect should > return INVALID_VALUE on unaligned > > I sent a patch on Oct 14 for this: > > "main: Match DispatchCompute* API validation from main specification" > > http://patchwork.freedesktop.org/patch/61881/ Sorry missed that one, consider my patch obsolete... > > You might want monitor my cs git branch for related patches to help with the > OpenGLES 3.1 CTS compute shader tests. Currently I am focusing > > -Jordan > > On 2015-10-29 07:23:33, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > From the ARB_compute_shader specification: > > > > "An INVALID_OPERATION error is generated [...] if is less > > than zero or not a multiple of the size, in basic machine units, of > > uint." > > > > However, OpenGL ES 3.1 specification, section 17 and OpenGL 4.5 > > specification, section 19, has the updated definition: > > > > "An INVALID_VALUE error is generated if indirect is negative or is not > > a multiple of the size, in basic machine units, of uint." > > > > Mesa should use the updated version. > > --- > > src/mesa/main/api_validate.c | 11 ++- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/src/mesa/main/api_validate.c > > b/src/mesa/main/api_validate.c index 06efe02..9ee8252 100644 > > --- a/src/mesa/main/api_validate.c > > +++ b/src/mesa/main/api_validate.c > > @@ -960,14 +960,15 @@ valid_dispatch_indirect(struct gl_context *ctx, > > if (!check_valid_to_compute(ctx, name)) > >return GL_FALSE; > > > > - /* From the ARB_compute_shader specification: > > + /* From the OpenGL ES 3.1 specification, section 17 and the > > +* OpenGL 4.5 specification, section 19: > > * > > -* "An INVALID_OPERATION error is generated [...] if is less > > -* than zero or not a multiple of the size, in basic machine units, of > > -* uint." > > +* "An INVALID_VALUE error is generated if indirect is negative > > +*or is not a multiple of the size, in basic machine units, > > +*of uint." > > */ > > if ((GLintptr)indirect & (sizeof(GLuint) - 1)) { > > - _mesa_error(ctx, GL_INVALID_OPERATION, > > + _mesa_error(ctx, GL_INVALID_VALUE, > >"%s(indirect is not aligned)", name); > >return GL_FALSE; > > } > > -- > > 2.1.4 > > > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] main/get: Add MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Jordan Justen > Sent: Thursday, October 29, 2015 8:48 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] main/get: Add > MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS > > Signed-off-by: Jordan Justen > --- > src/mesa/main/get_hash_params.py | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/main/get_hash_params.py > b/src/mesa/main/get_hash_params.py > index c295615..fbc7b8f 100644 > --- a/src/mesa/main/get_hash_params.py > +++ b/src/mesa/main/get_hash_params.py > @@ -460,6 +460,7 @@ descriptor=[ >[ "MAX_COMPUTE_UNIFORM_COMPONENTS", > "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), > extra_ARB_compute_shader_es31" ], >[ "MAX_COMPUTE_IMAGE_UNIFORMS", > "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), > extra_ARB_compute_shader_es31" ], >[ "DISPATCH_INDIRECT_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, > extra_ARB_compute_shader_es31" ], > + [ "MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS", > "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxCombinedU > niformComponents), extra_ARB_compute_shader_es31" ], > > # GL_ARB_framebuffer_no_attachments / GLES 3.1 >["MAX_FRAMEBUFFER_WIDTH", > "CONTEXT_INT(Const.MaxFramebufferWidth), > extra_ARB_framebuffer_no_attachments"], > -- > 2.5.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] mesa/sso: Add compute shader support
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Jordan Justen > Sent: Thursday, October 29, 2015 8:52 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 2/2] mesa/sso: Add compute shader support > > Signed-off-by: Jordan Justen > --- > src/mesa/main/api_validate.c | 2 +- > src/mesa/main/pipelineobj.c | 11 +++ > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c > index c59b6f3..46f39e7 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -923,7 +923,7 @@ check_valid_to_compute(struct gl_context *ctx, > const char *function) > * "An INVALID_OPERATION error is generated if there is no active program > * for the compute shader stage." > */ > - prog = ctx->Shader.CurrentProgram[MESA_SHADER_COMPUTE]; > + prog = ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE]; > if (prog == NULL || prog->_LinkedShaders[MESA_SHADER_COMPUTE] == > NULL) { >_mesa_error(ctx, GL_INVALID_OPERATION, >"%s(no active compute shader)", diff --git > a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index > c8c50fa..58730f4 100644 > --- a/src/mesa/main/pipelineobj.c > +++ b/src/mesa/main/pipelineobj.c > @@ -255,6 +255,8 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield > stages, GLuint program) > if (_mesa_has_tessellation(ctx)) >any_valid_stages |= GL_TESS_CONTROL_SHADER_BIT | >GL_TESS_EVALUATION_SHADER_BIT; > + if (_mesa_has_compute_shaders(ctx)) > + any_valid_stages |= GL_COMPUTE_SHADER_BIT; > > if (stages != GL_ALL_SHADER_BITS && (stages & ~any_valid_stages) != 0) { >_mesa_error(ctx, GL_INVALID_VALUE, "glUseProgramStages(Stages)"); > @@ -336,6 +338,9 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield > stages, GLuint program) > > if ((stages & GL_TESS_EVALUATION_SHADER_BIT) != 0) >_mesa_use_shader_program(ctx, GL_TESS_EVALUATION_SHADER, > shProg, pipe); > + > + if ((stages & GL_COMPUTE_SHADER_BIT) != 0) > + _mesa_use_shader_program(ctx, GL_COMPUTE_SHADER, shProg, > pipe); > } > > /** > @@ -669,6 +674,12 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, > GLenum pname, GLint *params) >*params = pipe->CurrentProgram[MESA_SHADER_FRAGMENT] > ? pipe->CurrentProgram[MESA_SHADER_FRAGMENT]->Name : 0; >return; > + case GL_COMPUTE_SHADER: > + if (!_mesa_has_compute_shaders(ctx)) > + break; > + *params = pipe->CurrentProgram[MESA_SHADER_COMPUTE] > + ? pipe->CurrentProgram[MESA_SHADER_COMPUTE]->Name : 0; > + return; > default: >break; > } > -- > 2.5.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: Add compute shader builtin variables for OpenGLES 3.1
Thanks for your recent patches, they make big difference for the gles 3.1 CTS results! Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Jordan Justen > Sent: Thursday, October 29, 2015 8:46 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: Add compute shader builtin variables for > OpenGLES 3.1 > > Signed-off-by: Jordan Justen > --- > src/glsl/builtin_variables.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp > index > a6ad105..00113d5 100644 > --- a/src/glsl/builtin_variables.cpp > +++ b/src/glsl/builtin_variables.cpp > @@ -710,7 +710,7 @@ builtin_variable_generator::generate_constants() >} > } > > - if (state->is_version(430, 0) || state->ARB_compute_shader_enable) { > + if (state->is_version(430, 310) || state->ARB_compute_shader_enable) > + { >add_const("gl_MaxComputeAtomicCounterBuffers", > MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS); >add_const("gl_MaxComputeAtomicCounters", > MAX_COMPUTE_ATOMIC_COUNTERS); >add_const("gl_MaxComputeImageUniforms", > MAX_COMPUTE_IMAGE_UNIFORMS); > -- > 2.5.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: OpenGLES GLSL 3.1 precision qualifiers ordering rules
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Jordan Justen > Sent: Thursday, October 29, 2015 8:47 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: OpenGLES GLSL 3.1 precision qualifiers > ordering rules > > The OpenGLES GLSL 3.1 specification uses the precision qualifier ordering > rules from ARB_shading_language_420pack. > > Signed-off-by: Jordan Justen > --- > src/glsl/glsl_parser.yy | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > 2f2e10d..4636435 100644 > --- a/src/glsl/glsl_parser.yy > +++ b/src/glsl/glsl_parser.yy > @@ -948,7 +948,8 @@ parameter_qualifier: >if ($2.precision != ast_precision_none) > _mesa_glsl_error(&@1, state, "duplicate precision qualifier"); > > - if (!state->has_420pack() && $2.flags.i != 0) > + if (!(state->has_420pack() || state->is_version(420, 310)) && > + $2.flags.i != 0) > _mesa_glsl_error(&@1, state, "precision qualifiers must come last"); > >$$ = $2; > @@ -1847,7 +1848,8 @@ type_qualifier: >if ($2.precision != ast_precision_none) > _mesa_glsl_error(&@1, state, "duplicate precision qualifier"); > > - if (!state->has_420pack() && $2.flags.i != 0) > + if (!(state->has_420pack() || state->is_version(420, 310)) && > + $2.flags.i != 0) > _mesa_glsl_error(&@1, state, "precision qualifiers must come last"); > >$$ = $2; > -- > 2.5.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] glsl: add fragdata arrays to program resource list
Reviewed-by: Marta Lofstedt > -Original Message- > From: Palli, Tapani > Sent: Tuesday, October 27, 2015 12:19 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Palli, Tapani > Subject: [PATCH 2/2] glsl: add fragdata arrays to program resource list > > This makes sure that user is still able to query properties about variables > that > have gotten removed by opt_dead_builtin_varyings pass. > > Fixes following OpenGL ES 3.1 test: >ES31-CTS.program_interface_query.output-layout > > No Piglit regressions. > > Signed-off-by: Tapani Pälli > --- > src/glsl/linker.cpp | 29 + > 1 file changed, 29 insertions(+) > > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index cfd8f81..e9660fc > 100644 > --- a/src/glsl/linker.cpp > +++ b/src/glsl/linker.cpp > @@ -3386,6 +3386,12 @@ add_interface_variables(struct > gl_shader_program *shProg, >if (strncmp(var->name, "packed:", 7) == 0) > continue; > > + /* Skip fragdata arrays, these are handled separately > + * by add_fragdata_arrays. > + */ > + if (strncmp(var->name, "gl_out_FragData", 15) == 0) > + continue; > + >if (!add_program_resource(shProg, programInterface, var, > build_stageref(shProg, var->name, > var->data.mode) | mask)) @@ > -3425,6 +3431,26 @@ > add_packed_varyings(struct gl_shader_program *shProg, int stage) > return true; > } > > +static bool > +add_fragdata_arrays(struct gl_shader_program *shProg) { > + struct gl_shader *sh = shProg- > >_LinkedShaders[MESA_SHADER_FRAGMENT]; > + > + if (!sh || !sh->fragdata_arrays) > + return true; > + > + foreach_in_list(ir_instruction, node, sh->fragdata_arrays) { > + ir_variable *var = node->as_variable(); > + if (var) { > + assert(var->data.mode == ir_var_shader_out); > + if (!add_program_resource(shProg, GL_PROGRAM_OUTPUT, var, > + (1 << MESA_SHADER_FRAGMENT))) > +return false; > + } > + } > + return true; > +} > + > static char* > get_top_level_name(const char *name) > { > @@ -3701,6 +3727,9 @@ build_program_resource_list(struct > gl_shader_program *shProg) > return; > } > > + if (!add_fragdata_arrays(shProg)) > + return; > + > /* Add inputs and outputs to the resource list. */ > if (!add_interface_variables(shProg, shProg- > >_LinkedShaders[input_stage]->ir, > GL_PROGRAM_INPUT)) > -- > 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] mesa: add fragdata_arrays list to gl_shader
Reviewed-by: Marta Lofstedt > -Original Message- > From: Palli, Tapani > Sent: Tuesday, October 27, 2015 12:19 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Palli, Tapani > Subject: [PATCH 1/2] mesa: add fragdata_arrays list to gl_shader > > This is required to store information about fragdata arrays, currently these > variables get lost and cannot be retrieved later in sensible way for program > interface queries. List will be utilized by next patch. > > Patch also modifies opt_dead_builtin_varyings pass to build list when > lowering fragdata arrays. This is identical approach as taken with packed > varyings pass. > > Signed-off-by: Tapani Pälli > --- > src/glsl/opt_dead_builtin_varyings.cpp | 42 +-- > --- > src/mesa/main/mtypes.h | 1 + > 2 files changed, 27 insertions(+), 16 deletions(-) > > diff --git a/src/glsl/opt_dead_builtin_varyings.cpp > b/src/glsl/opt_dead_builtin_varyings.cpp > index 31719d2..68b70ee 100644 > --- a/src/glsl/opt_dead_builtin_varyings.cpp > +++ b/src/glsl/opt_dead_builtin_varyings.cpp > @@ -269,14 +269,14 @@ public: > */ > class replace_varyings_visitor : public ir_rvalue_visitor { > public: > - replace_varyings_visitor(exec_list *ir, > + replace_varyings_visitor(struct gl_shader *sha, > const varying_info_visitor *info, > unsigned external_texcoord_usage, > unsigned external_color_usage, > bool external_has_fog) > - : info(info), new_fog(NULL) > + : shader(sha), info(info), new_fog(NULL) > { > - void *const ctx = ir; > + void *const ctx = shader->ir; > >memset(this->new_fragdata, 0, sizeof(this->new_fragdata)); >memset(this->new_texcoord, 0, sizeof(this->new_texcoord)); @@ - > 293,14 +293,16 @@ public: > * occurrences of gl_TexCoord will be replaced with. > */ >if (info->lower_texcoord_array) { > - prepare_array(ir, this->new_texcoord, ARRAY_SIZE(this- > >new_texcoord), > + prepare_array(shader->ir, this->new_texcoord, > + ARRAY_SIZE(this->new_texcoord), > VARYING_SLOT_TEX0, "TexCoord", mode_str, > info->texcoord_usage, external_texcoord_usage); >} > >/* Handle gl_FragData in the same way like gl_TexCoord. */ >if (info->lower_fragdata_array) { > - prepare_array(ir, this->new_fragdata, ARRAY_SIZE(this- > >new_fragdata), > + prepare_array(shader->ir, this->new_fragdata, > + ARRAY_SIZE(this->new_fragdata), > FRAG_RESULT_DATA0, "FragData", mode_str, > info->fragdata_usage, (1 << MAX_DRAW_BUFFERS) - 1); >} > @@ -340,7 +342,7 @@ public: >} > >/* Now do the replacing. */ > - visit_list_elements(this, ir); > + visit_list_elements(this, shader->ir); > } > > void prepare_array(exec_list *ir, > @@ -389,6 +391,13 @@ public: >/* Remove the gl_FragData array. */ >if (this->info->lower_fragdata_array && >var == this->info->fragdata_array) { > + > + /* Clone variable for program resource list before it is removed. */ > + if (!shader->fragdata_arrays) > +shader->fragdata_arrays = new (shader) exec_list; > + > + shader->fragdata_arrays->push_tail(var->clone(shader, NULL)); > + > var->remove(); >} > > @@ -487,6 +496,7 @@ public: > } > > private: > + struct gl_shader *shader; > const varying_info_visitor *info; > ir_variable *new_fragdata[MAX_DRAW_BUFFERS]; > ir_variable *new_texcoord[MAX_TEXTURE_COORD_UNITS]; > @@ -498,20 +508,20 @@ private: > } /* anonymous namespace */ > > static void > -lower_texcoord_array(exec_list *ir, const varying_info_visitor *info) > +lower_texcoord_array(struct gl_shader *shader, const > +varying_info_visitor *info) > { > - replace_varyings_visitor(ir, info, > + replace_varyings_visitor(shader, info, > (1 << MAX_TEXTURE_COORD_UNITS) - 1, > 1 | 2, true); } > > static void > -lower_fragdata_array(exec_list *ir) > +lower_fragdata_array(struct gl_shader *shader) > { > varying_info_visitor info(ir_var_shader_out, true); > - info.get(ir, 0, NULL); > + info.get(shader->ir, 0, NULL); > > - replace_varyings_vi
Re: [Mesa-dev] [PATCH 2/4] mesa: Draw Indirect is not allowed when no vertex array binding exists.
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Wednesday, October 21, 2015 1:25 PM > To: Marek Olšák > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 2/4] mesa: Draw Indirect is not allowed > when no vertex array binding exists. > > On 10/21/2015 01:41 PM, Marek Olšák wrote: > > On Wed, Oct 21, 2015 at 7:16 AM, Tapani Pälli > wrote: > >> On 10/20/2015 08:54 PM, Marek Olšák wrote: > >>> On Tue, Oct 20, 2015 at 4:19 PM, Marta Lofstedt > >>> wrote: > From: Marta Lofstedt > > OpenGL ES 3.1 spec. section 10.5: > "An INVALID_OPERATION error is generated if zero is bound to > VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to any enabled > vertex > array." > > Signed-off-by: Marta Lofstedt > --- > src/mesa/main/api_validate.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/src/mesa/main/api_validate.c > b/src/mesa/main/api_validate.c index c5628f5..7062cbd 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -711,6 +711,20 @@ valid_draw_indirect(struct gl_context *ctx, > return GL_FALSE; > } > > + /* > +* OpenGL ES 3.1 spec. section 10.5: > +* "An INVALID_OPERATION error is generated if zero is bound to > +* VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to any > enabled > +* vertex array." > +* OpenGL 4.5 spec. section 10.4: > +* "An INVALID_OPERATION error is generated if zero is bound to > +* DRAW_INDIRECT_BUFFER, or if no element array buffer is bound" > +*/ > + if (!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "%s(No VBO is bound)", name); > + } > >>> NAK. > >>> > >>> VERTEX_ARRAY_BINDING is a VAO. Array.ArrayBufferObj is from > glBindBuffer. > >> > >> This check is valid, it is not against VERTEX_ARRAY_BINDING. Note > >> "any enabled vertex array", we hit this weird situation when client > >> has a VAO bound and has enabled vertex attrib array but has not bound > any VBO to it. > > No, it's invalid. The check has absolutely nothing to do with enabled > > vertex arrays and draw calls. Absolutely nothing. glBindBuffer changes > > a latched state, which means it doesn't do anything by itself, it only > > affects other functions that change states. The functions affected by > > glBindBuffer(GL_ARRAY_BUFFER, ..) are glVertexAttribPointer, etc. not > > glDraw*. If you called glBindBuffer(GL_ARRAY_BUFFER, ..) right before > > a Draw call, it wouldn't do anything to vertex arrays and buffers, but > > it would pass the check. > > OK my understanding was that reason why this change fixes the bug is that > ctx->Array.ArrayBufferObj is 0 for the default VAO and never 0 when vertex > array buffer binding has been set, and this would happen when we would > have an VBO bound. I will spend some more time to understand this. If you have access to the CTS it is these tests that this fixed: ES31-CTS.draw_indirect.negative-noVBO-arrays ES31-CTS.draw_indirect.negative-noVBO-elements My understanding is as Tapanis above, I was trying to come up with a method of not needing to loop through the VertexAttribPointers. Also, I have mis-quoted the spec. I should have only quoted the: "or any enabled vertex arrays" and limit to gles 3.1. > > > Now, where does this patch check "enabled vertex arrays"? Nowhere. It > > doesn't check VERTEX_ARRAY_BINDING, it doesn't check > > DRAW_INDIRECT_BUFFER, and it doesn't check enabled vertex arrays. That > > whole comment is completely useless there. > > > > Sorry if I'm too direct, but you should really think more before > > making such statements and giving Reviewed-by. > > // Tapani > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling UniformRemapTable
> -Original Message- > From: Palli, Tapani > Sent: Tuesday, October 20, 2015 12:55 PM > To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling > UniformRemapTable > > > > On 10/20/2015 01:40 PM, Lofstedt, Marta wrote: > >> -Original Message- > >> From: Palli, Tapani > >> Sent: Tuesday, October 20, 2015 12:25 PM > >> To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > >> Subject: Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when > >> filling UniformRemapTable > >> > >> > >> > >> On 10/20/2015 01:11 PM, Lofstedt, Marta wrote: > >>> > >>> If you also remove the uniforms[i].array_elements in the same > >>> manner, > >> the assert in: > >>> ES31-CTS.explicit_uniform_location.uniform-loc-arrays-of-arrays > >>> Is also avoided. > >> > >> Are you referring to one of the loops iterating uniforms in this same > >> place the patch is touching? > > > > Yes, I hit the same assert in "uniform-loc-structs" and "uniform-loc-arrays- > of-arrays", with your patchset I no longer hit the assert for the > "uniform-loc- > structs" tests. > > > > If I also remove array_elements I also avoid the assert in "uniform-loc- > arrays-of-arrays". This is just an observation, not a suggestion of a fix. > > Right, I was not sure at first what you meant by 'removing array_elements'. I > was hoping arrays-of-arrays to be the same case as with loc-structs but > unfortunately seems quite different, we just lack some support for arrays of > arrays here. Will dig more! The arrays test is another problem... This patch-set solves the problem it set out to solve, so I consider the whole patchset: Reviewed-by: Marta Lofstedt > > > >> > >> For me it looks like the problem with arrays-of-arrays test is that > >> it will assign overlapping locations currently for uniforms if we have > >> 'arrays > of arrays' > >> situation going on. > >> > >> For example with > >> > >> layout(location = 0) uniform float uni[2][2] > >> > >> uni[0] gets location 0, but uni[1] has gets location 0 too. I haven't > >> quite figured out yet where the issue is but the location counter > >> gets reset for each array item and starts again from 0 while it > >> should actually maintain its count .. > >> > >> > >>>> -Original Message- > >>>> From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > >>>> Behalf Of Tapani Pälli > >>>> Sent: Tuesday, October 20, 2015 11:24 AM > >>>> To: mesa-dev@lists.freedesktop.org > >>>> Subject: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when > >>>> filling UniformRemapTable > >>>> > >>>> UniformRemapTable is used only for remapping user specified uniform > >>>> locations to driver internally used ones, shader storage buffer > >>>> variables should not utilize uniform locations. > >>>> > >>>> Signed-off-by: Tapani Pälli > >>>> --- > >>>>src/glsl/link_uniforms.cpp | 7 +-- > >>>>1 file changed, 5 insertions(+), 2 deletions(-) > >>>> > >>>> diff --git a/src/glsl/link_uniforms.cpp > >>>> b/src/glsl/link_uniforms.cpp index > >>>> fe00aa3..f7b87a1 100644 > >>>> --- a/src/glsl/link_uniforms.cpp > >>>> +++ b/src/glsl/link_uniforms.cpp > >>>> @@ -1180,7 +1180,8 @@ link_assign_uniform_locations(struct > >>>> gl_shader_program *prog, > >>>> > >>>> /* Reserve all the explicit locations of the active uniforms. */ > >>>> for (unsigned i = 0; i < num_uniforms; i++) { > >>>> - if (uniforms[i].type->is_subroutine()) > >>>> + if (uniforms[i].type->is_subroutine() || > >>>> + uniforms[i].is_shader_storage) > >>>> continue; > >>>> > >>>> if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) { > >>>> @@ > >>>> - > >>>> 1200,8 +1201,10 @@ link_assign_uniform_locations(struct > >>>> gl_shader_program *prog, > >>>> /* Reserve locations for rest of the uniforms. */ > >>>> for (unsigned i = 0; i < num_uniforms; i++) { > >>>> > >>>> - if (uniforms[i].type->is_subroutine()) > >>>> + if (uniforms[i].type->is_subroutine() || > >>>> + uniforms[i].is_shader_storage) > >>>> continue; > >>>> + > >>>> /* Built-in uniforms should not get any location. */ > >>>> if (uniforms[i].builtin) > >>>> continue; > >>>> -- > >>>> 2.4.3 > >>>> > >>>> ___ > >>>> mesa-dev mailing list > >>>> mesa-dev@lists.freedesktop.org > >>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling UniformRemapTable
> -Original Message- > From: Palli, Tapani > Sent: Tuesday, October 20, 2015 12:25 PM > To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling > UniformRemapTable > > > > On 10/20/2015 01:11 PM, Lofstedt, Marta wrote: > > > > If you also remove the uniforms[i].array_elements in the same manner, > the assert in: > > ES31-CTS.explicit_uniform_location.uniform-loc-arrays-of-arrays > > Is also avoided. > > Are you referring to one of the loops iterating uniforms in this same place > the > patch is touching? Yes, I hit the same assert in "uniform-loc-structs" and "uniform-loc-arrays-of-arrays", with your patchset I no longer hit the assert for the "uniform-loc-structs" tests. If I also remove array_elements I also avoid the assert in "uniform-loc-arrays-of-arrays". This is just an observation, not a suggestion of a fix. > > For me it looks like the problem with arrays-of-arrays test is that it will > assign > overlapping locations currently for uniforms if we have 'arrays of arrays' > situation going on. > > For example with > > layout(location = 0) uniform float uni[2][2] > > uni[0] gets location 0, but uni[1] has gets location 0 too. I haven't quite > figured out yet where the issue is but the location counter gets reset for > each array item and starts again from 0 while it should actually maintain its > count .. > > > >> -Original Message- > >> From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > >> Behalf Of Tapani Pälli > >> Sent: Tuesday, October 20, 2015 11:24 AM > >> To: mesa-dev@lists.freedesktop.org > >> Subject: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when > >> filling UniformRemapTable > >> > >> UniformRemapTable is used only for remapping user specified uniform > >> locations to driver internally used ones, shader storage buffer > >> variables should not utilize uniform locations. > >> > >> Signed-off-by: Tapani Pälli > >> --- > >> src/glsl/link_uniforms.cpp | 7 +-- > >> 1 file changed, 5 insertions(+), 2 deletions(-) > >> > >> diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp > >> index > >> fe00aa3..f7b87a1 100644 > >> --- a/src/glsl/link_uniforms.cpp > >> +++ b/src/glsl/link_uniforms.cpp > >> @@ -1180,7 +1180,8 @@ link_assign_uniform_locations(struct > >> gl_shader_program *prog, > >> > >> /* Reserve all the explicit locations of the active uniforms. */ > >> for (unsigned i = 0; i < num_uniforms; i++) { > >> - if (uniforms[i].type->is_subroutine()) > >> + if (uniforms[i].type->is_subroutine() || > >> + uniforms[i].is_shader_storage) > >>continue; > >> > >> if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) { @@ > >> - > >> 1200,8 +1201,10 @@ link_assign_uniform_locations(struct > >> gl_shader_program *prog, > >> /* Reserve locations for rest of the uniforms. */ > >> for (unsigned i = 0; i < num_uniforms; i++) { > >> > >> - if (uniforms[i].type->is_subroutine()) > >> + if (uniforms[i].type->is_subroutine() || > >> + uniforms[i].is_shader_storage) > >>continue; > >> + > >> /* Built-in uniforms should not get any location. */ > >> if (uniforms[i].builtin) > >>continue; > >> -- > >> 2.4.3 > >> > >> ___ > >> mesa-dev mailing list > >> mesa-dev@lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling UniformRemapTable
If you also remove the uniforms[i].array_elements in the same manner, the assert in: ES31-CTS.explicit_uniform_location.uniform-loc-arrays-of-arrays Is also avoided. > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Tuesday, October 20, 2015 11:24 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 1/3] glsl: skip buffer variables when filling > UniformRemapTable > > UniformRemapTable is used only for remapping user specified uniform > locations to driver internally used ones, shader storage buffer variables > should not utilize uniform locations. > > Signed-off-by: Tapani Pälli > --- > src/glsl/link_uniforms.cpp | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index > fe00aa3..f7b87a1 100644 > --- a/src/glsl/link_uniforms.cpp > +++ b/src/glsl/link_uniforms.cpp > @@ -1180,7 +1180,8 @@ link_assign_uniform_locations(struct > gl_shader_program *prog, > > /* Reserve all the explicit locations of the active uniforms. */ > for (unsigned i = 0; i < num_uniforms; i++) { > - if (uniforms[i].type->is_subroutine()) > + if (uniforms[i].type->is_subroutine() || > + uniforms[i].is_shader_storage) > continue; > >if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) { @@ - > 1200,8 +1201,10 @@ link_assign_uniform_locations(struct > gl_shader_program *prog, > /* Reserve locations for rest of the uniforms. */ > for (unsigned i = 0; i < num_uniforms; i++) { > > - if (uniforms[i].type->is_subroutine()) > + if (uniforms[i].type->is_subroutine() || > + uniforms[i].is_shader_storage) > continue; > + >/* Built-in uniforms should not get any location. */ >if (uniforms[i].builtin) > continue; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: Enable split of lower UBOs and SSBO also for compute shaders
> -Original Message- > From: Francisco Jerez [mailto:curroje...@riseup.net] > Sent: Wednesday, October 14, 2015 3:18 PM > To: Lofstedt, Marta; Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH] glsl: Enable split of lower UBOs and SSBO > also for compute shaders > > "Lofstedt, Marta" writes: > > > I have found a couple of more places in linker.cpp where we loop up to > MESA_SHADER_FRAGMENT. > > Should these now also be up to MESA_SHADER_COMPUTE instead? > > > Some might be oversights like this, but I guess in some cases a loop up to > MESA_SHADER_FRAGMENT might be the right thing to do when doing stuff > like linking varyings that really only applies to the graphics pipeline and > not to > compute shaders. > Thanks Curro, I will leave the potential other cases for now and send up a V2 with MESA_SHADER_STAGES instead. This is blocking GLES 3.1 testing at the moment. /Marta > > > /Marta > > > >> -Original Message- > >> From: Marta Lofstedt [mailto:marta.lofst...@linux.intel.com] > >> Sent: Wednesday, October 14, 2015 2:56 PM > >> To: mesa-dev@lists.freedesktop.org > >> Cc: Lofstedt, Marta; Marta Lofstedt > >> Subject: [PATCH] glsl: Enable split of lower UBOs and SSBO also for > >> compute shaders > >> > >> From: Marta Lofstedt > >> > >> The split of Uniform blocks and shader storage block only loops up to > >> MESA_SHADER_FRAGMENT and igonres compute shaders. > >> This cause segfault when running the OpenGL ES 3.1 CTS tests with > >> GL_ARB_compute_shader enabled. > >> > >> Signed-off-by: Marta Lofstedt > >> --- > >> src/glsl/linker.cpp | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index > >> c61c76e..5b5d6e6 > >> 100644 > >> --- a/src/glsl/linker.cpp > >> +++ b/src/glsl/linker.cpp > >> @@ -4392,7 +4392,7 @@ link_shaders(struct gl_context *ctx, struct > >> gl_shader_program *prog) > >> * for gl_shader_program and gl_shader, so that drivers that need > separate > >> * index spaces for each set can have that. > >> */ > >> - for (unsigned i = MESA_SHADER_VERTEX; i <= > >> MESA_SHADER_FRAGMENT; i++) { > >> + for (unsigned i = MESA_SHADER_VERTEX; i <= > MESA_SHADER_COMPUTE; > >> i++) > > > > Remove new line. > > > >> + { > >>if (prog->_LinkedShaders[i] != NULL) { > >> gl_shader *sh = prog->_LinkedShaders[i]; > >> split_ubos_and_ssbos(sh, > >> -- > >> 2.1.4 > > > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: Enable split of lower UBOs and SSBO also for compute shaders
I have found a couple of more places in linker.cpp where we loop up to MESA_SHADER_FRAGMENT. Should these now also be up to MESA_SHADER_COMPUTE instead? /Marta > -Original Message- > From: Marta Lofstedt [mailto:marta.lofst...@linux.intel.com] > Sent: Wednesday, October 14, 2015 2:56 PM > To: mesa-dev@lists.freedesktop.org > Cc: Lofstedt, Marta; Marta Lofstedt > Subject: [PATCH] glsl: Enable split of lower UBOs and SSBO also for compute > shaders > > From: Marta Lofstedt > > The split of Uniform blocks and shader storage block only loops up to > MESA_SHADER_FRAGMENT and igonres compute shaders. > This cause segfault when running the OpenGL ES 3.1 CTS tests with > GL_ARB_compute_shader enabled. > > Signed-off-by: Marta Lofstedt > --- > src/glsl/linker.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index c61c76e..5b5d6e6 > 100644 > --- a/src/glsl/linker.cpp > +++ b/src/glsl/linker.cpp > @@ -4392,7 +4392,7 @@ link_shaders(struct gl_context *ctx, struct > gl_shader_program *prog) > * for gl_shader_program and gl_shader, so that drivers that need separate > * index spaces for each set can have that. > */ > - for (unsigned i = MESA_SHADER_VERTEX; i <= > MESA_SHADER_FRAGMENT; i++) { > + for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_COMPUTE; > i++) Remove new line. > + { >if (prog->_LinkedShaders[i] != NULL) { > gl_shader *sh = prog->_LinkedShaders[i]; > split_ubos_and_ssbos(sh, > -- > 2.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: fix matrix stride calculation for std430's row_major matrices with two columns
Thanks Samuel, This also fixes 10+ OpenGL ES 3.1 test cases. Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Samuel Iglesias Gonsalvez > Sent: Tuesday, October 13, 2015 8:39 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: fix matrix stride calculation for std430's > row_major matrices with two columns > > This is the result of applying several rules: > > From OpenGL 4.3 spec, section 7.6.2.2 "Standard Uniform Block Layout": > > "2. If the member is a two- or four-component vector with components > consuming N basic machine units, the base alignment is 2N or 4N, > respectively." > [...] > "4. If the member is an array of scalars or vectors, the base alignment and > array stride are set to match the base alignment of a single array element, > according to rules (1), (2), and (3), and rounded up to the base alignment of > a > vec4." > [...] > "7. If the member is a row-major matrix with C columns and R rows, the > matrix is stored identically to an array of R row vectors with C components > each, according to rule (4)." > [...] > "When using the std430 storage layout, shader storage blocks will be laid out > in buffer storage identically to uniform and shader storage blocks using the > std140 layout, except that the base alignment and stride of arrays of scalars > and vectors in rule 4 and of structures in rule 9 are not rounded up a > multiple > of the base alignment of a vec4." > > In summary: vec2 has a base alignment of 2*N, a row-major mat2xY is stored > like an array of Y row vectors with 2 components each. Because of std430 > storage layout, the base alignment of the array of vectors is not rounded up > to vec4, so it is still 2*N. > > Fixes 15 dEQP tests: > > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_m > at2 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediu > mp_mat2 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_ > mat2 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_m > at2x3 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediu > mp_mat2x3 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_ > mat2x3 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_m > at2x4 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediu > mp_mat2x4 > dEQP- > GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_ > mat2x4 > dEQP- > GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2 > dEQP- > GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2x3 > dEQP- > GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2x4 > dEQP- > GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major > _mat2 > dEQP- > GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major > _mat2x3 > dEQP- > GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major > _mat2x4 > > v2: > - Add spec quote in both commit log and code (Timothy) > > Signed-off-by: Samuel Iglesias Gonsalvez > Cc: Timothy Arceri > --- > src/glsl/lower_ubo_reference.cpp | 26 +- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/src/glsl/lower_ubo_reference.cpp > b/src/glsl/lower_ubo_reference.cpp > index 247620e..c8ec5c1 100644 > --- a/src/glsl/lower_ubo_reference.cpp > +++ b/src/glsl/lower_ubo_reference.cpp > @@ -744,7 +744,31 @@ lower_ubo_reference_visitor::emit_access(bool > is_write, > * or 32 depending on the number of columns. > */ >assert(matrix_columns <= 4); > - unsigned matrix_stride = glsl_align(matrix_columns * N, 16); > + unsigned matrix_stride = 0; > + /* Matrix stride for std430 mat2xY matrices are not rounded up to > + * vec4 size. From OpenGL 4.3 spec, section 7.6.2.2 "Standard Uniform > + * Block Layout": > + * > + * "2. If the member is a two- or four-component vector with > components > + * consuming N basic machine units, the base alignment is 2N or 4N, > + * respectively." [...] > + * "4. If the member is an array of scalars or vectors, the base > alignment > + * and array stride are set to match the base alignment of a single > array > + * element, according to rules (1), (2), and (3), and rounded up to the > + * base alignment of a vec4." [...] > + * "7. If the member is a row-major matrix with C columns and R rows, > the > + * matrix is stored identically to an array of R row vectors with C > + * components each, according to rule (4)." [...] > + * "When using the std430 storage layout, shader storage blocks will be > + * laid out in buffer storage identically to uniform and shader storage > + * bloc
Re: [Mesa-dev] [PATCH 2/4 v2] glsl: Restrict initializers for global variables to constant expression in ES
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Wednesday, October 7, 2015 11:34 PM > To: mesa-dev@lists.freedesktop.org > Cc: Romanick, Ian D; 10.6 11.0 > Subject: [Mesa-dev] [PATCH 2/4 v2] glsl: Restrict initializers for global > variables to constant expression in ES > > From: Ian Romanick > > v2: Combine this check with the existing const and uniform checks. This > change depends on the previous patch (glsl: Only set > ir_variable::constant_value for const-decorated variables). > > Fixes: > > ES2-CTS.shaders.negative.initialize > ES3-CTS.shaders.negative.initialize > > spec/glsl-es-1.00/compiler/global-initializer/from-attribute.vert > spec/glsl-es-1.00/compiler/global-initializer/from-uniform.vert > spec/glsl-es-1.00/compiler/global-initializer/from-uniform.frag > spec/glsl-es-1.00/compiler/global-initializer/from-global.vert > spec/glsl-es-1.00/compiler/global-initializer/from-global.frag > spec/glsl-es-1.00/compiler/global-initializer/from-varying.frag > spec/glsl-es-3.00/compiler/global-initializer/from-uniform.vert > spec/glsl-es-3.00/compiler/global-initializer/from-uniform.frag > spec/glsl-es-3.00/compiler/global-initializer/from-in.vert > spec/glsl-es-3.00/compiler/global-initializer/from-in.frag > spec/glsl-es-3.00/compiler/global-initializer/from-global.vert > spec/glsl-es-3.00/compiler/global-initializer/from-global.frag > > Note: spec/glsl-es-3.00/compiler/global-initializer/from-sequence.* > still fail because the result of a sequence operator is still considered to > be a > constant expression. > > Signed-off-by: Ian Romanick > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92304 > Reviewed-by: Tapani Pälli [v1] > Reviewed-by: Iago Toral Quiroga [v1] > Cc: "10.6 11.0" > --- > src/glsl/ast_to_hir.cpp | 20 +--- > 1 file changed, 17 insertions(+), 3 deletions(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > e3d4c44..eefc7b7 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -3213,9 +3213,19 @@ process_initializer(ir_variable *var, > ast_declaration *decl, > > /* Calculate the constant value if this is a const or uniform > * declaration. > +* > +* Section 4.3 (Storage Qualifiers) of the GLSL ES 1.00.17 spec says: > +* > +* "Declarations of globals without a storage qualifier, or with > +* just the const qualifier, may include initializers, in which case > +* they will be initialized before the first line of main() is > +* executed. Such initializers must be a constant expression." > +* > +* The same section of the GLSL ES 3.00.4 spec has similar language. > */ > if (type->qualifier.flags.q.constant > - || type->qualifier.flags.q.uniform) { > + || type->qualifier.flags.q.uniform > + || (state->es_shader && state->current_function == NULL)) { >ir_rvalue *new_rhs = validate_assignment(state, initializer_loc, > lhs, rhs, true); >if (new_rhs != NULL) { > @@ -3223,6 +3233,11 @@ process_initializer(ir_variable *var, > ast_declaration *decl, > > ir_constant *constant_value = rhs->constant_expression_value(); > if (!constant_value) { > +const char *const variable_mode = > + (type->qualifier.flags.q.constant) > + ? "const" > + : ((type->qualifier.flags.q.uniform) ? "uniform" : > + "global"); > + > /* If ARB_shading_language_420pack is enabled, initializers of > * const-qualified local variables do not have to be constant > * expressions. Const-qualified global variables must still be > @@ - > 3233,8 +3248,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, > _mesa_glsl_error(& initializer_loc, state, > "initializer of %s variable `%s' must be a " > "constant expression", > -(type->qualifier.flags.q.constant) > -? "const" : "uniform", > +variable_mode, > decl->identifier); > if (var->type->is_numeric()) { >/* Reduce cascading errors. */ > -- > 2.1.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] glsl: Only set ir_variable::constant_value for const-decorated variables
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Wednesday, October 7, 2015 11:34 PM > To: mesa-dev@lists.freedesktop.org > Cc: Romanick, Ian D > Subject: [Mesa-dev] [PATCH 1/4] glsl: Only set ir_variable::constant_value > for const-decorated variables > > From: Ian Romanick > > Right now we're also setting for uniforms, and that doesn't seem to hurt > things. The next patch will make general global variables in GLSL ES, and > those definitely should not have constant_value set! > > Signed-off-by: Ian Romanick > --- > src/glsl/ast_to_hir.cpp | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > 9511440..e3d4c44 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -3238,17 +3238,20 @@ process_initializer(ir_variable *var, > ast_declaration *decl, > decl->identifier); > if (var->type->is_numeric()) { >/* Reduce cascading errors. */ > - var->constant_value = ir_constant::zero(state, var->type); > + var->constant_value = type->qualifier.flags.q.constant > + ? ir_constant::zero(state, var->type) : NULL; > } > } > } else { > rhs = constant_value; > -var->constant_value = constant_value; > +var->constant_value = type->qualifier.flags.q.constant > + ? constant_value : NULL; > } >} else { > if (var->type->is_numeric()) { > /* Reduce cascading errors. */ > -var->constant_value = ir_constant::zero(state, var->type); > +var->constant_value = type->qualifier.flags.q.constant > + ? ir_constant::zero(state, var->type) : NULL; > } >} > } > -- > 2.1.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/4] glsl: In later GLSL versions, sequence operator is cannot be a constant expression
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Wednesday, October 7, 2015 11:34 PM > To: mesa-dev@lists.freedesktop.org > Cc: Romanick, Ian D > Subject: [Mesa-dev] [PATCH 4/4] glsl: In later GLSL versions, sequence > operator is cannot be a constant expression > > From: Ian Romanick > > Fixes: > ES3-CTS.shaders.negative.constant_sequence > > spec/glsl-es-3.00/compiler/global-initializer/from-sequence.vert > spec/glsl-es-3.00/compiler/global-initializer/from-sequence.frag > > Signed-off-by: Ian Romanick > --- > src/glsl/ast_to_hir.cpp | 43 > ++- > 1 file changed, 42 insertions(+), 1 deletion(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > 6af0f80..c7444ed 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -3311,8 +3311,49 @@ process_initializer(ir_variable *var, > ast_declaration *decl, >if (new_rhs != NULL) { > rhs = new_rhs; > > + /* Section 4.3.3 (Constant Expressions) of the GLSL ES 3.00.4 spec > + * says: > + * > + * "A constant expression is one of > + * > + *... > + * > + *- an expression formed by an operator on operands that are > + * all constant expressions, including getting an element > of > + * a constant array, or a field of a constant structure, or > + * components of a constant vector. However, the sequence > + * operator ( , ) and the assignment operators ( =, +=, > ...) > + * are not included in the operators that can create a > + * constant expression." > + * > + * Section 12.43 (Sequence operator and constant expressions) says: > + * > + * "Should the following construct be allowed? > + * > + * float a[2,3]; > + * > + * The expression within the brackets uses the sequence operator > + * (',') and returns the integer 3 so the construct is decl > aring > + * a single-dimensional array of size 3. In some languages, the > + * construct declares a two-dimensional array. It would be > + * preferable to make this construct illegal to avoid confusion. > + * > + * One possibility is to change the definition of the sequence > + * operator so that it does not return a constant- expression > and > + * hence cannot be used to declare an array size. > + * > + * RESOLUTION: The result of a sequence operator is not a > + * constant-expression." > + * > + * Section 4.3.3 (Constant Expressions) of the GLSL 4.30.9 spec > + * contains language almost identical to the section 4.3.3 fomr the > + * GLSL ES 3.00.4 spec. This is a new limitation for these GLSL > + * versions. > + */ > ir_constant *constant_value = rhs->constant_expression_value(); > - if (!constant_value) { > + if (!constant_value || > + (state->is_version(430, 300) && > + decl->initializer->has_sequence_subexpression())) { > const char *const variable_mode = > (type->qualifier.flags.q.constant) > ? "const" > -- > 2.1.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/4] glsl: Add method to determine whether an expression contains the sequence operator
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ian Romanick > Sent: Wednesday, October 7, 2015 11:34 PM > To: mesa-dev@lists.freedesktop.org > Cc: Romanick, Ian D > Subject: [Mesa-dev] [PATCH 3/4] glsl: Add method to determine whether an > expression contains the sequence operator > > From: Ian Romanick > > This will be used in the next patch to enforce some language sematics. > > Signed-off-by: Ian Romanick > --- > src/glsl/ast.h| 6 > src/glsl/ast_function.cpp | 11 +++ > src/glsl/ast_to_hir.cpp | 80 > +++ > 3 files changed, 97 insertions(+) > > diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 4c31436..67faacd 100644 > --- a/src/glsl/ast.h > +++ b/src/glsl/ast.h > @@ -62,6 +62,8 @@ public: > virtual ir_rvalue *hir(exec_list *instructions, > struct _mesa_glsl_parse_state > *state); > > + virtual bool has_sequence_subexpression() const; > + > /** > * Retrieve the source location of an AST node > * > @@ -221,6 +223,8 @@ public: > virtual void hir_no_rvalue(exec_list *instructions, >struct _mesa_glsl_parse_state *state); > > + virtual bool has_sequence_subexpression() const; > + > ir_rvalue *do_hir(exec_list *instructions, > struct _mesa_glsl_parse_state *state, > bool needs_rvalue); @@ -299,6 +303,8 @@ public: > virtual void hir_no_rvalue(exec_list *instructions, >struct _mesa_glsl_parse_state *state); > > + virtual bool has_sequence_subexpression() const; > + > private: > /** > * Is this function call actually a constructor? > diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index > 26d4c62..83ce767 100644 > --- a/src/glsl/ast_function.cpp > +++ b/src/glsl/ast_function.cpp > @@ -1958,6 +1958,17 @@ ast_function_expression::hir(exec_list > *instructions, > unreachable("not reached"); > } > > +bool > +ast_function_expression::has_sequence_subexpression() const { > + foreach_list_typed(const ast_node, ast, link, &this->expressions) { > + if (!ast->has_sequence_subexpression()) > + return false; > + } > + > + return true; > +} > + > ir_rvalue * > ast_aggregate_initializer::hir(exec_list *instructions, > struct _mesa_glsl_parse_state *state) diff > --git > a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index eefc7b7..6af0f80 > 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -1004,6 +1004,12 @@ ast_node::hir(exec_list *instructions, struct > _mesa_glsl_parse_state *state) > return NULL; > } > > +bool > +ast_node::has_sequence_subexpression() const { > + return false; > +} > + > void > ast_function_expression::hir_no_rvalue(exec_list *instructions, > struct _mesa_glsl_parse_state *state) > @@ -1915,6 > +1921,80 @@ ast_expression::do_hir(exec_list *instructions, > return result; > } > > +bool > +ast_expression::has_sequence_subexpression() const { > + switch (this->oper) { > + case ast_plus: > + case ast_neg: > + case ast_bit_not: > + case ast_logic_not: > + case ast_pre_inc: > + case ast_pre_dec: > + case ast_post_inc: > + case ast_post_dec: > + return this->subexpressions[0]->has_sequence_subexpression(); > + > + case ast_assign: > + case ast_add: > + case ast_sub: > + case ast_mul: > + case ast_div: > + case ast_mod: > + case ast_lshift: > + case ast_rshift: > + case ast_less: > + case ast_greater: > + case ast_lequal: > + case ast_gequal: > + case ast_nequal: > + case ast_equal: > + case ast_bit_and: > + case ast_bit_xor: > + case ast_bit_or: > + case ast_logic_and: > + case ast_logic_or: > + case ast_logic_xor: > + case ast_array_index: > + case ast_mul_assign: > + case ast_div_assign: > + case ast_add_assign: > + case ast_sub_assign: > + case ast_mod_assign: > + case ast_ls_assign: > + case ast_rs_assign: > + case ast_and_assign: > + case ast_xor_assign: > + case ast_or_assign: > + return this->subexpressions[0]->has_sequence_subexpression() || > + this->subexpressions[1]->has_sequence_subexpression(); > + > + case ast_conditional: > + return this->subexpressions[0]->has_sequence_subexpression() || > + this->subexpressions[1]->has_sequence_subexpression() || > + this->subexpressions[2]->has_sequence_subexpression(); > + > + case ast_sequence: > + return true; > + > + case ast_field_selection: > + case ast_identifier: > + case ast_int_constant: > + case ast_uint_constant: > + case ast_float_constant: > + case ast_bool_constant: > + case ast_double_constant: > + return false; > + > + case ast_aggregate: > + unreachable("ast_aggregate: Sho
Re: [Mesa-dev] [PATCH 4/7] glsl: add support for GL_OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Wednesday, September 23, 2015 5:20 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 4/7] glsl: add support for > GL_OES_geometry_shader > > On Wed, Sep 23, 2015 at 4:42 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > This adds glsl support of GL_OES_geometry_shader for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/glsl/builtin_variables.cpp | 16 +--- > > src/glsl/glsl_parser.yy | 4 ++-- > > src/glsl/glsl_parser_extras.cpp | 1 + > > src/glsl/glsl_parser_extras.h | 2 ++ > > 4 files changed, 10 insertions(+), 13 deletions(-) > > > > diff --git a/src/glsl/builtin_variables.cpp > > b/src/glsl/builtin_variables.cpp index b5e2908..cd8d61c 100644 > > --- a/src/glsl/builtin_variables.cpp > > +++ b/src/glsl/builtin_variables.cpp > > @@ -611,7 +611,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxVaryingComponents", state->ctx- > >Const.MaxVarying * 4); > > } > > > > - if (state->is_version(150, 0)) { > > + if (state->is_version(150, 0) || > > + state->OES_geometry_shader_enable) { > > While you're at it, throw in 320 as well? (both here and below) Yeah, cool then there are no reason for objections about the having the GL_OES_geometry_shader under GLES 3.2 in docs/GL3.txt. Thanks Ilia! > > >add_const("gl_MaxVertexOutputComponents", > > state->Const.MaxVertexOutputComponents); > >add_const("gl_MaxGeometryInputComponents", > > @@ -674,10 +674,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBindings", > > state->Const.MaxAtomicBufferBindings); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxGeometryAtomicCounters", > > state->Const.MaxGeometryAtomicCounters); > > > > @@ -701,10 +698,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxAtomicCounterBufferSize", > > state->Const.MaxAtomicCounterBufferSize); > > > > - /* When Mesa adds support for GL_OES_geometry_shader and > > - * GL_OES_tessellation_shader, this will need to change. > > - */ > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxGeometryAtomicCounterBuffers", > > state->Const.MaxGeometryAtomicCounterBuffers); > > add_const("gl_MaxTessControlAtomicCounterBuffers", > > @@ -762,7 +756,7 @@ builtin_variable_generator::generate_constants() > >add_const("gl_MaxCombinedImageUniforms", > > state->Const.MaxCombinedImageUniforms); > > > > - if (!state->es_shader) { > > + if (!state->es_shader || state->OES_geometry_shader_enable) { > > add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", > > state->Const.MaxCombinedShaderOutputResources); > > add_const("gl_MaxImageSamples", @@ -993,7 +987,7 @@ > > builtin_variable_generator::generate_fs_special_vars() > > if (state->is_version(120, 100)) > >add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord"); > > > > - if (state->is_version(150, 0)) { > > + if (state->is_version(150, 0) || > > + state->OES_geometry_shader_enable) { > >ir_variable *var = > > add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); > >var->data.interpolation = INTERP_QUALIFIER_FLAT; diff --git > > a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > > 59e4527..ab50c4b 100644 > > --- a/src/glsl/glsl_parser.yy > > +++ b/src/glsl/glsl_parser.yy > > @@ -1250,7 +1250,7 @@ layout_qualifier_id: > > } > > } > > > > - if ($$.flags.i && !state->is_version(150, 0)) { > > + if ($$.flags.i && !state->is_version(150, 310)) { > > Should this be 320 + && !state->OES_geometry_shader_enable ? (Also > below.) > > > _mesa_glsl_error(& @1, state, "#version 150 layout " > > "qualifier `%s' used", $1); > > } > > @@ -1491,7 +1491,7 @@ layout_qualifier_id: > > YYERROR; > > } else { > > $$.max_vertices = $3; > > -if (!state->is_version(150, 0)) { > > +if (!state->is_version(150, 310)) { > > _mesa_glsl_error(& @3, state, > > "#version 150 max_vertices qualifier " > > "specified", $3); diff --git > > a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp > > index dae5261..1cb34df 1
Re: [Mesa-dev] [PATCH 3/7] mesa: Add extension enable for GL_OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Wednesday, September 23, 2015 5:17 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 3/7] mesa: Add extension enable for > GL_OES_geometry_shader > > On Wed, Sep 23, 2015 at 4:42 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Exposes the GL_OES_geometry_shader extension for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mesa/main/extensions.c | 1 + > > src/mesa/main/mtypes.h | 1 + > > src/mesa/main/tests/dispatch_sanity.cpp | 3 +++ > > 3 files changed, 5 insertions(+) > > > > diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c > > index b2c88c3..5cfcd43 100644 > > --- a/src/mesa/main/extensions.c > > +++ b/src/mesa/main/extensions.c > > @@ -314,6 +314,7 @@ static const struct extension extension_table[] = { > > { "GL_OES_fbo_render_mipmap", o(dummy_true), > ES1 | ES2, 2005 }, > > { "GL_OES_fixed_point", o(dummy_true), > ES1, 2002 }, > > { "GL_OES_framebuffer_object", o(dummy_true), > ES1, 2005 }, > > + { "GL_OES_geometry_shader", o(OES_geometry_shader), > ES31, 2015 }, > > { "GL_OES_get_program_binary", o(dummy_true), > ES2, 2008 }, > > { "GL_OES_mapbuffer", o(dummy_true), > ES1 | ES2, 2005 }, > > { "GL_OES_packed_depth_stencil",o(dummy_true), > ES1 | ES2, 2007 }, > > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index > > fac45aa..2886f19 100644 > > --- a/src/mesa/main/mtypes.h > > +++ b/src/mesa/main/mtypes.h > > @@ -3770,6 +3770,7 @@ struct gl_extensions > > GLboolean OES_texture_half_float; > > GLboolean OES_texture_half_float_linear; > > GLboolean OES_compressed_ETC1_RGB8_texture; > > + GLboolean OES_geometry_shader; > > GLboolean extension_sentinel; > > /** The extension string */ > > const GLubyte *String; > > diff --git a/src/mesa/main/tests/dispatch_sanity.cpp > > b/src/mesa/main/tests/dispatch_sanity.cpp > > index 0ddda59..cce05d9 100644 > > --- a/src/mesa/main/tests/dispatch_sanity.cpp > > +++ b/src/mesa/main/tests/dispatch_sanity.cpp > > @@ -2481,5 +2481,8 @@ const struct function gles31_functions_possible[] > = { > > /* GL_OES_texture_storage_multisample_2d_array */ > > { "glTexStorage3DMultisampleOES", 31, -1 }, > > > > + /*GL_OES_geometry_shader*/ > > + { "glFramebufferTextureOES", 31, -1}, > > Shouldn't this go into a previous patch, the one that adds the function in the > glapi xml? OK, thanks Ilia I will fix this for the V2s. > > > + > > { NULL, 0, -1 }, > > }; > > -- > > 2.1.4 > > > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/7] mesa: enable enums for OES_geometry_shader
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Kenneth Graunke > Sent: Wednesday, September 23, 2015 6:25 PM > To: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 5/7] mesa: enable enums for > OES_geometry_shader > > On Wednesday, September 23, 2015 08:50:34 AM Matt Turner wrote: > > On Wed, Sep 23, 2015 at 8:45 AM, Ilia Mirkin > wrote: > > > These 2 should probably be in the below GL_CORE/GLES31 section. As > > > probably should all or most of these, but ... meh. I guess someone > > > still has ARB_gs4 aspirations. > > > > I don't think so actually -- reading through these patches made me > > wonder if we should strip out the ARB_geometry_shader4 cruft. > > +1. I don't think we ever want to support it. I would happily toss out the ARB_shader_geometry_shader4 stuff and rebase my GL_OES_geometry_shader patches on top of that, but I would need some confirmation that this is actually the way we should go forward. I will wait a couple of days for feedback, if no one is against it will soon be gone. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 7/7] doc: Set GL_OES_geometry_shader as started
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Iago Toral > Sent: Wednesday, September 23, 2015 3:18 PM > To: Eduardo Lima Mitev > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 7/7] doc: Set GL_OES_geometry_shader as > started > > On Wed, 2015-09-23 at 14:07 +0200, Eduardo Lima Mitev wrote: > > On 09/23/2015 10:42 AM, Marta Lofstedt wrote: > > > From: Marta Lofstedt > > > > > > Signed-off-by: Marta Lofstedt > > > --- > > > docs/GL3.txt | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/docs/GL3.txt b/docs/GL3.txt index 92941cf..e1c6049 > > > 100644 > > > --- a/docs/GL3.txt > > > +++ b/docs/GL3.txt > > > @@ -238,7 +238,7 @@ GLES3.2, GLSL ES 3.2 > > >GL_OES_copy_imagenot started > > > (based on > GL_ARB_copy_image, which is done for some drivers) > > >GL_OES_draw_buffers_indexed not started > > >GL_OES_draw_elements_base_vertex not started > > > (based on > GL_ARB_draw_elements_base_verte, which is done for all drivers) > > > - GL_OES_geometry_shader not started > > > (based on > GL_ARB_geometry_shader4, which is done for all drivers) > > > + GL_OES_geometry_shader started (Marta) > > >GL_OES_gpu_shader5 not started > > > (based on parts of > GL_ARB_gpu_shader5, which is done for some drivers) > > >GL_OES_primitive_bounding boxnot started > > >GL_OES_sample_shadingnot started > > > (based on parts of > GL_ARB_sample_shading, which is done for some drivers) > > > > > > > Not directly related with the patch, but I wonder why the > > GL_OES_geometry_shader entry is in the "GLES3.2 GLSL ES 3.2" section > > of this file. Per > > > https://www.khronos.org/registry/gles/extensions/OES/OES_geometry_sh > ader.txt: > > > > "This specification is written against the OpenGL ES 3.1 > > (March 17, 2014) and OpenGL ES 3.10 Shading Language > > (March 17, 2014) Specifications." > > > > Shouldn't this entry be moved to the previous section "GLES3.1, GLSL > > ES 3.1" altogether? > > Geometry shaders were introduced with GLES 3.2, they are not part of the > GLES 3.1 spec, I imagine the extension has been there for a while though and > that's why it was written against the 3.1 spec. > GL_EXT_geometry_shader is also part of the GLES 3.1, Android Extension Pack: https://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt So, if some driver wanted that we would still need to expose those extensions under GLES 3.1. /Marta > > Iago > > > In any case: > > > > Reviewed-by: Eduardo Lima Mitev > > > > ___ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Apologies for forgetting to add Reviewed by Tapani
Hi all, I apologize for forgetting to add Tapani as the reviewer for the patches I just merged: commit 6c3de8996fbe9447e092cc75ccdd6f720fabaf4d commit cf293e518ebd847cb28e03d4378679c47548206d commit 419210005a84f1f26da353b945b3f783d53fa56a The patches was reviewed here: http://lists.freedesktop.org/archives/mesa-dev/2015-September/093432.html BR, Marta --- Intel Sweden AB Registered Office: Knarrarnasgatan 15, 164 40 Kista, Stockholm, Sweden Registration Number: 556189-6027 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] mesa: add packed_varyings list to gl_shader
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, September 11, 2015 7:44 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 1/2] mesa: add packed_varyings list to > gl_shader > > This is required to store information about packed varyings, currently these > variables get lost and cannot be retrieved later in sensible way for program > interface queries. List will be utilized by next patch. > > Signed-off-by: Tapani Pälli > --- > src/glsl/lower_packed_varyings.cpp | 16 > src/mesa/main/mtypes.h | 1 + > 2 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/src/glsl/lower_packed_varyings.cpp > b/src/glsl/lower_packed_varyings.cpp > index cfe414a..5d66ca9 100644 > --- a/src/glsl/lower_packed_varyings.cpp > +++ b/src/glsl/lower_packed_varyings.cpp > @@ -170,7 +170,7 @@ public: > exec_list *out_instructions, > exec_list *out_variables); > > - void run(exec_list *instructions); > + void run(struct gl_shader *shader); > > private: > void bitwise_assign_pack(ir_rvalue *lhs, ir_rvalue *rhs); @@ -252,9 +252,9 > @@ lower_packed_varyings_visitor::lower_packed_varyings_visitor( > } > > void > -lower_packed_varyings_visitor::run(exec_list *instructions) > +lower_packed_varyings_visitor::run(struct gl_shader *shader) > { > - foreach_in_list(ir_instruction, node, instructions) { > + foreach_in_list(ir_instruction, node, shader->ir) { >ir_variable *var = node->as_variable(); >if (var == NULL) > continue; > @@ -272,6 +272,14 @@ lower_packed_varyings_visitor::run(exec_list > *instructions) >assert(var->data.interpolation == INTERP_QUALIFIER_FLAT || > !var->type->contains_integer()); > > + /* Clone the variable for program resource list before > + * it gets modified and lost. > + */ > + if (!shader->packed_varyings) > + shader->packed_varyings = new (shader) exec_list; > + > + shader->packed_varyings->push_tail(var->clone(shader, NULL)); > + >/* Change the old varying into an ordinary global. */ >assert(var->data.mode != ir_var_temporary); >var->data.mode = ir_var_auto; > @@ -711,7 +719,7 @@ lower_packed_varyings(void *mem_ctx, unsigned > locations_used, > gs_input_vertices, > &new_instructions, > &new_variables); > - visitor.run(instructions); > + visitor.run(shader); > if (mode == ir_var_shader_out) { >if (shader->Stage == MESA_SHADER_GEOMETRY) { > /* For geometry shaders, outputs need to be lowered before each call > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index > fac45aa..89d2026 100644 > --- a/src/mesa/main/mtypes.h > +++ b/src/mesa/main/mtypes.h > @@ -2292,6 +2292,7 @@ struct gl_shader > struct gl_uniform_block *UniformBlocks; > > struct exec_list *ir; > + struct exec_list *packed_varyings; > struct glsl_symbol_table *symbols; > > bool uses_builtin_functions; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v3] glsl: add packed varyings to program resource list
Thanks for fixing this Tapani, I have tested that this indeed fix the CTS. Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, September 11, 2015 9:20 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH v3] glsl: add packed varyings to program > resource list > > This makes sure that user is still able to query properties about variables > that > have gotten packed by lower_packed_varyings pass. > > Fixes following OpenGL ES 3.1 test: >ES31-CTS.program_interface_query.separate-programs-vertex > > v2: fix 'name included in packed list' check (Ilia Mirkin) > v3: iterate over instances of name using strtok_r (Ilia Mirkin) > > Signed-off-by: Tapani Pälli > --- > src/glsl/linker.cpp | 80 > ++--- > 1 file changed, 76 insertions(+), 4 deletions(-) > > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 94f847e..de499e2 > 100644 > --- a/src/glsl/linker.cpp > +++ b/src/glsl/linker.cpp > @@ -3114,6 +3114,35 @@ add_program_resource(struct gl_shader_program > *prog, GLenum type, > return true; > } > > +/* Function checks if a variable var is a packed varying and > + * if given name is part of packed varying's list. > + * > + * If a variable is a packed varying, it has a name like > + * 'packed:a,b,c' where a, b and c are separate variables. > + */ > +static bool > +included_in_packed_varying(ir_variable *var, const char *name) { > + if (strncmp(var->name, "packed:", 7) != 0) > + return false; > + > + char *list = strdup(var->name + 7); > + assert(list); > + > + bool found = false; > + char *saveptr; > + char *token = strtok_r(list, ",", &saveptr); > + while (token) { > + if (strcmp(token, name) == 0) { > + found = true; > + break; > + } > + token = strtok_r(NULL, ",", &saveptr); > + } > + free(list); > + return found; > +} > + > /** > * Function builds a stage reference bitmask from variable name. > */ > @@ -3141,6 +3170,11 @@ build_stageref(struct gl_shader_program > *shProg, const char *name, > if (var) { > unsigned baselen = strlen(var->name); > > +if (included_in_packed_varying(var, name)) { > + stages |= (1 << i); > + break; > +} > + > /* Type needs to match if specified, otherwise we might > * pick a variable with same name but different interface. > */ > @@ -3166,9 +3200,9 @@ build_stageref(struct gl_shader_program *shProg, > const char *name, > > static bool > add_interface_variables(struct gl_shader_program *shProg, > -struct gl_shader *sh, GLenum programInterface) > +exec_list *ir, GLenum programInterface) > { > - foreach_in_list(ir_instruction, node, sh->ir) { > + foreach_in_list(ir_instruction, node, ir) { >ir_variable *var = node->as_variable(); >uint8_t mask = 0; > > @@ -3203,6 +3237,12 @@ add_interface_variables(struct > gl_shader_program *shProg, > continue; >}; > > + /* Skip packed varyings, packed varyings are handled separately > + * by add_packed_varyings. > + */ > + if (strncmp(var->name, "packed:", 7) == 0) > + continue; > + >if (!add_program_resource(shProg, programInterface, var, > build_stageref(shProg, var->name, > var->data.mode) | mask)) @@ > -3211,6 +3251,33 @@ > add_interface_variables(struct gl_shader_program *shProg, > return true; > } > > +static bool > +add_packed_varyings(struct gl_shader_program *shProg, int stage) { > + struct gl_shader *sh = shProg->_LinkedShaders[stage]; > + GLenum iface; > + > + if (!sh || !sh->packed_varyings) > + return true; > + > + foreach_in_list(ir_instruction, node, sh->packed_varyings) { > + ir_variable *var = node->as_variable(); > + if (var) { > + switch (var->data.mode) { > + case ir_var_shader_in: > +iface = GL_PROGRAM_INPUT; > + case ir_var_shader_out: > +iface = GL_PROGRAM_OUTPUT; > + } > + if (!add_program_resource(shProg, iface, var, > + build_stageref(shProg, var->name, > + var->data.mode))) > +return false; > + } > + } > + return true; > +} > + > /** > * Builds up a list of program resources that point to existing > * resource data. > @@ -3243,12 +3310,17 @@ build_program_resource_list(struct > gl_shader_program *shProg) > if (input_stage == MESA_SHADER_STAGES && output_stage == 0) >return; > > + if (!add_packed_varyings(shProg, input_stage)) > + return; > + if (!add_packed_varyings(shProg, output_stage)) > + return; > + >
Re: [Mesa-dev] [PATCH 22/24] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Timothy Arceri > Sent: Thursday, September 17, 2015 9:03 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 22/24] glsl: Allow arrays of arrays in GLSL ES 3.10 > and GLSL 4.30 > > V3: use a check_*_allowed style function for requirements checking rather > than has_* which doesn't encapsulate the error message > > V2: add missing 's' to the extension name in error messages and add decimal > place in version string > --- > src/glsl/ast_to_hir.cpp | 7 +-- > src/glsl/glsl_parser.yy | 17 + > src/glsl/glsl_parser_extras.h | 14 ++ > 3 files changed, 20 insertions(+), 18 deletions(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > 167824d..3620d1d 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -1996,12 +1996,7 @@ process_array_type(YYLTYPE *loc, const glsl_type > *base, >* >* "Only one-dimensional arrays may be declared." >*/ > - if (!state->ARB_arrays_of_arrays_enable) { > -_mesa_glsl_error(loc, state, > - "invalid array of `%s'" > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays", > - base->name); > + if (!state->check_arrays_of_arrays_allowed(loc)) { > return glsl_type::error_type; > } >} > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > bdd4dea..096baf1 100644 > --- a/src/glsl/glsl_parser.yy > +++ b/src/glsl/glsl_parser.yy > @@ -1974,25 +1974,18 @@ array_specifier: >void *ctx = state; >$$ = $1; > > - if (!state->ARB_arrays_of_arrays_enable) { > - _mesa_glsl_error(& @1, state, > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays"); > + if (state->check_arrays_of_arrays_allowed(& @1)) { > + $$->add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, > NULL, > + NULL, NULL)); >} > - $$->add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, > NULL, > -NULL, NULL)); > } > | array_specifier '[' constant_expression ']' > { >$$ = $1; > > - if (!state->ARB_arrays_of_arrays_enable) { > - _mesa_glsl_error(& @1, state, > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays"); > + if (state->check_arrays_of_arrays_allowed(& @1)) { > + $$->add_dimension($3); >} > - > - $$->add_dimension($3); > } > ; > > diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h > index > d3b091d..bd0cac2 100644 > --- a/src/glsl/glsl_parser_extras.h > +++ b/src/glsl/glsl_parser_extras.h > @@ -115,6 +115,20 @@ struct _mesa_glsl_parse_state { >unsigned required_glsl_es_version, >YYLTYPE *locp, const char *fmt, ...) PRINTFLIKE(5, 6); > > + bool check_arrays_of_arrays_allowed(YYLTYPE *locp) > + { > + if (!(ARB_arrays_of_arrays_enable || is_version(430, 310))) { > + const char *const requirement = this->es_shader > +? "GLSL ES 3.10" > +: "GL_ARB_arrays_of_arrays or GLSL 4.30"; > + _mesa_glsl_error(locp, this, > + "%s required for defining arrays of arrays.", > + requirement); > + return false; > + } > + return true; > + } > + > bool check_precision_qualifiers_allowed(YYLTYPE *locp) > { >return check_version(130, 100, locp, > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/3] mesa: return initial value for VALIDATE_STATUS if pipe not bound
Reviewed-by: Marta Lofstedt From: mesa-dev [mesa-dev-boun...@lists.freedesktop.org] on behalf of Tapani Pälli [tapani.pa...@intel.com] Sent: Tuesday, September 01, 2015 12:53 PM To: mesa-dev@lists.freedesktop.org Cc: Romanick, Ian D Subject: [Mesa-dev] [PATCH 3/3] mesa: return initial value for VALIDATE_STATUS if pipe not bound From OpenGL 4.5 Core spec (7.13): "If pipeline is a name that has been generated (without subsequent deletion) by GenProgramPipelines, but refers to a program pipeline object that has not been previously bound, the GL first creates a new state vector in the same manner as when BindProgramPipeline creates a new program pipeline object." I interpret this as "If GetProgramPipelineiv gets called without a bound (but valid) pipeline object, the state should reflect initial state of a new pipeline object." This is also expected behaviour by ES31-CTS.sepshaderobjs.PipelineApi conformance test. Signed-off-by: Tapani Pälli --- src/mesa/main/pipelineobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 07acbf1..c2e1d29 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -614,7 +614,8 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) *params = pipe->InfoLog ? strlen(pipe->InfoLog) + 1 : 0; return; case GL_VALIDATE_STATUS: - *params = pipe->Validated; + /* If pipeline is not bound, return initial value 0. */ + *params = (ctx->_Shader->Name != pipe->Name) ? 0 : pipe->Validated; return; case GL_VERTEX_SHADER: *params = pipe->CurrentProgram[MESA_SHADER_VERTEX] -- 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] mesa: return initial value for PROGRAM_SEPARABLE when not linked
Hi Tapani, For spec. reference I believe you could go for section 7.12: "Most properties set within program objects are specified not to take effect until the next call to LinkProgram or ProgramBinary. Some properties further require a successful call to either of these commands before taking effect. GetProgramiv returns the properties currently in effect for program, which may differ from the properties set within program since the most recent call to LinkProgram or ProgramBinary , which have not yet taken effect. If there has been no such call putting changes to pname into effect, initial values are returned" and from table 20.20 we see that PROGRAM_SEPARABLE is initialized to FALSE. You have my R.b if you update. /Marta From: mesa-dev [mesa-dev-boun...@lists.freedesktop.org] on behalf of Tapani Pälli [tapani.pa...@intel.com] Sent: Tuesday, September 01, 2015 12:53 PM To: mesa-dev@lists.freedesktop.org Cc: Romanick, Ian D Subject: [Mesa-dev] [PATCH 2/3] mesa: return initial value for PROGRAM_SEPARABLE when not linked I haven't found clear spec evidence of this behaviour but this is expected by a conformance test that changes the value with glProgramParameteri but does not link the program. Test says: "The query for PROGRAM_SEPARABLE must query latched state. In other words, the state of the binary after it was linked. So in the tests below, the queries should return the default state GL_FALSE since the program has no linked binary." Signed-off-by: Tapani Pälli --- src/mesa/main/shaderapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 0e0e0d6..fb82543 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -773,7 +773,8 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, return; } case GL_PROGRAM_SEPARABLE: - *params = shProg->SeparateShader; + /* If the program has not been linked, return initial value 0. */ + *params = (shProg->LinkStatus == GL_FALSE) ? 0 : shProg->SeparateShader; return; /* ARB_tessellation_shader */ -- 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: enable query of PROGRAM_PIPELINE_BINDING for ES 3.1
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Tuesday, September 1, 2015 12:54 PM > To: mesa-dev@lists.freedesktop.org > Cc: Romanick, Ian D > Subject: [Mesa-dev] [PATCH 1/3] mesa: enable query of > PROGRAM_PIPELINE_BINDING for ES 3.1 > > Specified in OpenGL ES 3.1 spec, Table 23.32: Program Object State. > > Signed-off-by: Tapani Pälli > --- > src/mesa/main/get_hash_params.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/main/get_hash_params.py > b/src/mesa/main/get_hash_params.py > index dc5ba6f..e2e3d0d 100644 > --- a/src/mesa/main/get_hash_params.py > +++ b/src/mesa/main/get_hash_params.py > @@ -458,6 +458,9 @@ descriptor=[ > > # GL_ARB_explicit_uniform_location / GLES 3.1 >[ "MAX_UNIFORM_LOCATIONS", > "CONTEXT_INT(Const.MaxUserAssignableUniformLocations), > extra_ARB_explicit_uniform_location" ], > + > +# GL_ARB_separate_shader_objects / GLES 3.1 > + [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, > +GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ], > ]}, > > # Enums in OpenGL Core profile and ES 3.1 @@ -799,9 +802,6 @@ > descriptor=[ # GL_ARB_texture_gather >[ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", > "CONTEXT_INT(Const.MaxProgramTextureGatherComponents), > extra_ARB_texture_gather"], > > -# GL_ARB_separate_shader_objects > - [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, > GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ], > - > # GL_ARB_shader_atomic_counters >[ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", > "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuff > ers), extra_ARB_shader_atomic_counters_and_geometry_shader" ], >[ "MAX_GEOMETRY_ATOMIC_COUNTERS", > "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCou > nters), extra_ARB_shader_atomic_counters_and_geometry_shader" ], > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 16/16] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
> -Original Message- > From: Timothy Arceri [mailto:t_arc...@yahoo.com.au] > Sent: Thursday, September 3, 2015 10:24 AM > To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 16/16] glsl: Allow arrays of arrays in GLSL ES > 3.10 and GLSL 4.30 > > On Thu, 2015-09-03 at 07:55 +, Lofstedt, Marta wrote: > > Hi Timothy, > > > > This patch will unlock a lot of GLES 3.1 AoA related CTS tests. It > > would be nice to see it merged. > > > > I'm not sure there is much point merging it since there rest of the series > fixes > all the AoA CTS tests. Although the less patches I have to carry around the > better so if your happy to give your r-b on the updated patch [1] based on > Ian's feedback then I'll push that one. > > [1] > https://github.com/tarceri/Mesa_arrays_of_arrays/commit/6dbf7611d8bab > bd37e > abc4625c35b92e8d9cda72 > Oh, there's a V3. I didn't realize the "has_" thing was now out of fashion... Anyways, looks like we would also need the glsl_parser.yy stuff from: https://github.com/tarceri/Mesa_arrays_of_arrays/commit/73eda83f19d83de7bfad18d018ec79668ba21515 And that would probably kick-off a bunch of other dependencies and extra work. So, I will wait until you send up your full set. Keep up the good work! /Marta > > > Reviewed-by: Marta Lofstedt > > > > > -Original Message- > > > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > > > Behalf Of Timothy Arceri > > > Sent: Saturday, July 18, 2015 3:26 AM > > > To: mesa-dev@lists.freedesktop.org > > > Subject: [Mesa-dev] [PATCH 16/16] glsl: Allow arrays of arrays in > > > GLSL ES > > > 3.10 > > > and GLSL 4.30 > > > > > > V2: add missing 's' to the extension name in error messages and add > > > decimal place in version string > > > --- > > > src/glsl/ast_to_hir.cpp | 13 - > > > src/glsl/glsl_parser.yy | 22 ++ > > > src/glsl/glsl_parser_extras.h | 5 + > > > 3 files changed, 27 insertions(+), 13 deletions(-) > > > > > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > > > 8154c1e..fe169b3 100644 > > > --- a/src/glsl/ast_to_hir.cpp > > > +++ b/src/glsl/ast_to_hir.cpp > > > @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const > > > glsl_type *base, > > >* > > >* "Only one-dimensional arrays may be declared." > > >*/ > > > - if (!state->ARB_arrays_of_arrays_enable) { > > > + if (!state->has_arrays_of_arrays()) { > > > +const char *const requirement = state->es_shader > > > + ? "GLSL ES 3.10" > > > + : "GL_ARB_arrays_of_arrays or GLSL 4.30"; > > > _mesa_glsl_error(loc, state, > > > - "invalid array of `%s'" > > > - "GL_ARB_arrays_of_arrays " > > > - "required for defining arrays of arrays", > > > - base->name); > > > + "invalid array of `%s' " > > > + "%s required for defining arrays of arrays", > > > + base->name, requirement); > > > + > > > return glsl_type::error_type; > > > } > > >} > > > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > > > 1f08893..c480689 100644 > > > --- a/src/glsl/glsl_parser.yy > > > +++ b/src/glsl/glsl_parser.yy > > > @@ -1856,10 +1856,13 @@ array_specifier: > > >void *ctx = state; > > >$$ = $1; > > > > > > - if (!state->ARB_arrays_of_arrays_enable) { > > > - _mesa_glsl_error(& @1, state, > > > - "GL_ARB_arrays_of_arrays " > > > - "required for defining arrays of arrays"); > > > + if (!state->has_arrays_of_arrays()) { > > > + const char *const requirement = state->es_shader > > > +? "GLSL ES 3.10" > > > +: "GL_ARB_arrays_of_arrays or GLSL 4.30"; > > > + _mesa_glsl_error(& @1, state, > > > +
Re: [Mesa-dev] [PATCH 16/16] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
Hi Timothy, This patch will unlock a lot of GLES 3.1 AoA related CTS tests. It would be nice to see it merged. Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Timothy Arceri > Sent: Saturday, July 18, 2015 3:26 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 16/16] glsl: Allow arrays of arrays in GLSL ES 3.10 > and GLSL 4.30 > > V2: add missing 's' to the extension name in error messages and add decimal > place in version string > --- > src/glsl/ast_to_hir.cpp | 13 - > src/glsl/glsl_parser.yy | 22 ++ > src/glsl/glsl_parser_extras.h | 5 + > 3 files changed, 27 insertions(+), 13 deletions(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index > 8154c1e..fe169b3 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const > glsl_type *base, >* >* "Only one-dimensional arrays may be declared." >*/ > - if (!state->ARB_arrays_of_arrays_enable) { > + if (!state->has_arrays_of_arrays()) { > +const char *const requirement = state->es_shader > + ? "GLSL ES 3.10" > + : "GL_ARB_arrays_of_arrays or GLSL 4.30"; > _mesa_glsl_error(loc, state, > - "invalid array of `%s'" > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays", > - base->name); > + "invalid array of `%s' " > + "%s required for defining arrays of arrays", > + base->name, requirement); > + > return glsl_type::error_type; > } >} > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index > 1f08893..c480689 100644 > --- a/src/glsl/glsl_parser.yy > +++ b/src/glsl/glsl_parser.yy > @@ -1856,10 +1856,13 @@ array_specifier: >void *ctx = state; >$$ = $1; > > - if (!state->ARB_arrays_of_arrays_enable) { > - _mesa_glsl_error(& @1, state, > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays"); > + if (!state->has_arrays_of_arrays()) { > + const char *const requirement = state->es_shader > +? "GLSL ES 3.10" > +: "GL_ARB_arrays_of_arrays or GLSL 4.30"; > + _mesa_glsl_error(& @1, state, > + "%s required for defining arrays of arrays.", > + requirement); >} >$$->add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, > NULL, > NULL, NULL)); @@ -1868,10 > +1871,13 @@ > array_specifier: > { >$$ = $1; > > - if (!state->ARB_arrays_of_arrays_enable) { > - _mesa_glsl_error(& @1, state, > - "GL_ARB_arrays_of_arrays " > - "required for defining arrays of arrays"); > + if (!state->has_arrays_of_arrays()) { > + const char *const requirement = state->es_shader > +? "GLSL ES 3.10" > +: "GL_ARB_arrays_of_arrays or GLSL 4.30"; > + _mesa_glsl_error(& @1, state, > + "%s required for defining arrays of arrays.", > + requirement); >} > >$$->add_dimension($3); > diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h > index > 02ddbbd..ba760fe 100644 > --- a/src/glsl/glsl_parser_extras.h > +++ b/src/glsl/glsl_parser_extras.h > @@ -190,6 +190,11 @@ struct _mesa_glsl_parse_state { >return true; > } > > + bool has_arrays_of_arrays() const > + { > + return ARB_arrays_of_arrays_enable || is_version(430, 310); > + } > + > bool has_atomic_counters() const > { >return ARB_shader_atomic_counters_enable || is_version(420, 310); > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] mesa/es3.1: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Thursday, August 27, 2015 11:51 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2] mesa/es3.1: Expose > GL_ARB_framebuffer_no_attachments to GLES 3.1 > > On Thu, Aug 27, 2015 at 3:17 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > V2: Conform to new standard for exposing enums for OpenGL ES 3.1. > > > > Signed-off-by: Marta Lofstedt > > Reviewed-by: Ilia Mirkin > Thanks for the review. > While this patch is fine, it appears that ES3.1 doesn't have > GL_FRAMEBUFFER_DEFAULT_LAYERS, although ES3.2 does. I'm guessing it > comes in via OES_geometry_shader (which mesa does not expose right > now). Yes, I have noted that. I believe there are more geometry shader enums that need to be handled once we start enabling GLES 3.2. BR, /Marta > > Please look over the spec for any other differences. > > -ilia > > > --- > > src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml | 4 ++-- > > src/mapi/glapi/gen/apiexec.py | 4 ++-- > > src/mesa/main/get_hash_params.py | 8 +--- > > src/mesa/main/tests/dispatch_sanity.cpp | 6 ++ > > src/mesa/main/version.c | 2 +- > > 5 files changed, 12 insertions(+), 12 deletions(-) > > > > diff --git a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > index 59839a0..55ad764 100644 > > --- a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > +++ b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > @@ -15,13 +15,13 @@ > > /> > > value="0x9318" /> > > > > - > > + > > > > > > > > > > > > - > > + > > > > > > diff > > --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py > > index 3a0eb18..58ec08b 100644 > > --- a/src/mapi/glapi/gen/apiexec.py > > +++ b/src/mapi/glapi/gen/apiexec.py > > @@ -151,8 +151,8 @@ functions = { > > > > # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments. Mesa can > expose the > > # extension with OpenGL 3.0. > > -"FramebufferParameteri": exec_info(compatibility=30, core=31), > > -"GetFramebufferParameteri": exec_info(compatibility=30, core=31), > > +"FramebufferParameteri": exec_info(compatibility=30, core=31, > es2=31), > > +"GetFramebufferParameteri": exec_info(compatibility=30, core=31, > > + es2=31), > > > > # OpenGL 4.5 / GL_ARB_direct_state_access. Mesa can expose the > extension > > # with core profile. > > diff --git a/src/mesa/main/get_hash_params.py > > b/src/mesa/main/get_hash_params.py > > index 517c391..ddebade 100644 > > --- a/src/mesa/main/get_hash_params.py > > +++ b/src/mesa/main/get_hash_params.py > > @@ -450,6 +450,11 @@ descriptor=[ > > > > # GL_ARB_explicit_uniform_location / GLES 3.1 > >[ "MAX_UNIFORM_LOCATIONS", > > "CONTEXT_INT(Const.MaxUserAssignableUniformLocations), > > extra_ARB_explicit_uniform_location_es31" ], > > + > > +# GL_ARB_framebuffer_no_attachments / GLES 3.1 > > + ["MAX_FRAMEBUFFER_WIDTH", > "CONTEXT_INT(Const.MaxFramebufferWidth), > > +extra_ARB_framebuffer_no_attachments"], > > + ["MAX_FRAMEBUFFER_HEIGHT", > > +"CONTEXT_INT(Const.MaxFramebufferHeight), > > +extra_ARB_framebuffer_no_attachments"], > > + ["MAX_FRAMEBUFFER_SAMPLES", > > +"CONTEXT_INT(Const.MaxFramebufferSamples), > > +extra_ARB_framebuffer_no_attachments"], > > ]}, > > > > # Enums in OpenGL Core profile and ES 3.1 @@ -811,10 +816,7 @@ > > descriptor=[ > >[ "MAX_GEOMETRY_IMAGE_UNIFORMS", > > > "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUnif > orms), > > extra_ARB_shader_image_load_store_and_geometry_shader"], > > > > # GL_ARB_framebuffer_no_attachments > > - ["MAX_FRAMEBUFFER_WIDTH", > "CONTEXT_INT(Const.MaxFramebufferWidth), > > extra_ARB_framebuffer_no_attachments"], > > - ["MAX_FRAMEBUFFER_HEIGHT", > "CONTEXT_INT(Const.MaxFramebufferHeight), > extra_ARB_framebuffer_no_attachments"], > >["MAX_FRAMEBUFFER_LAYERS", > > "CONTEXT_INT(Const.MaxFramebufferLayers), > > extra_ARB_framebuffer_no_attachments"], > > - ["MAX_FRAMEBUFFER_SAMPLES", > > "CONTEXT_INT(Const.MaxFramebufferSamples), > > extra_ARB_framebuffer_no_attachments"], > > > > # GL_EXT_polygon_offset_clamp > >[ "POLYGON_OFFSET_CLAMP_EXT", > "CONTEXT_FLOAT(Polygon.OffsetClamp), > > extra_EXT_polygon_offset_clamp" ], diff --git > > a/src/mesa/main/tests/dispatch_sanity.cpp > > b/src/mesa/main/tests/dispatch_sanity.cpp > > index 59107eb..b9a760f 100644 > > --- a/src/mesa/main/tests/dispatch_sanity.cpp > > +++ b/src/mesa/main/tests/dispatch_sanity.cpp > > @@ -2405,10 +2405,8 @@ const struct function > gles31_functions_possible[] = { > > { "glDrawArraysIndirect", 31, -1 }, > > { "glDrawElementsIndirect", 31, -1 }, > > > > - // FINISHME: These two fun
Re: [Mesa-dev] [PATCH v2 1/2] mesa/es3.1: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Ilia Mirkin > Sent: Monday, August 24, 2015 3:02 PM > To: Marta Lofstedt > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v2 1/2] mesa/es3.1: Expose > GL_ARB_framebuffer_no_attachments to GLES 3.1 > > On Mon, Aug 24, 2015 at 7:01 AM, Marta Lofstedt > wrote: > > From: Marta Lofstedt > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml | 4 ++-- > > src/mapi/glapi/gen/apiexec.py | 4 ++-- > > src/mesa/main/get.c | 6 ++ > > src/mesa/main/get_hash_params.py | 8 +--- > > src/mesa/main/tests/dispatch_sanity.cpp | 6 ++ > > src/mesa/main/version.c | 2 +- > > 6 files changed, 18 insertions(+), 12 deletions(-) > > > > diff --git a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > index 59839a0..55ad764 100644 > > --- a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > +++ b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml > > @@ -15,13 +15,13 @@ > > /> > > value="0x9318" /> > > > > - > > + > > > > > > > > > > > > - > > + > > > > > > diff > > --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py > > index 3a0eb18..58ec08b 100644 > > --- a/src/mapi/glapi/gen/apiexec.py > > +++ b/src/mapi/glapi/gen/apiexec.py > > @@ -151,8 +151,8 @@ functions = { > > > > # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments. Mesa can > expose the > > # extension with OpenGL 3.0. > > -"FramebufferParameteri": exec_info(compatibility=30, core=31), > > -"GetFramebufferParameteri": exec_info(compatibility=30, core=31), > > +"FramebufferParameteri": exec_info(compatibility=30, core=31, > es2=31), > > +"GetFramebufferParameteri": exec_info(compatibility=30, core=31, > > + es2=31), > > > > # OpenGL 4.5 / GL_ARB_direct_state_access. Mesa can expose the > extension > > # with core profile. > > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index > > 307a5ff..8542ddb 100644 > > --- a/src/mesa/main/get.c > > +++ b/src/mesa/main/get.c > > @@ -403,6 +403,12 @@ static const int > extra_ARB_explicit_uniform_location_es31[] = { > > EXTRA_END > > }; > > > > +static const int extra_ARB_framebuffer_no_attachments_es31[] = { > > + EXT(ARB_framebuffer_no_attachments), > > + EXTRA_API_ES31, > > + EXTRA_END > > +}; > > What does this add? When would you have ES31 but not > ARB_framebuffer_no_attachments? As far as I understand, I am following what appear to be the established template on how to add GLES 3.1 stuff that previously has only been exposed under OpenGL. > > > + > > EXTRA_EXT(ARB_texture_cube_map); > > EXTRA_EXT(EXT_texture_array); > > EXTRA_EXT(NV_fog_distance); > > diff --git a/src/mesa/main/get_hash_params.py > > b/src/mesa/main/get_hash_params.py > > index 517c391..3d6ed64 100644 > > --- a/src/mesa/main/get_hash_params.py > > +++ b/src/mesa/main/get_hash_params.py > > @@ -450,6 +450,11 @@ descriptor=[ > > > > # GL_ARB_explicit_uniform_location / GLES 3.1 > >[ "MAX_UNIFORM_LOCATIONS", > > "CONTEXT_INT(Const.MaxUserAssignableUniformLocations), > > extra_ARB_explicit_uniform_location_es31" ], > > + > > +# GL_ARB_framebuffer_no_attachments / GLES 3.1 > > + ["MAX_FRAMEBUFFER_WIDTH", > "CONTEXT_INT(Const.MaxFramebufferWidth), > > +extra_ARB_framebuffer_no_attachments_es31"], > > + ["MAX_FRAMEBUFFER_HEIGHT", > > +"CONTEXT_INT(Const.MaxFramebufferHeight), > > +extra_ARB_framebuffer_no_attachments_es31"], > > + ["MAX_FRAMEBUFFER_SAMPLES", > > +"CONTEXT_INT(Const.MaxFramebufferSamples), > > +extra_ARB_framebuffer_no_attachments_es31"], > > ]}, > > > > # Enums in OpenGL Core profile and ES 3.1 @@ -811,10 +816,7 @@ > > descriptor=[ > >[ "MAX_GEOMETRY_IMAGE_UNIFORMS", > > > "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUnif > orms), > > extra_ARB_shader_image_load_store_and_geometry_shader"], > > > > # GL_ARB_framebuffer_no_attachments > > - ["MAX_FRAMEBUFFER_WIDTH", > "CONTEXT_INT(Const.MaxFramebufferWidth), > > extra_ARB_framebuffer_no_attachments"], > > - ["MAX_FRAMEBUFFER_HEIGHT", > "CONTEXT_INT(Const.MaxFramebufferHeight), > extra_ARB_framebuffer_no_attachments"], > >["MAX_FRAMEBUFFER_LAYERS", > > "CONTEXT_INT(Const.MaxFramebufferLayers), > > extra_ARB_framebuffer_no_attachments"], > > - ["MAX_FRAMEBUFFER_SAMPLES", > > "CONTEXT_INT(Const.MaxFramebufferSamples), > > extra_ARB_framebuffer_no_attachments"], > > > > # GL_EXT_polygon_offset_clamp > >[ "POLYGON_OFFSET_CLAMP_EXT", > "CONTEXT_FLOAT(Polygon.OffsetClamp), > > extra_EXT_polygon_offset_clamp" ], diff --git > > a/src/mesa/main/tests/dispatch_sanity.cpp > > b/src/mesa/main/tests/dispatch_sanity.cpp >
Re: [Mesa-dev] [PATCH 2/2] mesa/es3.1: Limit Framebuffer Parameter OpenGL ES 3.1 usage
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Monday, August 24, 2015 11:22 AM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 2/2] mesa/es3.1: Limit Framebuffer > Parameter OpenGL ES 3.1 usage > > > > On 08/24/2015 10:10 AM, Marta Lofstedt wrote: > > From: Marta Lofstedt > > > > According to OpenGL ES 3.1 specification, section 9.2.1 for > > glFramebufferParameter and section 9.2.3 for > > glGetFramebufferParameteriv: > > > > "An INVALID_ENUM error is generated if pname is not > > FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT, > > FRAMEBUFFER_DEFAULT_SAMPLES, or > > FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS." > > > > Therefore exclude OpenGL ES 3.1 from using the > > GL_FRAMEBUFFER_DEFAULT_LAYERS parameter. > > > > Signed-off-by: Marta Lofstedt > > --- > > src/mesa/main/fbobject.c | 34 -- > > 1 file changed, 28 insertions(+), 6 deletions(-) > > > > diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index > > 07db195..1bbdd30 100644 > > --- a/src/mesa/main/fbobject.c > > +++ b/src/mesa/main/fbobject.c > > @@ -1389,11 +1389,22 @@ framebuffer_parameteri(struct gl_context > *ctx, struct gl_framebuffer *fb, > >fb->DefaultGeometry.Height = param; > > break; > > case GL_FRAMEBUFFER_DEFAULT_LAYERS: > > - if (param < 0 || param > ctx->Const.MaxFramebufferLayers) > > -_mesa_error(ctx, GL_INVALID_VALUE, "%s", func); > > - else > > - fb->DefaultGeometry.Layers = param; > > - break; > > + /* > > + * According to the OpenGL ES 3.1 specification, > > + * section 9.2.1, the GL_FRAMEBUFFER_DEFAULT_LAYERS > > + * parameter name is not supported. > > + */ > > + if (_mesa_is_gles31(ctx)) { > > + _mesa_error(ctx, GL_INVALID_ENUM, > > + "%s(pname=0x%x)", func, pname); > > + } > > + else { > > + if (param < 0 || param > ctx->Const.MaxFramebufferLayers) > > +_mesa_error(ctx, GL_INVALID_VALUE, "%s", func); > > + else > > +fb->DefaultGeometry.Layers = param; > > + break; > > + } > > I'd suggest to avoid else { ... }, just insert the error case before regular > handling and break out if error. No need to touch original code and looks > cleaner. OKI, done in V2. > > > case GL_FRAMEBUFFER_DEFAULT_SAMPLES: > > if (param < 0 || param > ctx->Const.MaxFramebufferSamples) > > _mesa_error(ctx, GL_INVALID_VALUE, "%s", func); @@ -1451,7 > > +1462,18 @@ get_framebuffer_parameteriv(struct gl_context *ctx, struct > gl_framebuffer *fb, > > *params = fb->DefaultGeometry.Height; > > break; > > case GL_FRAMEBUFFER_DEFAULT_LAYERS: > > - *params = fb->DefaultGeometry.Layers; > > + /* > > + * According to the OpenGL ES 3.1 specification, > > + * section 9.2.3, the GL_FRAMEBUFFER_LAYERS > > + * parameter name is not supported. > > + */ > > + if (_mesa_is_gles31(ctx)) { > > + _mesa_error(ctx, GL_INVALID_ENUM, > > + "%s(pname=0x%x)", func, pname); > > + } > > + else { > > + *params = fb->DefaultGeometry.Layers; > > + } > > same here > > > break; > > case GL_FRAMEBUFFER_DEFAULT_SAMPLES: > > *params = fb->DefaultGeometry.NumSamples; > > > > > With these changes both of the patches are > > Reviewed-by: Tapani Pälli > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] mesa/es3.1: Limit Framebuffer Parameter OpenGL ES 3.1 usage
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Monday, August 24, 2015 12:05 PM > To: Marta Lofstedt; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 2/2] mesa/es3.1: Limit Framebuffer > Parameter OpenGL ES 3.1 usage > > > > On 08/24/2015 12:21 PM, Tapani Pälli wrote: > > > > > > On 08/24/2015 10:10 AM, Marta Lofstedt wrote: > >> From: Marta Lofstedt > >> > >> According to OpenGL ES 3.1 specification, section 9.2.1 for > >> glFramebufferParameter and section 9.2.3 for > >> glGetFramebufferParameteriv: > >> > >> "An INVALID_ENUM error is generated if pname is not > >> FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT, > >> FRAMEBUFFER_DEFAULT_SAMPLES, or > >> FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS." > >> > >> Therefore exclude OpenGL ES 3.1 from using the > >> GL_FRAMEBUFFER_DEFAULT_LAYERS parameter. > >> > >> Signed-off-by: Marta Lofstedt > >> --- > >> src/mesa/main/fbobject.c | 34 -- > >> 1 file changed, 28 insertions(+), 6 deletions(-) > >> > >> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c > >> index 07db195..1bbdd30 100644 > >> --- a/src/mesa/main/fbobject.c > >> +++ b/src/mesa/main/fbobject.c > >> @@ -1389,11 +1389,22 @@ framebuffer_parameteri(struct gl_context > >> *ctx, struct gl_framebuffer *fb, > >>fb->DefaultGeometry.Height = param; > >> break; > >> case GL_FRAMEBUFFER_DEFAULT_LAYERS: > >> - if (param < 0 || param > ctx->Const.MaxFramebufferLayers) > >> -_mesa_error(ctx, GL_INVALID_VALUE, "%s", func); > >> - else > >> - fb->DefaultGeometry.Layers = param; > >> - break; > >> + /* > >> + * According to the OpenGL ES 3.1 specification, > >> + * section 9.2.1, the GL_FRAMEBUFFER_DEFAULT_LAYERS > >> + * parameter name is not supported. > >> + */ > >> + if (_mesa_is_gles31(ctx)) { > >> + _mesa_error(ctx, GL_INVALID_ENUM, > >> + "%s(pname=0x%x)", func, pname); > >> + } > >> + else { > >> + if (param < 0 || param > ctx->Const.MaxFramebufferLayers) > >> +_mesa_error(ctx, GL_INVALID_VALUE, "%s", func); > >> + else > >> +fb->DefaultGeometry.Layers = param; > >> + break; > >> + } > > > > I'd suggest to avoid else { ... }, just insert the error case before > > regular handling and break out if error. No need to touch original > > code and looks cleaner. > > > >> case GL_FRAMEBUFFER_DEFAULT_SAMPLES: > >> if (param < 0 || param > ctx->Const.MaxFramebufferSamples) > >> _mesa_error(ctx, GL_INVALID_VALUE, "%s", func); @@ -1451,7 > >> +1462,18 @@ get_framebuffer_parameteriv(struct gl_context *ctx, > >> struct gl_framebuffer *fb, > >> *params = fb->DefaultGeometry.Height; > >> break; > >> case GL_FRAMEBUFFER_DEFAULT_LAYERS: > >> - *params = fb->DefaultGeometry.Layers; > >> + /* > >> + * According to the OpenGL ES 3.1 specification, > >> + * section 9.2.3, the GL_FRAMEBUFFER_LAYERS > >> + * parameter name is not supported. > >> + */ > >> + if (_mesa_is_gles31(ctx)) { > >> + _mesa_error(ctx, GL_INVALID_ENUM, > >> + "%s(pname=0x%x)", func, pname); > >> + } > >> + else { > >> + *params = fb->DefaultGeometry.Layers; > >> + } > > > > same here > > > >> break; > >> case GL_FRAMEBUFFER_DEFAULT_SAMPLES: > >> *params = fb->DefaultGeometry.NumSamples; > >> > > > > > > With these changes both of the patches are > > > > Reviewed-by: Tapani Pälli > > One note, I just spotted that with these changes you can also enable > ARB_framebuffer_no_attachments for 3.1 check in compute_version_es2() > (version.c). OK, this is done in V2 of "Expose GL_ARB_framebuffer_no_attachments to GLES 3.1" > > // Tapani > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/6] mesa: Add extension enable for OES_texture_storage_multisample_2d_array
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 3/6] mesa: Add extension enable for > OES_texture_storage_multisample_2d_array > > Signed-off-by: Tapani Pälli > --- > src/mesa/main/extensions.c | 1 + > src/mesa/main/mtypes.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index > 4a3c231..d3f43cc 100644 > --- a/src/mesa/main/extensions.c > +++ b/src/mesa/main/extensions.c > @@ -336,6 +336,7 @@ static const struct extension extension_table[] = { > { "GL_OES_texture_half_float", o(OES_texture_half_float), > ES2, 2005 }, > { "GL_OES_texture_half_float_linear", > o(OES_texture_half_float_linear), ES2, 2005 }, > { "GL_OES_texture_mirrored_repeat", o(dummy_true), > ES1, 2005 }, > + { > "GL_OES_texture_storage_multisample_2d_array",o(OES_texture_storage_ > multisample_2d_array), ES31, 2014 }, > { "GL_OES_texture_npot", > o(ARB_texture_non_power_of_two), ES1 | ES2, 2005 }, > { "GL_OES_vertex_array_object", o(dummy_true), > ES1 | ES2, 2010 }, > > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index > 5031b08..e49f57b 100644 > --- a/src/mesa/main/mtypes.h > +++ b/src/mesa/main/mtypes.h > @@ -3874,6 +3874,7 @@ struct gl_extensions > GLboolean OES_texture_half_float; > GLboolean OES_texture_half_float_linear; > GLboolean OES_compressed_ETC1_RGB8_texture; > + GLboolean OES_texture_storage_multisample_2d_array; > GLboolean extension_sentinel; > /** The extension string */ > const GLubyte *String; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/6] glapi: add GL_OES_texture_storage_multisample_2d_array extension
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 2/6] glapi: add > GL_OES_texture_storage_multisample_2d_array extension > > Signed-off-by: Tapani Pälli > --- > src/mapi/glapi/gen/es_EXT.xml | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml > index 642e3b3..cfca5a9 100644 > --- a/src/mapi/glapi/gen/es_EXT.xml > +++ b/src/mapi/glapi/gen/es_EXT.xml > @@ -798,4 +798,23 @@ > > > > + +name="GL_OES_texture_storage_multisample_2d_array" number="174"> > + value="0x9102"/> > + value="0x9105"/> > + value="0x910B"/> > + value="0x910C"/> > + name="UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES" > +value="0x910D"/> > + > + alias="TexStorage3DMultisample" es2="3.1"> > + > + > + > + > + > + > + > + > + > + > > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/6] mesa: GetTexLevelParameter{if}v changes for OpenGL ES 3.1
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 1/6] mesa: GetTexLevelParameter{if}v changes > for OpenGL ES 3.1 > > Patch refactors existing parameters check to first check common enums > between desktop GL and GLES 3.1 and modifies > get_tex_level_parameter_image to be compatible with enums specified in > 3.1. > > Signed-off-by: Tapani Pälli > --- > src/mesa/main/texparam.c | 34 +++--- > 1 file changed, 23 insertions(+), 11 deletions(-) > > diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index > 16739f1..947a2a1 100644 > --- a/src/mesa/main/texparam.c > +++ b/src/mesa/main/texparam.c > @@ -1208,20 +1208,34 @@ static GLboolean > legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum > target, > bool dsa) { > + /* Common targets for desktop GL and GLES 3.1. */ > switch (target) { > - case GL_TEXTURE_1D: > - case GL_PROXY_TEXTURE_1D: > case GL_TEXTURE_2D: > - case GL_PROXY_TEXTURE_2D: > case GL_TEXTURE_3D: > - case GL_PROXY_TEXTURE_3D: >return GL_TRUE; > + case GL_TEXTURE_2D_ARRAY_EXT: > + return (_mesa_is_gles31(ctx) || > + ctx->Extensions.EXT_texture_array); > case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: > case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: > case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: > case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: > case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: > case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: > + return (_mesa_is_gles31(ctx) || ctx- > >Extensions.ARB_texture_cube_map); > + case GL_TEXTURE_2D_MULTISAMPLE: > + return (_mesa_is_gles31(ctx) || ctx- > >Extensions.ARB_texture_multisample); > + } > + > + if (!_mesa_is_desktop_gl(ctx)) > + return GL_FALSE; > + > + /* Rest of the desktop GL targets. */ > + switch (target) { > + case GL_TEXTURE_1D: > + case GL_PROXY_TEXTURE_1D: > + case GL_PROXY_TEXTURE_2D: > + case GL_PROXY_TEXTURE_3D: > + return GL_TRUE; > case GL_PROXY_TEXTURE_CUBE_MAP_ARB: >return ctx->Extensions.ARB_texture_cube_map; > case GL_TEXTURE_CUBE_MAP_ARRAY_ARB: > @@ -1232,7 +1246,6 @@ legal_get_tex_level_parameter_target(struct > gl_context *ctx, GLenum target, >return ctx->Extensions.NV_texture_rectangle; > case GL_TEXTURE_1D_ARRAY_EXT: > case GL_PROXY_TEXTURE_1D_ARRAY_EXT: > - case GL_TEXTURE_2D_ARRAY_EXT: > case GL_PROXY_TEXTURE_2D_ARRAY_EXT: >return ctx->Extensions.EXT_texture_array; > case GL_TEXTURE_BUFFER: > @@ -1254,7 +1267,6 @@ legal_get_tex_level_parameter_target(struct > gl_context *ctx, GLenum target, > * "target may also be TEXTURE_BUFFER, indicating the texture buffer." > */ >return ctx->API == API_OPENGL_CORE && ctx->Version >= 31; > - case GL_TEXTURE_2D_MULTISAMPLE: > case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: > case GL_PROXY_TEXTURE_2D_MULTISAMPLE: > case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: > @@ -1381,8 +1393,8 @@ get_tex_level_parameter_image(struct gl_context > *ctx, > *params = _mesa_get_format_bits(texFormat, pname); > break; >case GL_TEXTURE_SHARED_SIZE: > - if (ctx->Version < 30 && > - !ctx->Extensions.EXT_texture_shared_exponent) > + if (!_mesa_is_gles31(ctx) && (ctx->Version < 30 && > + !ctx->Extensions.EXT_texture_shared_exponent)) > goto invalid_pname; > *params = texFormat == MESA_FORMAT_R9G9B9E5_FLOAT ? 5 : 0; > break; > @@ -1415,7 +1427,7 @@ get_tex_level_parameter_image(struct gl_context > *ctx, >case GL_TEXTURE_BLUE_TYPE_ARB: >case GL_TEXTURE_ALPHA_TYPE_ARB: >case GL_TEXTURE_DEPTH_TYPE_ARB: > - if (!ctx->Extensions.ARB_texture_float) > + if (!_mesa_is_gles31(ctx) && > + !ctx->Extensions.ARB_texture_float) > goto invalid_pname; >if (_mesa_base_format_has_channel(img->_BaseFormat, > pname)) > *params = _mesa_get_format_datatype(texFormat); > @@ -1425,13 +1437,13 @@ get_tex_level_parameter_image(struct > gl_context *ctx, > >/* GL_ARB_texture_multisample */ >case GL_TEXTURE_SAMPLES: > - if (!ctx->Extensions.ARB_texture_multisample) > + if (!_mesa_is_gles31(ctx) && > + !ctx->Extensions.ARB_texture_multisample) > goto invalid_pname; > *params = img->NumSamples; > break; > >case GL_TEXTURE_FIXED_SAMPLE_LOCATIONS: > - if (!ctx->Extensions.ARB_texture_multisample) > + if (!_mesa_is_gles31(ctx) && > + !ctx->Extensions.ARB_texture_multisample) > goto invalid_pname; > *params = img->FixedSampleLocations; > break; > -- > 2.4.3 > > ___ > me
Re: [Mesa-dev] [PATCH 5/6] mesa: enable enums for OES_texture_storage_multisample_2d_array
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 5/6] mesa: enable enums for > OES_texture_storage_multisample_2d_array > > Signed-off-by: Tapani Pälli > --- > src/mesa/main/get_hash_params.py | 6 +++--- > src/mesa/main/texobj.c | 6 -- > src/mesa/main/texparam.c | 2 +- > 3 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/src/mesa/main/get_hash_params.py > b/src/mesa/main/get_hash_params.py > index 517c391..c06e9b1 100644 > --- a/src/mesa/main/get_hash_params.py > +++ b/src/mesa/main/get_hash_params.py > @@ -434,6 +434,9 @@ descriptor=[ >[ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), > extra_ARB_texture_multisample_es31" ], >[ "MAX_SAMPLE_MASK_WORDS", "CONST(1), > extra_ARB_texture_multisample_es31" ], > > +# GL_ARB_texture_multisample / ES 3.1 with > +GL_OES_texture_storage_multisample_2d_array > + [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, > TYPE_INT, > +TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, > extra_ARB_texture_multisample_es31" > +], > + > # GL_ARB_texture_gather / GLES 3.1 >[ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", > "CONTEXT_INT(Const.MinProgramTextureGatherOffset), > extra_ARB_texture_gather_es31"], >[ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", > "CONTEXT_INT(Const.MaxProgramTextureGatherOffset), > extra_ARB_texture_gather_es31"], @@ -740,9 +743,6 @@ descriptor=[ >[ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0, > extra_texture_buffer_object" ], >[ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, > extra_texture_buffer_object" ], > > -# GL_ARB_texture_multisample / GL 3.2 > - [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, > TYPE_INT, TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, > extra_ARB_texture_multisample" ], > - > # GL 3.0 >[ "CONTEXT_FLAGS", "CONTEXT_INT(Const.ContextFlags), > extra_version_30" ], > > diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index > 395e4d3..a3f44c9 100644 > --- a/src/mesa/main/texobj.c > +++ b/src/mesa/main/texobj.c > @@ -217,7 +217,8 @@ _mesa_get_current_tex_object(struct gl_context > *ctx, GLenum target) > return ctx->Extensions.ARB_texture_multisample > ? ctx->Texture.ProxyTex[TEXTURE_2D_MULTISAMPLE_INDEX] : NULL; >case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: > - return ctx->Extensions.ARB_texture_multisample > + return (ctx->Extensions.ARB_texture_multisample || > + > + ctx->Extensions.OES_texture_storage_multisample_2d_array) > ? texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX] : > NULL; >case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: > return ctx->Extensions.ARB_texture_multisample > @@ -1612,7 +1613,8 @@ _mesa_tex_target_to_index(const struct > gl_context *ctx, GLenum target) >return ((_mesa_is_desktop_gl(ctx) && ctx- > >Extensions.ARB_texture_multisample) || >_mesa_is_gles31(ctx)) ? TEXTURE_2D_MULTISAMPLE_INDEX: -1; > case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: > - return _mesa_is_desktop_gl(ctx) && ctx- > >Extensions.ARB_texture_multisample > + return ((_mesa_is_desktop_gl(ctx) && ctx- > >Extensions.ARB_texture_multisample) || > + ctx->Extensions.OES_texture_storage_multisample_2d_array) > ? TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX: -1; > default: >return -1; > diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index > 947a2a1..3b72417 100644 > --- a/src/mesa/main/texparam.c > +++ b/src/mesa/main/texparam.c > @@ -1223,6 +1223,7 @@ legal_get_tex_level_parameter_target(struct > gl_context *ctx, GLenum target, > case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: >return (_mesa_is_gles31(ctx) || ctx- > >Extensions.ARB_texture_cube_map); > case GL_TEXTURE_2D_MULTISAMPLE: > + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: >return (_mesa_is_gles31(ctx) || ctx- > >Extensions.ARB_texture_multisample); > } > > @@ -1267,7 +1268,6 @@ legal_get_tex_level_parameter_target(struct > gl_context *ctx, GLenum target, > * "target may also be TEXTURE_BUFFER, indicating the texture buffer." > */ >return ctx->API == API_OPENGL_CORE && ctx->Version >= 31; > - case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: > case GL_PROXY_TEXTURE_2D_MULTISAMPLE: > case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: >return ctx->Extensions.ARB_texture_multisample; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 6/6] i965: enable OES_texture_storage_multisample_2d_array
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 6/6] i965: enable > OES_texture_storage_multisample_2d_array > > Signed-off-by: Tapani Pälli > --- > src/mesa/drivers/dri/i965/intel_extensions.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c > b/src/mesa/drivers/dri/i965/intel_extensions.c > index 4365b71..3a47b85 100644 > --- a/src/mesa/drivers/dri/i965/intel_extensions.c > +++ b/src/mesa/drivers/dri/i965/intel_extensions.c > @@ -262,6 +262,7 @@ intelInitExtensions(struct gl_context *ctx) > ctx->Extensions.OES_texture_float_linear = true; > ctx->Extensions.OES_texture_half_float = true; > ctx->Extensions.OES_texture_half_float_linear = true; > + ctx->Extensions.OES_texture_storage_multisample_2d_array = true; > > if (brw->gen >= 6) >ctx->Const.GLSLVersion = 330; > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/6] glsl: add support for OES_texture_storage_multisample_2d_array
Reviewed-by: Marta Lofstedt > -Original Message- > From: Palli, Tapani > Sent: Monday, August 24, 2015 7:11 AM > To: Lofstedt, Marta; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH 4/6] glsl: add support for > OES_texture_storage_multisample_2d_array > > > > On 08/21/2015 01:29 PM, Lofstedt, Marta wrote: > >> -Original Message- > >> From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > >> Behalf Of Tapani Pälli > >> Sent: Friday, August 21, 2015 9:22 AM > >> To: mesa-dev@lists.freedesktop.org > >> Subject: [Mesa-dev] [PATCH 4/6] glsl: add support for > >> OES_texture_storage_multisample_2d_array > >> > >> Patch adds extension enable bit and enables required keywords and > >> builtin functions for the extension. > >> > >> Signed-off-by: Tapani Pälli > >> --- > >> src/glsl/builtin_functions.cpp | 5 +++-- > >> src/glsl/builtin_types.cpp | 3 ++- > >> src/glsl/glcpp/glcpp-parse.y| 2 ++ > >> src/glsl/glsl_lexer.ll | 6 +++--- > >> src/glsl/glsl_parser_extras.cpp | 1 + > >> src/glsl/glsl_parser_extras.h | 2 ++ > >> 6 files changed, 13 insertions(+), 6 deletions(-) > >> > >> diff --git a/src/glsl/builtin_functions.cpp > >> b/src/glsl/builtin_functions.cpp index 57bed86..a4e9baf 100644 > >> --- a/src/glsl/builtin_functions.cpp > >> +++ b/src/glsl/builtin_functions.cpp > >> @@ -284,8 +284,9 @@ texture_multisample(const > _mesa_glsl_parse_state > >> *state) static bool texture_multisample_array(const > >> _mesa_glsl_parse_state *state) { > >> - return state->is_version(150, 0) || > >> - state->ARB_texture_multisample_enable; > >> + return state->is_version(150, 320) || > > > > Could you explain 320? > > The rest of the patchset appear to go for exposure under GLES 3.1 > > This is not necessary change, it's a 'when changing that line make sure that > it > does not need to be touched again' requested by Timothy here: > > http://lists.freedesktop.org/archives/mesa-dev/2015-August/091922.html > > I think this kind of 'future-proofing' in general is potentially dangerous > but in > the case of keywords and builtins it should not cause trouble. > > > > /Marta > > > >> + state->ARB_texture_multisample_enable || > >> + state->OES_texture_storage_multisample_2d_array_enable; > >> } > >> > >> > >> static bool > >> diff --git a/src/glsl/builtin_types.cpp b/src/glsl/builtin_types.cpp > >> index 9cf198f..0d0d71d 100644 > >> --- a/src/glsl/builtin_types.cpp > >> +++ b/src/glsl/builtin_types.cpp > >> @@ -307,7 +307,8 @@ _mesa_glsl_initialize_types(struct > >> _mesa_glsl_parse_state *state) > >> add_type(symbols, glsl_type::usamplerCubeArray_type); > >> } > >> > >> - if (state->ARB_texture_multisample_enable) { > >> + if (state->ARB_texture_multisample_enable || > >> + state->OES_texture_storage_multisample_2d_array_enable) { > >> add_type(symbols, glsl_type::sampler2DMS_type); > >> add_type(symbols, glsl_type::isampler2DMS_type); > >> add_type(symbols, glsl_type::usampler2DMS_type); diff --git > >> a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index > >> 18e50af..6396817 100644 > >> --- a/src/glsl/glcpp/glcpp-parse.y > >> +++ b/src/glsl/glcpp/glcpp-parse.y > >> @@ -2382,6 +2382,8 @@ > >> _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, > >> intmax_t versio > >> add_builtin_define(parser, > "GL_OES_EGL_image_external", > >> 1); > >> if (extensions->OES_standard_derivatives) > >>add_builtin_define(parser, > >> "GL_OES_standard_derivatives", 1); > >> + if (extensions->OES_texture_storage_multisample_2d_array) > >> + add_builtin_define(parser, > >> + "GL_OES_texture_storage_multisample_2d_array", 1); > >> } > >>} else { > >> add_builtin_define(parser, "GL_ARB_draw_buffers", 1); diff > >> --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll index > >> 24998c1..9d7ad74 > >> 100644 > >> --- a/src/glsl/glsl_lexer.ll > >> +++ b/src/glsl/glsl_lexer.ll > >> @@ -347,9 +347,9 @@
Re: [Mesa-dev] [PATCH 4/6] glsl: add support for OES_texture_storage_multisample_2d_array
> -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Friday, August 21, 2015 9:22 AM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH 4/6] glsl: add support for > OES_texture_storage_multisample_2d_array > > Patch adds extension enable bit and enables required keywords and builtin > functions for the extension. > > Signed-off-by: Tapani Pälli > --- > src/glsl/builtin_functions.cpp | 5 +++-- > src/glsl/builtin_types.cpp | 3 ++- > src/glsl/glcpp/glcpp-parse.y| 2 ++ > src/glsl/glsl_lexer.ll | 6 +++--- > src/glsl/glsl_parser_extras.cpp | 1 + > src/glsl/glsl_parser_extras.h | 2 ++ > 6 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp > index 57bed86..a4e9baf 100644 > --- a/src/glsl/builtin_functions.cpp > +++ b/src/glsl/builtin_functions.cpp > @@ -284,8 +284,9 @@ texture_multisample(const _mesa_glsl_parse_state > *state) static bool texture_multisample_array(const > _mesa_glsl_parse_state *state) { > - return state->is_version(150, 0) || > - state->ARB_texture_multisample_enable; > + return state->is_version(150, 320) || Could you explain 320? The rest of the patchset appear to go for exposure under GLES 3.1 /Marta > + state->ARB_texture_multisample_enable || > + state->OES_texture_storage_multisample_2d_array_enable; > } > > > static bool > diff --git a/src/glsl/builtin_types.cpp b/src/glsl/builtin_types.cpp index > 9cf198f..0d0d71d 100644 > --- a/src/glsl/builtin_types.cpp > +++ b/src/glsl/builtin_types.cpp > @@ -307,7 +307,8 @@ _mesa_glsl_initialize_types(struct > _mesa_glsl_parse_state *state) >add_type(symbols, glsl_type::usamplerCubeArray_type); > } > > - if (state->ARB_texture_multisample_enable) { > + if (state->ARB_texture_multisample_enable || > + state->OES_texture_storage_multisample_2d_array_enable) { >add_type(symbols, glsl_type::sampler2DMS_type); >add_type(symbols, glsl_type::isampler2DMS_type); >add_type(symbols, glsl_type::usampler2DMS_type); diff --git > a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index > 18e50af..6396817 100644 > --- a/src/glsl/glcpp/glcpp-parse.y > +++ b/src/glsl/glcpp/glcpp-parse.y > @@ -2382,6 +2382,8 @@ > _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, > intmax_t versio >add_builtin_define(parser, > "GL_OES_EGL_image_external", 1); >if (extensions->OES_standard_derivatives) > add_builtin_define(parser, "GL_OES_standard_derivatives", > 1); > + if (extensions->OES_texture_storage_multisample_2d_array) > + add_builtin_define(parser, > + "GL_OES_texture_storage_multisample_2d_array", 1); > } > } else { > add_builtin_define(parser, "GL_ARB_draw_buffers", 1); diff > --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll index 24998c1..9d7ad74 > 100644 > --- a/src/glsl/glsl_lexer.ll > +++ b/src/glsl/glsl_lexer.ll > @@ -347,9 +347,9 @@ usampler2DArray KEYWORD(130, 300, > 130, 300, USAMPLER2DARRAY); > sampler2DMSKEYWORD_WITH_ALT(150, 300, 150, 310, yyextra- > >ARB_texture_multisample_enable, SAMPLER2DMS); > isampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra- > >ARB_texture_multisample_enable, ISAMPLER2DMS); > usampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra- > >ARB_texture_multisample_enable, USAMPLER2DMS); > -sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra- > >ARB_texture_multisample_enable, SAMPLER2DMSARRAY); > -isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra- > >ARB_texture_multisample_enable, ISAMPLER2DMSARRAY); - > usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra- > >ARB_texture_multisample_enable, USAMPLER2DMSARRAY); > +sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, yyextra- > >ARB_texture_multisample_enable||yyextra- > >OES_texture_storage_multisample_2d_array_enable, > SAMPLER2DMSARRAY); > +isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, > +yyextra->ARB_texture_multisample_enable||yyextra- > >OES_texture_storage_m > +ultisample_2d_array_enable, ISAMPLER2DMSARRAY); usampler2DMSArray > +KEYWORD_WITH_ALT(150, 300, 150, 320, > +yyextra->ARB_texture_multisample_enable||yyextra- > >OES_texture_storage_m > +ultisample_2d_array_enable, USAMPLER2DMSARRAY); > > /* keywords available with ARB_texture_cube_map_array_enable > extension on desktop GLSL */ > samplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra- > >ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY); > diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp > index 6440a96..fe6129b 100644 > --- a/src/glsl/glsl_parser_extras.cpp > +++ b/src/glsl/glsl_parser_extras.cpp > @@ -626,6 +626,7 @@ static const _mesa_glsl_extension > _mesa_glsl_supported_extensions