Re: [Mesa-dev] [PATCH v2 02/31] i965/blorp: Expose the shader cache through function pointers
On Fri, Aug 26, 2016 at 06:58:27PM -0700, Jason Ekstrand wrote: > This sanitizes blorp's access to the i965 driver's shader cache by patching > it through the blorp_context. When we start using blorp in Vulkan, we will > simply have to implement such a caching interface in the Vulkan driver. > > Note: In my first attempt at this, I simplified it down to a single > upload_shader entrypoint and implemented the caching inside of blorp. This > doesn't work, however, because the i965 driver will, on occation, dump its > entire cache and start over. When this happens, blorp needs to be able to > recompile its shaders and re-upload them. It's easiest to just expose the > caching interface. Reviewed-by: Topi Pohjolainen> > Signed-off-by: Jason Ekstrand > Cc: Topi Pohjolainen > > --- > > This replaces patch 2 from the original series. > > src/mesa/drivers/dri/i965/blorp.h | 9 + > src/mesa/drivers/dri/i965/blorp_blit.c | 15 ++- > src/mesa/drivers/dri/i965/blorp_clear.c | 15 ++- > src/mesa/drivers/dri/i965/brw_blorp.c | 26 ++ > 4 files changed, 47 insertions(+), 18 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/blorp.h > b/src/mesa/drivers/dri/i965/blorp.h > index 7dbf022..602d97e 100644 > --- a/src/mesa/drivers/dri/i965/blorp.h > +++ b/src/mesa/drivers/dri/i965/blorp.h > @@ -41,6 +41,15 @@ struct blorp_context { > void *driver_ctx; > > const struct isl_device *isl_dev; > + > + bool (*lookup_shader)(struct blorp_context *blorp, > + const void *key, uint32_t key_size, > + uint32_t *kernel_out, void *prog_data_out); > + void (*upload_shader)(struct blorp_context *blorp, > + const void *key, uint32_t key_size, > + const void *kernel, uint32_t kernel_size, > + const void *prog_data, uint32_t prog_data_size, > + uint32_t *kernel_out, void *prog_data_out); > }; > > void blorp_init(struct blorp_context *blorp, void *driver_ctx, > diff --git a/src/mesa/drivers/dri/i965/blorp_blit.c > b/src/mesa/drivers/dri/i965/blorp_blit.c > index a4b3fe0..0291e01 100644 > --- a/src/mesa/drivers/dri/i965/blorp_blit.c > +++ b/src/mesa/drivers/dri/i965/blorp_blit.c > @@ -32,7 +32,6 @@ > > #include "blorp_priv.h" > #include "brw_context.h" > -#include "brw_state.h" > #include "brw_meta_util.h" > > #define FILE_DEBUG_FLAG DEBUG_BLORP > @@ -1196,9 +1195,8 @@ brw_blorp_get_blit_kernel(struct brw_context *brw, >struct brw_blorp_params *params, >const struct brw_blorp_blit_prog_key *prog_key) > { > - if (brw_search_cache(>cache, BRW_CACHE_BLORP_PROG, > -prog_key, sizeof(*prog_key), > ->wm_prog_kernel, >wm_prog_data)) > + if (brw->blorp.lookup_shader(>blorp, prog_key, sizeof(*prog_key), > +>wm_prog_kernel, > >wm_prog_data)) >return; > > const unsigned *program; > @@ -1219,11 +1217,10 @@ brw_blorp_get_blit_kernel(struct brw_context *brw, > program = brw_blorp_compile_nir_shader(brw, nir, _key, false, >_data, _size); > > - brw_upload_cache(>cache, BRW_CACHE_BLORP_PROG, > -prog_key, sizeof(*prog_key), > -program, program_size, > -_data, sizeof(prog_data), > ->wm_prog_kernel, >wm_prog_data); > + brw->blorp.upload_shader(>blorp, prog_key, sizeof(*prog_key), > +program, program_size, > +_data, sizeof(prog_data), > +>wm_prog_kernel, >wm_prog_data); > } > > static void > diff --git a/src/mesa/drivers/dri/i965/blorp_clear.c > b/src/mesa/drivers/dri/i965/blorp_clear.c > index 2da08f8..5b8ceec 100644 > --- a/src/mesa/drivers/dri/i965/blorp_clear.c > +++ b/src/mesa/drivers/dri/i965/blorp_clear.c > @@ -35,7 +35,6 @@ > #include "brw_meta_util.h" > #include "brw_context.h" > #include "brw_eu.h" > -#include "brw_state.h" > > #include "nir_builder.h" > > @@ -56,9 +55,8 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw, > memset(_key, 0, sizeof(blorp_key)); > blorp_key.use_simd16_replicated_data = use_replicated_data; > > - if (brw_search_cache(>cache, BRW_CACHE_BLORP_PROG, > -_key, sizeof(blorp_key), > ->wm_prog_kernel, >wm_prog_data)) > + if (brw->blorp.lookup_shader(>blorp, _key, sizeof(blorp_key), > +>wm_prog_kernel, > >wm_prog_data)) >return; > > void *mem_ctx = ralloc_context(NULL); > @@ -88,11 +86,10 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw, >brw_blorp_compile_nir_shader(brw, b.shader, _key, >
Re: [Mesa-dev] [PATCH 2/3] mesa: Handle OES_texture_view tokens
I dropped this patch and replaced with another one. Thanks Francesco 2016-08-28 22:38 GMT+02:00 Chris Forbes: > This patch isn't right. These enum values are the same as the desktop > version, so your new cases will never actually be used. > > On Mon, Aug 29, 2016 at 2:24 AM, Francesco Ansanelli > wrote: > >> Signed-off-by: Francesco Ansanelli >> --- >> src/mesa/main/texparam.c | 48 ++ >> >> 1 file changed, 48 insertions(+) >> >> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c >> index bdd3fcb..4dd97b1 100644 >> --- a/src/mesa/main/texparam.c >> +++ b/src/mesa/main/texparam.c >> @@ -1960,6 +1960,30 @@ get_tex_parameterfv(struct gl_context *ctx, >> *params = (GLfloat) obj->NumLayers; >> break; >> >> + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLfloat) obj->MinLevel; >> + break; >> + >> + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLfloat) obj->NumLevels; >> + break; >> + >> + case GL_TEXTURE_VIEW_MIN_LAYER_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLfloat) obj->MinLayer; >> + break; >> + >> + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLfloat) obj->NumLayers; >> + break; >> + >>case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: >> if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image >> _external) >> goto invalid_pname; >> @@ -2192,6 +2216,30 @@ get_tex_parameteriv(struct gl_context *ctx, >> *params = (GLint) obj->NumLayers; >> break; >> >> + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLint) obj->MinLevel; >> + break; >> + >> + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLint) obj->NumLevels; >> + break; >> + >> + case GL_TEXTURE_VIEW_MIN_LAYER_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLint) obj->MinLayer; >> + break; >> + >> + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: >> + if (!ctx->Extensions.OES_texture_view) >> +goto invalid_pname; >> + *params = (GLint) obj->NumLayers; >> + break; >> + >>case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: >> if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image >> _external) >> goto invalid_pname; >> -- >> 1.7.9.5 >> >> ___ >> 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] GL_OES_texture_view RFC
Thanks for your feedback. I've addressed your concerns in the version 2 of patches. Francesco 2016-08-28 16:42 GMT+02:00 Ilia Mirkin: > The most important part of this exercise is to get tests up and running. > Unfortunately there are none in dEQP. I think the simplest path would be to > get the existing ones to build as gles31 as well as GL. Check the blend > func extended tests to see how that is done. > > Overall feedback: > - are you sure the oes tokens are different than desktop? Normally they're > the same. > - imho it's not really important to have the oes suffix in messages. > > On Aug 28, 2016 10:31 AM, "Francesco Ansanelli" > wrote: > >> Hi list, >> >> I tried to figure how this extension could be hooked-up. >> >> I fear last patch is a bit an hack because we may want to add also the >> EXT one... But this could be figured later. >> >> In any case, please review. >> >> Cheers, >> Francesco >> >> ___ >> 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 02/13] nir: limit copy propagation inside loops
On Mon, Aug 29, 2016 at 12:54 AM, Timothy Arceriwrote: > Don't do copy propagation inside loops until after we try > unrolling them. > > This helps avoid propagating everything to the phis which > makes loop unrolling more difficult. > > For example without this: > >loop { > block block_1: > /* preds: block_0 block_4 */ > vec1 32 ssa_10 = phi block_0: ssa_5, block_4: ssa_15 > vec1 32 ssa_11 = phi block_0: ssa_6, block_4: ssa_17 > vec1 32 ssa_12 = phi block_0: ssa_7, block_4: ssa_18 > vec1 32 ssa_13 = phi block_0: ssa_8, block_4: ssa_19 > vec1 32 ssa_14 = phi block_0: ssa_9, block_4: ssa_20 > vec1 32 ssa_15 = iadd ssa_10, ssa_2 > vec1 32 ssa_16 = ige ssa_15, ssa_1 > /* succs: block_2 block_3 */ > if ssa_16 { > block block_2: > /* preds: block_1 */ > break > /* succs: block_5 */ > } else { > block block_3: > /* preds: block_1 */ > /* succs: block_4 */ > } > block block_4: > /* preds: block_3 */ > vec1 32 ssa_17 = imov ssa_12 > vec1 32 ssa_18 = imov ssa_13 > vec1 32 ssa_19 = imov ssa_14 > vec1 32 ssa_20 = imov ssa_11 > /* succs: block_1 */ >} > > Will end up as: > >loop { > /* preds: block_0 block_4 */ > block block_1: > vec1 32 ssa_10 = phi block_0: ssa_5, block_4: ssa_15 > vec1 32 ssa_11 = phi block_0: ssa_6, block_4: ssa_12 > vec1 32 ssa_12 = phi block_0: ssa_7, block_4: ssa_13 > vec1 32 ssa_13 = phi block_0: ssa_8, block_4: ssa_14 > vec1 32 ssa_14 = phi block_0: ssa_9, block_4: ssa_11 > vec1 32 ssa_15 = iadd ssa_10, ssa_2 > vec1 32 ssa_16 = ige ssa_15, ssa_1 > /* succs: block_2 block_3 */ > if ssa_16 { > block block_2: > /* preds: block_1 */ > break > /* succs: block_5 */ > } else { > block block_3: > /* preds: block_1 */ > /* succs: block_4 */ > } > block block_4: > /* preds: block_3 */ > /* succs: block_1 */ >} This change seems really fishy to me, since moves like those in your example are just a trivial renaming of values. Just turning off copy propagation isn't a very robust solution (what if whatever's producing the NIR doesn't insert the moves in the first place?), and it can hurt other optimization passes if they can't see through moves. Why is the second loop harder to unroll? Why can't it be handled by inserting moves before unrolling the loop, or directly during the loop unrolling pass? > --- > src/compiler/nir/nir.h| 2 +- > src/compiler/nir/nir_opt_copy_propagate.c | 47 > --- > src/mesa/drivers/dri/i965/brw_nir.c | 6 ++-- > 3 files changed, 35 insertions(+), 20 deletions(-) > > diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h > index d0dfb0d..7ff5394 100644 > --- a/src/compiler/nir/nir.h > +++ b/src/compiler/nir/nir.h > @@ -2573,7 +2573,7 @@ bool nir_opt_constant_folding(nir_shader *shader); > > bool nir_opt_global_to_local(nir_shader *shader); > > -bool nir_copy_prop(nir_shader *shader); > +bool nir_copy_prop(nir_shader *shader, bool prop_loops); > > bool nir_opt_cse(nir_shader *shader); > > diff --git a/src/compiler/nir/nir_opt_copy_propagate.c > b/src/compiler/nir/nir_opt_copy_propagate.c > index c26e07f..12daeb6 100644 > --- a/src/compiler/nir/nir_opt_copy_propagate.c > +++ b/src/compiler/nir/nir_opt_copy_propagate.c > @@ -99,11 +99,14 @@ is_swizzleless_move(nir_alu_instr *instr) > } > > static bool > -copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if) > +copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if, > + bool prop_loops) > { > if (!src->is_ssa) { > - if (src->reg.indirect) > - return copy_prop_src(src->reg.indirect, parent_instr, parent_if); > + if (src->reg.indirect) { > + return copy_prop_src(src->reg.indirect, parent_instr, parent_if, > + prop_loops); > + } >return false; > } > > @@ -125,6 +128,14 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, > nir_if *parent_if) >if (phi->dest.ssa.num_components != >alu_instr->src[0].src.ssa->num_components) > return false; > + > + /* Avoid propagating moves inside a loop into phis which makes > + * unrolling difficult. > + */ > + if (!prop_loops) { > + if (phi->instr.block->cf_node.parent->type == nir_cf_node_loop) > +return false; > + } > } > > if (parent_instr) { > @@ -140,13 +151,14 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, > nir_if *parent_if) > } > > static bool > -copy_prop_alu_src(nir_alu_instr *parent_alu_instr, unsigned index) > +copy_prop_alu_src(nir_alu_instr *parent_alu_instr, unsigned index, > + bool prop_loops) >
Re: [Mesa-dev] [PATCH 06/31] i965/blorp: Use gen6_upload_urb
On Fri, Aug 19, 2016 at 09:55:43AM -0700, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/genX_blorp_exec.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c > b/src/mesa/drivers/dri/i965/genX_blorp_exec.c > index a6ac7b0..402ae3f 100644 > --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c > +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c > @@ -200,9 +200,9 @@ static void > emit_urb_config(struct brw_context *brw, > const struct brw_blorp_params *params) > { > -#if GEN_GEN >= 7 > const unsigned vs_entry_size = gen7_blorp_get_vs_entry_size(params); About using logic marked as gen7 also for gen6 further down: The name of function is misleading, there is nothing gen7 specific in the way the entry size is calculated (earlier gens like to have the size as 64 byte chunks as well). It looks that you would need to do unnecessary rebasing just to change the name. Perhaps do it as a follow up? > > +#if GEN_GEN >= 7 > if (!(brw->ctx.NewDriverState & (BRW_NEW_CONTEXT | BRW_NEW_URB_SIZE)) && > brw->urb.vsize >= vs_entry_size) >return; > @@ -211,9 +211,7 @@ emit_urb_config(struct brw_context *brw, > > gen7_upload_urb(brw, vs_entry_size, false, false); > #else > - blorp_emit(brw, GENX(3DSTATE_URB), urb) { > - urb.VSNumberofURBEntries = brw->urb.max_vs_entries; > - } I wonder how correct this was before. Actual entry size (VSURBEntryAllocationSize) was left to zero. Now we start actually setting it. Reviewed-by: Topi Pohjolainen> + gen6_upload_urb(brw, vs_entry_size, false, 0); > #endif > } > > -- > 2.5.0.400.gff86faf > > ___ > 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
[Mesa-dev] [PATCH 1/3] glapi: add GL_OES_texture_view
Signed-off-by: Francesco Ansanelli--- src/mapi/glapi/gen/es_EXT.xml | 15 +++ src/mesa/main/extensions_table.h|1 + src/mesa/main/mtypes.h |1 + src/mesa/main/tests/dispatch_sanity.cpp |3 +++ 4 files changed, 20 insertions(+) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 6f2d643..f2570e5 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -1112,6 +1112,21 @@ + + + + + + + + + + + + + + + https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] mesa: implement GL_OES_texture_view (V2)
XXX still need to figure how to treat the removed VIEW_CLASS* and formats. V2: drop the oes suffix in messages (Ilia Mirkin) Signed-off-by: Francesco Ansanelli--- src/mesa/main/textureview.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c index ed66c17..36663cc 100644 --- a/src/mesa/main/textureview.c +++ b/src/mesa/main/textureview.c @@ -387,8 +387,10 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) switch (origTarget) { case GL_TEXTURE_1D: case GL_TEXTURE_1D_ARRAY: - RETURN_IF_SUPPORTED(TEXTURE_1D); - RETURN_IF_SUPPORTED(TEXTURE_1D_ARRAY); + if (!_mesa_is_gles3(ctx)) { + RETURN_IF_SUPPORTED(TEXTURE_1D); + RETURN_IF_SUPPORTED(TEXTURE_1D_ARRAY); + } break; case GL_TEXTURE_2D: RETURN_IF_SUPPORTED(TEXTURE_2D); @@ -398,7 +400,8 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) RETURN_IF_SUPPORTED(TEXTURE_3D); break; case GL_TEXTURE_RECTANGLE: - RETURN_IF_SUPPORTED(TEXTURE_RECTANGLE); + if (!_mesa_is_gles3(ctx)) + RETURN_IF_SUPPORTED(TEXTURE_RECTANGLE); break; case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_2D_ARRAY: @@ -514,7 +517,7 @@ _mesa_set_texture_view_state(struct gl_context *ctx, } /** - * glTextureView (ARB_texture_view) + * glTextureView (ARB_texture_view / OES_texture_view) * If an error is found, record it with _mesa_error() * \return none. */ -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] mesa: Add and use _mesa_has_texture_view helper(v2)
V2:use the same tokens of the desktop version (Ilia Mirkin, Chris Forbes) Signed-off-by: Francesco Ansanelli--- src/mesa/main/context.h |7 +++ src/mesa/main/texparam.c | 22 ++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 4cd149d..bdf4414 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -358,6 +358,13 @@ _mesa_has_texture_cube_map_array(const struct gl_context *ctx) _mesa_has_OES_texture_cube_map_array(ctx); } +static inline bool +_mesa_has_texture_view(const struct gl_context *ctx) +{ + return _mesa_has_OES_texture_view(ctx) || + (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view); +} + #ifdef __cplusplus } #endif diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index bdd3fcb..2c99804 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1929,33 +1929,32 @@ get_tex_parameterfv(struct gl_context *ctx, break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (_mesa_is_gles3(ctx) || - (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view)) + if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx)) *params = (GLfloat) obj->ImmutableLevels; else goto invalid_pname; break; case GL_TEXTURE_VIEW_MIN_LEVEL: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLfloat) obj->MinLevel; break; case GL_TEXTURE_VIEW_NUM_LEVELS: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLfloat) obj->NumLevels; break; case GL_TEXTURE_VIEW_MIN_LAYER: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLfloat) obj->MinLayer; break; case GL_TEXTURE_VIEW_NUM_LAYERS: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLfloat) obj->NumLayers; break; @@ -2161,33 +2160,32 @@ get_tex_parameteriv(struct gl_context *ctx, break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (_mesa_is_gles3(ctx) || - (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view)) + if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx)) *params = obj->ImmutableLevels; else goto invalid_pname; break; case GL_TEXTURE_VIEW_MIN_LEVEL: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLint) obj->MinLevel; break; case GL_TEXTURE_VIEW_NUM_LEVELS: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLint) obj->NumLevels; break; case GL_TEXTURE_VIEW_MIN_LAYER: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLint) obj->MinLayer; break; case GL_TEXTURE_VIEW_NUM_LAYERS: - if (!ctx->Extensions.ARB_texture_view) + if (!_mesa_has_texture_view(ctx)) goto invalid_pname; *params = (GLint) obj->NumLayers; break; -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/hsw: Enable ARB_ES3_1_compatibility extension
Reviewed-by: Samuel Iglesias GonsálvezOn 27/08/16 23:18, Jordan Justen wrote: > Signed-off-by: Jordan Justen > Acked-by: Kenneth Graunke > --- > docs/features.txt| 2 +- > src/mesa/drivers/dri/i965/intel_extensions.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/docs/features.txt b/docs/features.txt > index 26e8ff7..218fa6c 100644 > --- a/docs/features.txt > +++ b/docs/features.txt > @@ -208,7 +208,7 @@ GL 4.4, GLSL 4.40 -- all DONE: i965/gen8+ > > GL 4.5, GLSL 4.50: > > - GL_ARB_ES3_1_compatibilityDONE (i965/gen8+, > nvc0, radeonsi) > + GL_ARB_ES3_1_compatibilityDONE (i965/hsw+, > nvc0, radeonsi) >GL_ARB_clip_control DONE (i965, nv50, > nvc0, r600, radeonsi, llvmpipe, softpipe, swr) >GL_ARB_conditional_render_invertedDONE (i965, nv50, > nvc0, r600, radeonsi, llvmpipe, softpipe, swr) >GL_ARB_cull_distance DONE (i965, nv50, > nvc0, llvmpipe, softpipe, swr) > diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c > b/src/mesa/drivers/dri/i965/intel_extensions.c > index 48822b7..00b68eb 100644 > --- a/src/mesa/drivers/dri/i965/intel_extensions.c > +++ b/src/mesa/drivers/dri/i965/intel_extensions.c > @@ -365,7 +365,8 @@ intelInitExtensions(struct gl_context *ctx) > if ((brw->gen >= 8 || brw->intelScreen->cmd_parser_version >= 5) && > ctx->Const.MaxComputeWorkGroupSize[0] >= 1024) { > ctx->Extensions.ARB_compute_shader = true; > -ctx->Extensions.ARB_ES3_1_compatibility = brw->gen >= 8; > +ctx->Extensions.ARB_ES3_1_compatibility = > + brw->gen >= 8 || brw->is_haswell; > } > > if (brw->intelScreen->cmd_parser_version >= 2) > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] android: fix build issues with genxml, isl
Ya, things build for me too now. Thanks. Br, Kalyan On Sun, Aug 28, 2016 at 10:05 PM, Tapani Pälliwrote: > Nice work, now things build fine! > > Reviewed-by: Tapani Pälli > > On 08/28/2016 03:51 AM, Mauro Rossi wrote: >> >> Hi Emil, Jason, Tapani, >> >> this weekend I had planned to check mesa-dev with marshmallow-x86 and >> nougat-x86,builds, >> so here you can find the port to android of commit >> bebc1a1d995e33f173ea207848bcddd81f6dd19a >> >> Built successfully and tested on Sandybridge. >> Added also the same formatted patch as attachment in case gmail causes >> problems. >> >> Mauro >> >> From 4769f3e4b51fc804676d2b7b2ea320cfa5fffdde Mon Sep 17 00:00:00 2001 >> From: Mauro Rossi >> Date: Sat, 27 Aug 2016 17:19:34 +0200 >> Subject: [PATCH] android: intel: Flatten the makefile structure >> >> Android porting of commit bebc1a1 "intel: Flatten the makefile structure" >> >> Automake approach was followed, by moving makefiles a level up, >> naming them Android.genxml.mk and Android.isl.mk, >> performing the necessary adjustments to the paths, >> adding src/intel/Android.mk and fixing mesa top level makefile. >> --- >> Android.mk | 3 +- >> src/intel/Android.genxml.mk | 97 >> src/intel/Android.isl.mk| 216 >> +++ >> src/intel/Android.mk| 29 ++ >> src/intel/genxml/Android.mk | 97 >> src/intel/isl/Android.mk| 217 >> >> 6 files changed, 343 insertions(+), 316 deletions(-) >> create mode 100644 src/intel/Android.genxml.mk >> create mode 100644 src/intel/Android.isl.mk >> create mode 100644 src/intel/Android.mk >> delete mode 100644 src/intel/genxml/Android.mk >> delete mode 100644 src/intel/isl/Android.mk >> >> diff --git a/Android.mk b/Android.mk >> index f673029..4a63384 100644 >> --- a/Android.mk >> +++ b/Android.mk >> @@ -90,8 +90,7 @@ SUBDIRS := \ >> src/mesa \ >> src/util \ >> src/egl \ >> - src/intel/genxml \ >> - src/intel/isl \ >> + src/intel \ >> src/mesa/drivers/dri >> >> INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS)) >> diff --git a/src/intel/Android.genxml.mk b/src/intel/Android.genxml.mk >> new file mode 100644 >> index 000..79de784 >> --- /dev/null >> +++ b/src/intel/Android.genxml.mk >> @@ -0,0 +1,97 @@ >> +# Copyright © 2016 Intel Corporation >> +# Copyright © 2016 Mauro Rossi >> +# >> +# Permission is hereby granted, free of charge, to any person obtaining a >> +# copy of this software and associated documentation files (the >> "Software"), >> +# to deal in the Software without restriction, including without >> limitation >> +# the rights to use, copy, modify, merge, publish, distribute, >> sublicense, >> +# and/or sell copies of the Software, and to permit persons to whom the >> +# Software is furnished to do so, subject to the following conditions: >> +# >> +# The above copyright notice and this permission notice shall be included >> +# in all copies or substantial portions of the Software. >> +# >> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS >> OR >> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >> MERCHANTABILITY, >> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT >> SHALL >> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >> OTHER >> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING >> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >> +# DEALINGS IN THE SOFTWARE. >> +# >> + >> +# --- >> +# Build libmesa_genxml >> +# --- >> + >> +include $(CLEAR_VARS) >> + >> +LOCAL_MODULE := libmesa_genxml >> + >> +LOCAL_MODULE_CLASS := STATIC_LIBRARIES >> + >> +intermediates := $(call local-generated-sources-dir) >> + >> +# dummy.c source file is generated to meet the build system's rules. >> +LOCAL_GENERATED_SOURCES += $(intermediates)/dummy.c >> + >> +$(intermediates)/dummy.c: >> + @mkdir -p $(dir $@) >> + @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" >> + $(hide) touch $@ >> + >> +# This is the list of auto-generated files headers >> +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, >> $(GENXML_GENERATED_FILES)) >> + >> +define header-gen >> + @mkdir -p $(dir $@) >> + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" >> + $(hide) $(PRIVATE_SCRIPT) $(PRIVATE_XML) > $@ >> +endef >> + >> +$(intermediates)/genxml/gen4_pack.h: PRIVATE_SCRIPT := >> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py >> +$(intermediates)/genxml/gen4_pack.h: PRIVATE_XML := >> $(LOCAL_PATH)/genxml/gen4.xml >> +$(intermediates)/genxml/gen4_pack.h: $(LOCAL_PATH)/genxml/gen4.xml >> $(LOCAL_PATH)/genxml/gen_pack_header.py >> + $(call header-gen) >> + >> +$(intermediates)/genxml/gen45_pack.h:
Re: [Mesa-dev] [PATCH] android: fix build issues with genxml, isl
Nice work, now things build fine! Reviewed-by: Tapani PälliOn 08/28/2016 03:51 AM, Mauro Rossi wrote: Hi Emil, Jason, Tapani, this weekend I had planned to check mesa-dev with marshmallow-x86 and nougat-x86,builds, so here you can find the port to android of commit bebc1a1d995e33f173ea207848bcddd81f6dd19a Built successfully and tested on Sandybridge. Added also the same formatted patch as attachment in case gmail causes problems. Mauro From 4769f3e4b51fc804676d2b7b2ea320cfa5fffdde Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sat, 27 Aug 2016 17:19:34 +0200 Subject: [PATCH] android: intel: Flatten the makefile structure Android porting of commit bebc1a1 "intel: Flatten the makefile structure" Automake approach was followed, by moving makefiles a level up, naming them Android.genxml.mk and Android.isl.mk, performing the necessary adjustments to the paths, adding src/intel/Android.mk and fixing mesa top level makefile. --- Android.mk | 3 +- src/intel/Android.genxml.mk | 97 src/intel/Android.isl.mk| 216 +++ src/intel/Android.mk| 29 ++ src/intel/genxml/Android.mk | 97 src/intel/isl/Android.mk| 217 6 files changed, 343 insertions(+), 316 deletions(-) create mode 100644 src/intel/Android.genxml.mk create mode 100644 src/intel/Android.isl.mk create mode 100644 src/intel/Android.mk delete mode 100644 src/intel/genxml/Android.mk delete mode 100644 src/intel/isl/Android.mk diff --git a/Android.mk b/Android.mk index f673029..4a63384 100644 --- a/Android.mk +++ b/Android.mk @@ -90,8 +90,7 @@ SUBDIRS := \ src/mesa \ src/util \ src/egl \ - src/intel/genxml \ - src/intel/isl \ + src/intel \ src/mesa/drivers/dri INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/intel/Android.genxml.mk b/src/intel/Android.genxml.mk new file mode 100644 index 000..79de784 --- /dev/null +++ b/src/intel/Android.genxml.mk @@ -0,0 +1,97 @@ +# Copyright © 2016 Intel Corporation +# Copyright © 2016 Mauro Rossi +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +# --- +# Build libmesa_genxml +# --- + +include $(CLEAR_VARS) + +LOCAL_MODULE := libmesa_genxml + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +intermediates := $(call local-generated-sources-dir) + +# dummy.c source file is generated to meet the build system's rules. +LOCAL_GENERATED_SOURCES += $(intermediates)/dummy.c + +$(intermediates)/dummy.c: + @mkdir -p $(dir $@) + @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) touch $@ + +# This is the list of auto-generated files headers +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(GENXML_GENERATED_FILES)) + +define header-gen + @mkdir -p $(dir $@) + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) $(PRIVATE_SCRIPT) $(PRIVATE_XML) > $@ +endef + +$(intermediates)/genxml/gen4_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py +$(intermediates)/genxml/gen4_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen4.xml +$(intermediates)/genxml/gen4_pack.h: $(LOCAL_PATH)/genxml/gen4.xml $(LOCAL_PATH)/genxml/gen_pack_header.py + $(call header-gen) + +$(intermediates)/genxml/gen45_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py +$(intermediates)/genxml/gen45_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen45.xml +$(intermediates)/genxml/gen45_pack.h: $(LOCAL_PATH)/genxml/gen45.xml $(LOCAL_PATH)/genxml/gen_pack_header.py + $(call header-gen) + +$(intermediates)/genxml/gen5_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py +$(intermediates)/genxml/gen5_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen5.xml +$(intermediates)/genxml/gen5_pack.h:
Re: [Mesa-dev] [PATCH 03/13] nir: Add a loop analysis pass
This patch should be: From: Thomas HellandSeem to have lost the author during rebasing. Fixed locally. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 13/13] i965: use nir unrolling for scalar backend
--- src/compiler/glsl/glsl_parser_extras.cpp | 12 +++- src/compiler/nir/nir_metadata.c | 2 ++ src/mesa/drivers/dri/i965/brw_compiler.c | 6 +- src/mesa/drivers/dri/i965/brw_nir.c | 4 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 80f37f3..43272fd 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -2053,12 +2053,14 @@ do_common_optimization(exec_list *ir, bool linked, OPT(optimize_split_arrays, ir, linked); OPT(optimize_redundant_jumps, ir); - loop_state *ls = analyze_loop_variables(ir); - if (ls->loop_found) { - OPT(set_loop_controls, ir, ls); - OPT(unroll_loops, ir, ls, options); + if (options->MaxUnrollIterations != 0) { + loop_state *ls = analyze_loop_variables(ir); + if (ls->loop_found) { + OPT(set_loop_controls, ir, ls); + OPT(unroll_loops, ir, ls, options); + } + delete ls; } - delete ls; #undef OPT diff --git a/src/compiler/nir/nir_metadata.c b/src/compiler/nir/nir_metadata.c index 9e1cff5..b163377 100644 --- a/src/compiler/nir/nir_metadata.c +++ b/src/compiler/nir/nir_metadata.c @@ -41,6 +41,8 @@ nir_metadata_require(nir_function_impl *impl, nir_metadata required) nir_calc_dominance_impl(impl); if (NEEDS_UPDATE(nir_metadata_live_ssa_defs)) nir_live_ssa_defs_impl(impl); + if (NEEDS_UPDATE(nir_metadata_loop_analysis)) + nir_loop_analyze_impl(impl); #undef NEEDS_UPDATE diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c b/src/mesa/drivers/dri/i965/brw_compiler.c index afb70a1..df570bf 100644 --- a/src/mesa/drivers/dri/i965/brw_compiler.c +++ b/src/mesa/drivers/dri/i965/brw_compiler.c @@ -55,6 +55,7 @@ static const struct nir_shader_compiler_options scalar_nir_options = { .lower_unpack_snorm_4x8 = true, .lower_unpack_unorm_2x16 = true, .lower_unpack_unorm_4x8 = true, + .max_unroll_iterations = 32, }; static const struct nir_shader_compiler_options vector_nir_options = { @@ -75,6 +76,7 @@ static const struct nir_shader_compiler_options vector_nir_options = { .lower_unpack_unorm_2x16 = true, .lower_extract_byte = true, .lower_extract_word = true, + .max_unroll_iterations = 0, }; static const struct nir_shader_compiler_options vector_nir_options_gen6 = { @@ -92,6 +94,7 @@ static const struct nir_shader_compiler_options vector_nir_options_gen6 = { .lower_unpack_unorm_2x16 = true, .lower_extract_byte = true, .lower_extract_word = true, + .max_unroll_iterations = 0, }; struct brw_compiler * @@ -119,7 +122,6 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo) /* We want the GLSL compiler to emit code that uses condition codes */ for (int i = 0; i < MESA_SHADER_STAGES; i++) { - compiler->glsl_compiler_options[i].MaxUnrollIterations = 32; compiler->glsl_compiler_options[i].MaxIfDepth = devinfo->gen < 6 ? 16 : UINT_MAX; @@ -140,8 +142,10 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo) compiler->glsl_compiler_options[i].EmitNoIndirectSampler = true; if (is_scalar) { + compiler->glsl_compiler_options[i].MaxUnrollIterations = 0; compiler->glsl_compiler_options[i].NirOptions = _nir_options; } else { + compiler->glsl_compiler_options[i].MaxUnrollIterations = 32; compiler->glsl_compiler_options[i].NirOptions = devinfo->gen < 6 ? _nir_options : _nir_options_gen6; } diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index b8457d2..3cf1046 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -391,6 +391,10 @@ nir_optimize(nir_shader *nir, bool is_scalar) OPT(nir_opt_algebraic); OPT(nir_opt_constant_folding); OPT(nir_opt_dead_cf); + if (nir->options->max_unroll_iterations != 0) { + OPT_V(nir_to_lcssa); + OPT(nir_opt_loop_unroll); + } OPT(nir_opt_remove_phis); OPT(nir_opt_undef); OPT_V(nir_lower_doubles, nir_lower_drcp | -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 10/13] nir: add helper for cloning loops
--- src/compiler/nir/nir.h | 3 +++ src/compiler/nir/nir_clone.c | 64 +++- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 0ab3ebc..9083bd0 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2372,6 +2372,9 @@ void nir_print_instr(const nir_instr *instr, FILE *fp); nir_shader *nir_shader_clone(void *mem_ctx, const nir_shader *s); nir_function_impl *nir_function_impl_clone(const nir_function_impl *fi); +void nir_clone_loop_list(struct exec_list *dst, const struct exec_list *list, + struct hash_table *remap_table, + struct hash_table *phi_remap, nir_shader *ns); nir_constant *nir_constant_clone(const nir_constant *c, nir_variable *var); nir_variable *nir_variable_clone(const nir_variable *c, nir_shader *shader); diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index 8808333..071afc9 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -35,9 +35,17 @@ typedef struct { /* True if we are cloning an entire shader. */ bool global_clone; + /* This allows us to clone a loop body without having to add srcs from +* outside the loop to the remap table. This is useful for loop unrolling. +*/ + bool allow_remap_fallback; + /* maps orig ptr -> cloned ptr: */ struct hash_table *remap_table; + /* used for remaping when cloning loop body for loop unrolling */ + struct hash_table *phi_remap_table; + /* List of phi sources. */ struct list_head phi_srcs; @@ -46,11 +54,20 @@ typedef struct { } clone_state; static void -init_clone_state(clone_state *state, bool global) +init_clone_state(clone_state *state, struct hash_table *remap_table, + bool global, bool allow_remap_fallback) { state->global_clone = global; - state->remap_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer, -_mesa_key_pointer_equal); + state->allow_remap_fallback = allow_remap_fallback; + + state->phi_remap_table = NULL; + if (remap_table) { + state->remap_table = remap_table; + } else { + state->remap_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer, + _mesa_key_pointer_equal); + } + list_inithead(>phi_srcs); } @@ -72,16 +89,32 @@ _lookup_ptr(clone_state *state, const void *ptr, bool global) return (void *)ptr; entry = _mesa_hash_table_search(state->remap_table, ptr); - assert(entry && "Failed to find pointer!"); if (!entry) - return NULL; + return state->allow_remap_fallback ? (void *)ptr : NULL; return entry->data; } +/** + * Updates a phi remap table used for unrolling loops. + */ +static void +update_phi_remap_table(clone_state *state, const void *ptr, void *nptr) +{ + if (state->phi_remap_table == NULL) + return; + + struct hash_entry *hte; + hash_table_foreach(state->phi_remap_table, hte) { + if (hte->data == ptr) + hte->data = nptr; + } +} + static void add_remap(clone_state *state, void *nptr, const void *ptr) { + update_phi_remap_table(state, ptr, nptr); _mesa_hash_table_insert(state->remap_table, ptr, nptr); } @@ -613,6 +646,23 @@ fixup_phi_srcs(clone_state *state) assert(list_empty(>phi_srcs)); } +void +nir_clone_loop_list(struct exec_list *dst, const struct exec_list *list, +struct hash_table *remap_table, +struct hash_table *phi_remap, nir_shader *ns) +{ + clone_state state; + init_clone_state(, remap_table, false, true); + + /* We use the same shader */ + state.ns = ns; + state.phi_remap_table = phi_remap; + + clone_cf_list(, dst, list); + + fixup_phi_srcs(); +} + static nir_function_impl * clone_function_impl(clone_state *state, const nir_function_impl *fi) { @@ -646,7 +696,7 @@ nir_function_impl * nir_function_impl_clone(const nir_function_impl *fi) { clone_state state; - init_clone_state(, false); + init_clone_state(, NULL, false, false); /* We use the same shader */ state.ns = fi->function->shader; @@ -686,7 +736,7 @@ nir_shader * nir_shader_clone(void *mem_ctx, const nir_shader *s) { clone_state state; - init_clone_state(, true); + init_clone_state(, NULL, true, false); nir_shader *ns = nir_shader_create(mem_ctx, s->stage, s->options); state.ns = ns; -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 12/13] nir: add a loop unrolling pass
--- src/compiler/Makefile.sources | 1 + src/compiler/nir/nir.h | 2 + src/compiler/nir/nir_opt_loop_unroll.c | 394 + 3 files changed, 397 insertions(+) create mode 100644 src/compiler/nir/nir_opt_loop_unroll.c diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources index 79de484..a9f104d 100644 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@ -231,6 +231,7 @@ NIR_FILES = \ nir/nir_opt_dead_cf.c \ nir/nir_opt_gcm.c \ nir/nir_opt_global_to_local.c \ + nir/nir_opt_loop_unroll.c \ nir/nir_opt_peephole_select.c \ nir/nir_opt_remove_phis.c \ nir/nir_opt_undef.c \ diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 9083bd0..81d9dfc 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2676,6 +2676,8 @@ bool nir_opt_dead_cf(nir_shader *shader); void nir_opt_gcm(nir_shader *shader); +bool nir_opt_loop_unroll(nir_shader *shader); + bool nir_opt_peephole_select(nir_shader *shader); bool nir_opt_remove_phis(nir_shader *shader); diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c new file mode 100644 index 000..22530c9 --- /dev/null +++ b/src/compiler/nir/nir_opt_loop_unroll.c @@ -0,0 +1,394 @@ +/* + * Copyright © 2016 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "nir.h" +#include "nir_builder.h" +#include "nir_control_flow.h" + +typedef struct { + /* Array of loops */ + nir_loop *loops; + + /* Array of unroll factors */ + int *factors; +} unroll_vector; + +typedef struct { + /* Array of loop infos for the loop nest */ + nir_loop_info *li; + + /* List of unroll vectors */ + struct list_head unroll_vectors; + + nir_shader_compiler_options *options; +} loop_unroll_state; + +static void +extract_loop_body(nir_cf_list *extracted, nir_cf_node *node, nir_shader *ns) +{ + nir_cf_node *end = node; + while (!nir_cf_node_is_last(end)) + end = nir_cf_node_next(end); + + nir_cf_loop_list_extract(extracted, node, end); +} + +static void +clone_list(nir_shader *ns, nir_loop *loop, nir_cf_list *src_cf_list, + nir_cf_list *cloned_cf_list, struct hash_table *remap_table, + struct hash_table *phi_remap) +{ + /* Dest list needs to at least have one block */ + nir_block *nblk = nir_block_create(ns); + nblk->cf_node.parent = loop->cf_node.parent; + exec_list_push_tail(_cf_list->list, >cf_node.node); + + nir_clone_loop_list(_cf_list->list, _cf_list->list, + remap_table, phi_remap, ns); +} + +static void +remove_unrolled_loop(nir_cf_node *loop, nir_block *block_before_loop, + struct hash_table *remap_table, + struct hash_table *phi_remap, + nir_function_impl *impl) +{ + /* Fixup LCSSA-phi srcs */ + nir_block *prev_block = nir_cf_node_as_block(nir_cf_node_prev(loop)); + nir_cf_node *cf_node = nir_cf_node_next(loop); + assert(cf_node->type == nir_cf_node_block); + + nir_block *block = nir_cf_node_as_block(cf_node); + nir_foreach_instr_safe(instr, block) { + if (instr->type == nir_instr_type_phi) { + nir_phi_instr *phi = nir_instr_as_phi(instr); + assert(phi->is_lcssa_phi); + + if (nir_cf_node_as_loop(loop)->info->trip_count != 0) { +nir_foreach_phi_src_safe(src, phi) { + /* Update predecessor */ + src->pred = prev_block; + + /* Update src */ + struct hash_entry *hte = + _mesa_hash_table_search(phi_remap, src->src.ssa); + if (hte) { + nir_src new_src = nir_src_for_ssa((nir_ssa_def *) hte->data); + nir_instr_rewrite_src(instr, >src, new_src); + } else { + /* If
[Mesa-dev] [PATCH 09/13] nir: create helper for fixing phi srcs when cloning
This will be useful for fixing phi srcs when cloning a loop body during loop unrolling. --- src/compiler/nir/nir_clone.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index 0e397b0..8808333 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -593,6 +593,26 @@ clone_cf_list(clone_state *state, struct exec_list *dst, } } +/* After we've cloned almost everything, we have to walk the list of phi + * sources and fix them up. Thanks to loops, the block and SSA value for a + * phi source may not be defined when we first encounter it. Instead, we + * add it to the phi_srcs list and we fix it up here. + */ +static void +fixup_phi_srcs(clone_state *state) +{ + list_for_each_entry_safe(nir_phi_src, src, >phi_srcs, src.use_link) { + src->pred = remap_local(state, src->pred); + assert(src->src.is_ssa); + src->src.ssa = remap_local(state, src->src.ssa); + + /* Remove from this list and place in the uses of the SSA def */ + list_del(>src.use_link); + list_addtail(>src.use_link, >src.ssa->uses); + } + assert(list_empty(>phi_srcs)); +} + static nir_function_impl * clone_function_impl(clone_state *state, const nir_function_impl *fi) { @@ -614,21 +634,7 @@ clone_function_impl(clone_state *state, const nir_function_impl *fi) clone_cf_list(state, >body, >body); - /* After we've cloned almost everything, we have to walk the list of phi -* sources and fix them up. Thanks to loops, the block and SSA value for a -* phi source may not be defined when we first encounter it. Instead, we -* add it to the phi_srcs list and we fix it up here. -*/ - list_for_each_entry_safe(nir_phi_src, src, >phi_srcs, src.use_link) { - src->pred = remap_local(state, src->pred); - assert(src->src.is_ssa); - src->src.ssa = remap_local(state, src->src.ssa); - - /* Remove from this list and place in the uses of the SSA def */ - list_del(>src.use_link); - list_addtail(>src.use_link, >src.ssa->uses); - } - assert(list_empty(>phi_srcs)); + fixup_phi_srcs(state); /* All metadata is invalidated in the cloning process */ nfi->valid_metadata = 0; -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 04/13] nir: add is_simple_for_loop() helper
This will be used by the loop unroll and lcssa passes. Reviewed-by: Thomas Helland--- src/compiler/nir/nir.h | 8 1 file changed, 8 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 491859e..0ddd4e2 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2627,6 +2627,14 @@ bool nir_normalize_cubemap_coords(nir_shader *shader); void nir_live_ssa_defs_impl(nir_function_impl *impl); +static inline bool +is_simple_for_loop(nir_shader *shader, nir_loop_info *li) +{ + unsigned max_iter = shader->options->max_unroll_iterations; + return li->is_trip_count_known && li->trip_count < max_iter && + list_is_singular(>loop_terminator_list); +} + void nir_loop_analyze_impl(nir_function_impl *impl); void nir_loop_analyze(nir_shader *shader); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 11/13] nir: make cleanup_cf_node() accessable externally
We also allow unlinking of jumps to be skipped, this will be useful for removing loops once they have been unrolled. --- src/compiler/nir/nir_control_flow.c | 23 ++- src/compiler/nir/nir_control_flow.h | 4 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index ed8cd24..0429abd 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -698,8 +698,9 @@ replace_ssa_def_uses(nir_ssa_def *def, void *void_impl) return true; } -static void -cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) +void +nir_cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl, +bool unlink_jumps) { switch (node->type) { case nir_cf_node_block: { @@ -707,8 +708,12 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) /* We need to walk the instructions and clean up defs/uses */ nir_foreach_instr_safe(instr, block) { if (instr->type == nir_instr_type_jump) { -nir_jump_type jump_type = nir_instr_as_jump(instr)->type; -unlink_jump(block, jump_type, false); +if (unlink_jumps) { + nir_jump_type jump_type = nir_instr_as_jump(instr)->type; + unlink_jump(block, jump_type, false); +} else { + exec_node_remove(>node); +} } else { nir_foreach_ssa_def(instr, replace_ssa_def_uses, impl); nir_instr_remove(instr); @@ -720,9 +725,9 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) case nir_cf_node_if: { nir_if *if_stmt = nir_cf_node_as_if(node); foreach_list_typed(nir_cf_node, child, node, _stmt->then_list) - cleanup_cf_node(child, impl); + nir_cleanup_cf_node(child, impl, unlink_jumps); foreach_list_typed(nir_cf_node, child, node, _stmt->else_list) - cleanup_cf_node(child, impl); + nir_cleanup_cf_node(child, impl, unlink_jumps); list_del(_stmt->condition.use_link); break; @@ -731,13 +736,13 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) case nir_cf_node_loop: { nir_loop *loop = nir_cf_node_as_loop(node); foreach_list_typed(nir_cf_node, child, node, >body) - cleanup_cf_node(child, impl); + nir_cleanup_cf_node(child, impl, unlink_jumps); break; } case nir_cf_node_function: { nir_function_impl *impl = nir_cf_node_as_function(node); foreach_list_typed(nir_cf_node, child, node, >body) - cleanup_cf_node(child, impl); + nir_cleanup_cf_node(child, impl, unlink_jumps); break; } default: @@ -847,6 +852,6 @@ void nir_cf_delete(nir_cf_list *cf_list) { foreach_list_typed(nir_cf_node, node, node, _list->list) { - cleanup_cf_node(node, cf_list->impl); + nir_cleanup_cf_node(node, cf_list->impl, true); } } diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h index 0d97486..a7d0b81 100644 --- a/src/compiler/nir/nir_control_flow.h +++ b/src/compiler/nir/nir_control_flow.h @@ -138,6 +138,10 @@ typedef struct { nir_function_impl *impl; /* for cleaning up if the list is deleted */ } nir_cf_list; +void +nir_cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl, +bool unlink_jumps); + void nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end); void nir_cf_reinsert(nir_cf_list *cf_list, nir_cursor cursor); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 07/13] nir: create nir_opt_remove_phi() helper
This will be useful for cleaning up phis when unrolling loops. --- src/compiler/nir/nir.h | 1 + src/compiler/nir/nir_opt_remove_phis.c | 94 +++--- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 60aeb8f..0ab3ebc 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2676,6 +2676,7 @@ void nir_opt_gcm(nir_shader *shader); bool nir_opt_peephole_select(nir_shader *shader); bool nir_opt_remove_phis(nir_shader *shader); +bool nir_opt_remove_phi(nir_phi_instr *phi); bool nir_opt_undef(nir_shader *shader); diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c index 6d9e0ff..7dea9c7 100644 --- a/src/compiler/nir/nir_opt_remove_phis.c +++ b/src/compiler/nir/nir_opt_remove_phis.c @@ -47,6 +47,57 @@ matching_mov(nir_alu_instr *mov1, nir_ssa_def *ssa) return mov2 && nir_alu_srcs_equal(mov1, mov2, 0, 0); } +bool +nir_opt_remove_phi(nir_phi_instr *phi) +{ + nir_ssa_def *def = NULL; + nir_alu_instr *mov = NULL; + bool srcs_same = true; + + nir_foreach_phi_src(src, phi) { + assert(src->src.is_ssa); + + /* For phi nodes at the beginning of loops, we may encounter some + * sources from backedges that point back to the destination of the + * same phi, i.e. something like: + * + * a = phi(a, b, ...) + * + * We can safely ignore these sources, since if all of the normal + * sources point to the same definition, then that definition must + * still dominate the phi node, and the phi will still always take + * the value of that definition. + */ + if (src->src.ssa == >dest.ssa) + continue; + + if (def == NULL) { + def = src->src.ssa; + mov = get_parent_mov(def); + } else { + if (src->src.ssa != def && !matching_mov(mov, src->src.ssa)) { +srcs_same = false; +break; + } + } + } + + if (!srcs_same) + return false; + + /* We must have found at least one definition, since there must be at +* least one forward edge. +*/ +assert(def != NULL); + + + assert(phi->dest.is_ssa); + nir_ssa_def_rewrite_uses(>dest.ssa, nir_src_for_ssa(def)); + nir_instr_remove(>instr); + + return true; +} + /* * This is a pass for removing phi nodes that look like: * a = phi(b, b, b, ...) @@ -74,50 +125,9 @@ remove_phis_block(nir_block *block) nir_phi_instr *phi = nir_instr_as_phi(instr); bool is_lcssa_phi = phi->is_lcssa_phi; - nir_ssa_def *def = NULL; - nir_alu_instr *mov = NULL; - bool srcs_same = true; - - nir_foreach_phi_src(src, phi) { - assert(src->src.is_ssa); - - /* For phi nodes at the beginning of loops, we may encounter some - * sources from backedges that point back to the destination of the - * same phi, i.e. something like: - * - * a = phi(a, b, ...) - * - * We can safely ignore these sources, since if all of the normal - * sources point to the same definition, then that definition must - * still dominate the phi node, and the phi will still always take - * the value of that definition. - */ - if (src->src.ssa == >dest.ssa) -continue; - - if (def == NULL) { -def = src->src.ssa; -mov = get_parent_mov(def); - } else { -if (src->src.ssa != def && !matching_mov(mov, src->src.ssa)) { - srcs_same = false; - break; -} - } - } - - if (!srcs_same) + if (!nir_opt_remove_phi(phi)) continue; - /* We must have found at least one definition, since there must be at - * least one forward edge. - */ - assert(def != NULL); - - assert(phi->dest.is_ssa); - nir_ssa_def_rewrite_uses(>dest.ssa, nir_src_for_ssa(def)); - nir_instr_remove(instr); - if (!is_lcssa_phi) progress = true; } -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/13] nir: add control flow helpers for loop unrolling
This makes stitch_blocks() available for use else where, and adds a new helper that extracts a cf list without worrying about validation. --- src/compiler/nir/nir_control_flow.c | 34 -- src/compiler/nir/nir_control_flow.h | 5 + 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index a485e71..ed8cd24 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -628,8 +628,7 @@ update_if_uses(nir_cf_node *node) * Stitch two basic blocks together into one. The aggregate must have the same * predecessors as the first and the same successors as the second. */ - -static void +void stitch_blocks(nir_block *before, nir_block *after) { /* @@ -791,6 +790,37 @@ nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end) stitch_blocks(block_before, block_after); } +/** + * Its not really possible to extract control flow from a loop while keeping + * the cf valid so this function just rips out what we ask for and any + * validation and fix ups are left to the caller. + */ +void +nir_cf_loop_list_extract(nir_cf_list *extracted, nir_cf_node *begin, + nir_cf_node *end) +{ + extracted->impl = nir_cf_node_get_function(begin); + exec_list_make_empty(>list); + + /* Dominance and other block-related information is toast. */ + nir_metadata_preserve(extracted->impl, nir_metadata_none); + + nir_cf_node *cf_node = begin; + nir_cf_node *cf_node_end = end; + while (true) { + nir_cf_node *next = nir_cf_node_next(cf_node); + + exec_node_remove(_node->node); + cf_node->parent = NULL; + exec_list_push_tail(>list, _node->node); + + if (cf_node == cf_node_end) + break; + + cf_node = next; + } +} + void nir_cf_reinsert(nir_cf_list *cf_list, nir_cursor cursor) { diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h index b71382f..0d97486 100644 --- a/src/compiler/nir/nir_control_flow.h +++ b/src/compiler/nir/nir_control_flow.h @@ -78,6 +78,9 @@ nir_cf_node_insert_end(struct exec_list *list, nir_cf_node *node) nir_cf_node_insert(nir_after_cf_list(list), node); } +void +stitch_blocks(nir_block *before, nir_block *after); + /** Control flow motion. * @@ -148,6 +151,8 @@ nir_cf_list_extract(nir_cf_list *extracted, struct exec_list *cf_list) nir_after_cf_list(cf_list)); } +void nir_cf_loop_list_extract(nir_cf_list *extracted, nir_cf_node *begin, nir_cf_node *end); + /** removes a control flow node, doing any cleanup necessary */ static inline void nir_cf_node_remove(nir_cf_node *node) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 05/13] nir: Add a LCSAA-pass
From: Thomas HellandV2: Do a "depth first search" to convert to LCSSA V3: Small comment fixup V4: Rebase, adapt to removal of function overloads V5: Rebase, adapt to relocation of nir to compiler/nir Still need to adapt to potential if-uses Work around nir_validate issue V6 (Timothy): - tidy lcssa and stop leaking memory - dont rewrite the src for the lcssa phi node - validate lcssa phi srcs to avoid postvalidate assert - don't add new phi if one already exists - more lcssa phi validation fixes - Rather than marking ssa defs inside a loop just mark blocks inside a loop. This is simpler and fixes lcssa for intrinsics which do not have a destination. - don't create LCSSA phis for loops we won't unroll - require loop metadata for lcssa pass --- src/compiler/Makefile.sources | 1 + src/compiler/nir/nir.h | 5 + src/compiler/nir/nir_to_lcssa.c | 214 src/compiler/nir/nir_validate.c | 11 ++- 4 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 src/compiler/nir/nir_to_lcssa.c diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources index 686e8a6..79de484 100644 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@ -245,6 +245,7 @@ NIR_FILES = \ nir/nir_search_helpers.h \ nir/nir_split_var_copies.c \ nir/nir_sweep.c \ + nir/nir_to_lcssa.c \ nir/nir_to_ssa.c \ nir/nir_validate.c \ nir/nir_vla.h \ diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 0ddd4e2..60aeb8f 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1384,6 +1384,8 @@ typedef struct { struct exec_list srcs; /** < list of nir_phi_src */ nir_dest dest; + + bool is_lcssa_phi; } nir_phi_instr; typedef struct { @@ -2646,6 +2648,9 @@ void nir_convert_to_ssa(nir_shader *shader); bool nir_repair_ssa_impl(nir_function_impl *impl); bool nir_repair_ssa(nir_shader *shader); +void nir_to_lcssa_impl(nir_function_impl *impl); +void nir_to_lcssa(nir_shader *shader); + /* If phi_webs_only is true, only convert SSA values involved in phi nodes to * registers. If false, convert all values (even those not involved in a phi * node) to registers. diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c new file mode 100644 index 000..8eee8ff --- /dev/null +++ b/src/compiler/nir/nir_to_lcssa.c @@ -0,0 +1,214 @@ +/* + * Copyright © 2015 Thomas Helland + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* + * This pass converts the ssa-graph into "Loop Closed SSA form". This is + * done by placing phi nodes at the exits of the loop for all values + * that are used outside the loop. The result is it transforms: + * + * loop {-> loop { + *ssa2 = -> ssa2 = ... + *if (cond) -> if (cond) { + * break; -> break; + *ssa3 = ssa2 * ssa4 -> } + * } -> ssa3 = ssa2 * ssa4 + * ssa6 = ssa2 + 4 -> } + *ssa5 = lcssa_phi(ssa2) + *ssa6 = ssa5 + 4 + */ + +#include "nir.h" + +typedef struct { + /* The nir_shader we are transforming */ + nir_shader *shader; + + /* The loop we store information for */ + nir_loop *loop; + + /* Keep track of which defs are in the loop */ + BITSET_WORD *is_in_loop; + + /* General purpose bool */ + bool flag; +} lcssa_state; + +static void +mark_block_as_in_loop(nir_block *blk, void *state) +{ + lcssa_state *state_cast = (lcssa_state *) state; + BITSET_SET(state_cast->is_in_loop, blk->index); +} + +static void +is_block_outside_loop(nir_block *blk, void *void_state) +{ + lcssa_state *state = void_state; + if
[Mesa-dev] [PATCH 06/13] nir: don't count removal of lcssa_phi as progress
--- src/compiler/nir/nir_opt_remove_phis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c index ee92fbe..6d9e0ff 100644 --- a/src/compiler/nir/nir_opt_remove_phis.c +++ b/src/compiler/nir/nir_opt_remove_phis.c @@ -72,6 +72,7 @@ remove_phis_block(nir_block *block) break; nir_phi_instr *phi = nir_instr_as_phi(instr); + bool is_lcssa_phi = phi->is_lcssa_phi; nir_ssa_def *def = NULL; nir_alu_instr *mov = NULL; @@ -117,7 +118,8 @@ remove_phis_block(nir_block *block) nir_ssa_def_rewrite_uses(>dest.ssa, nir_src_for_ssa(def)); nir_instr_remove(instr); - progress = true; + if (!is_lcssa_phi) + progress = true; } return progress; -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/13] nir: Add a loop analysis pass
This pass detects induction variables and calculates the trip count of loops to be used for loop unrolling. I've removed support for float induction values for now, for the simple reason that they don't appear in my shader-db collection, and so I don't see it as common enough that we want to pollute the pass with this in the initial version. V2: Rebase, adapt to removal of function overloads V3: (Timothy Arceri) - don't try to find trip count if loop terminator conditional is a phi - fix trip count for do-while loops - replace conditional type != alu assert with return - disable unrolling of loops with continues - multiple fixes to memory allocation, stop leaking and don't destroy structs we want to use for unrolling. - find induction var when copy propagation disabled - fix iteration count bugs when induction var not on RHS of condition - add FIXME for && conditions - calculate trip count for unsigned induction/limit vars --- src/compiler/Makefile.sources | 2 + src/compiler/nir/nir.h | 77 +++ src/compiler/nir/nir_loop_analyze.c | 924 3 files changed, 1003 insertions(+) create mode 100644 src/compiler/nir/nir_loop_analyze.c diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources index edd683a..686e8a6 100644 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@ -188,6 +188,8 @@ NIR_FILES = \ nir/nir_intrinsics.c \ nir/nir_intrinsics.h \ nir/nir_liveness.c \ + nir/nir_loop_analyze.c \ + nir/nir_loop_analyze.h \ nir/nir_lower_alu_to_scalar.c \ nir/nir_lower_atomics.c \ nir/nir_lower_bitmap.c \ diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 7ff5394..491859e 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1548,10 +1548,80 @@ nir_if_last_else_node(nir_if *if_stmt) return exec_node_data(nir_cf_node, tail, node); } +typedef enum { + undefined, + invariant, + basic_induction +} nir_loop_variable_type; + +typedef struct { + /* The ssa_def associated with this info */ + nir_ssa_def *def; + + /* The type of this ssa_def */ + nir_loop_variable_type type; + + /* Link to the loop_variable list for the loop */ + struct list_head loop_vars_link; + + /* A link for a list of invariant variables */ + struct list_head invariant_link; + + /* A link for a list of induction variables */ + struct list_head induction_link; + + /* If the ssa-def is constant */ + bool is_constant; + + bool in_conditional_block; + + bool in_nested_loop; +} nir_loop_variable; + +typedef struct { + nir_op alu_op;/* The type of alu-operation */ + nir_loop_variable *alu_def; /* The def of the alu-operation */ + nir_loop_variable *invariant; /* The invariant alu-operand */ + nir_loop_variable *phi; /* The other alu-operand */ + nir_loop_variable *def_outside_loop; /* The phi-src outside the loop */ +} nir_basic_induction_var; + +typedef struct { + nir_if *nif; + + nir_instr *conditional_instr; + + struct list_head loop_terminator_link; +} nir_loop_terminator; + +typedef struct { + /* Loop_variable for all ssa_defs in loop */ + struct list_head loop_vars_list; + + /* How many times the loop is run (if known) */ + uint32_t trip_count; + bool is_trip_count_known; + + nir_loop_terminator *limiting_terminator; + + /* A list of loop_terminators terminating this loop. +* XXX: These (apart from the limiting terminator) can be dead-code +* eliminated. +*/ + struct list_head loop_terminator_list; + + /* The ssa_defs that are invariant */ + struct list_head invariant_list; + + struct hash_table *var_to_basic_ind; +} nir_loop_info; + typedef struct { nir_cf_node cf_node; struct exec_list body; /** < list of nir_cf_node */ + + nir_loop_info *info; } nir_loop; static inline nir_cf_node * @@ -1576,6 +1646,7 @@ typedef enum { nir_metadata_dominance = 0x2, nir_metadata_live_ssa_defs = 0x4, nir_metadata_not_properly_reset = 0x8, + nir_metadata_loop_analysis = 0x16, } nir_metadata; typedef struct { @@ -1758,6 +1829,8 @@ typedef struct nir_shader_compiler_options { * information must be inferred from the list of input nir_variables. */ bool use_interpolated_input_intrinsics; + + unsigned max_unroll_iterations; } nir_shader_compiler_options; typedef struct nir_shader_info { @@ -2553,6 +2626,10 @@ void nir_lower_double_pack(nir_shader *shader); bool nir_normalize_cubemap_coords(nir_shader *shader); void nir_live_ssa_defs_impl(nir_function_impl *impl); + +void nir_loop_analyze_impl(nir_function_impl *impl); +void nir_loop_analyze(nir_shader *shader); + bool nir_ssa_defs_interfere(nir_ssa_def *a, nir_ssa_def *b); void nir_convert_to_ssa_impl(nir_function_impl *impl); diff --git
[Mesa-dev] [PATCH 02/13] nir: limit copy propagation inside loops
Don't do copy propagation inside loops until after we try unrolling them. This helps avoid propagating everything to the phis which makes loop unrolling more difficult. For example without this: loop { block block_1: /* preds: block_0 block_4 */ vec1 32 ssa_10 = phi block_0: ssa_5, block_4: ssa_15 vec1 32 ssa_11 = phi block_0: ssa_6, block_4: ssa_17 vec1 32 ssa_12 = phi block_0: ssa_7, block_4: ssa_18 vec1 32 ssa_13 = phi block_0: ssa_8, block_4: ssa_19 vec1 32 ssa_14 = phi block_0: ssa_9, block_4: ssa_20 vec1 32 ssa_15 = iadd ssa_10, ssa_2 vec1 32 ssa_16 = ige ssa_15, ssa_1 /* succs: block_2 block_3 */ if ssa_16 { block block_2: /* preds: block_1 */ break /* succs: block_5 */ } else { block block_3: /* preds: block_1 */ /* succs: block_4 */ } block block_4: /* preds: block_3 */ vec1 32 ssa_17 = imov ssa_12 vec1 32 ssa_18 = imov ssa_13 vec1 32 ssa_19 = imov ssa_14 vec1 32 ssa_20 = imov ssa_11 /* succs: block_1 */ } Will end up as: loop { /* preds: block_0 block_4 */ block block_1: vec1 32 ssa_10 = phi block_0: ssa_5, block_4: ssa_15 vec1 32 ssa_11 = phi block_0: ssa_6, block_4: ssa_12 vec1 32 ssa_12 = phi block_0: ssa_7, block_4: ssa_13 vec1 32 ssa_13 = phi block_0: ssa_8, block_4: ssa_14 vec1 32 ssa_14 = phi block_0: ssa_9, block_4: ssa_11 vec1 32 ssa_15 = iadd ssa_10, ssa_2 vec1 32 ssa_16 = ige ssa_15, ssa_1 /* succs: block_2 block_3 */ if ssa_16 { block block_2: /* preds: block_1 */ break /* succs: block_5 */ } else { block block_3: /* preds: block_1 */ /* succs: block_4 */ } block block_4: /* preds: block_3 */ /* succs: block_1 */ } --- src/compiler/nir/nir.h| 2 +- src/compiler/nir/nir_opt_copy_propagate.c | 47 --- src/mesa/drivers/dri/i965/brw_nir.c | 6 ++-- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index d0dfb0d..7ff5394 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2573,7 +2573,7 @@ bool nir_opt_constant_folding(nir_shader *shader); bool nir_opt_global_to_local(nir_shader *shader); -bool nir_copy_prop(nir_shader *shader); +bool nir_copy_prop(nir_shader *shader, bool prop_loops); bool nir_opt_cse(nir_shader *shader); diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c index c26e07f..12daeb6 100644 --- a/src/compiler/nir/nir_opt_copy_propagate.c +++ b/src/compiler/nir/nir_opt_copy_propagate.c @@ -99,11 +99,14 @@ is_swizzleless_move(nir_alu_instr *instr) } static bool -copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if) +copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if, + bool prop_loops) { if (!src->is_ssa) { - if (src->reg.indirect) - return copy_prop_src(src->reg.indirect, parent_instr, parent_if); + if (src->reg.indirect) { + return copy_prop_src(src->reg.indirect, parent_instr, parent_if, + prop_loops); + } return false; } @@ -125,6 +128,14 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if) if (phi->dest.ssa.num_components != alu_instr->src[0].src.ssa->num_components) return false; + + /* Avoid propagating moves inside a loop into phis which makes + * unrolling difficult. + */ + if (!prop_loops) { + if (phi->instr.block->cf_node.parent->type == nir_cf_node_loop) +return false; + } } if (parent_instr) { @@ -140,13 +151,14 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if) } static bool -copy_prop_alu_src(nir_alu_instr *parent_alu_instr, unsigned index) +copy_prop_alu_src(nir_alu_instr *parent_alu_instr, unsigned index, + bool prop_loops) { nir_alu_src *src = _alu_instr->src[index]; if (!src->src.is_ssa) { if (src->src.reg.indirect) return copy_prop_src(src->src.reg.indirect, _alu_instr->instr, - NULL); + NULL, prop_loops); return false; } @@ -195,6 +207,7 @@ copy_prop_alu_src(nir_alu_instr *parent_alu_instr, unsigned index) typedef struct { nir_instr *parent_instr; + bool prop_loops; bool progress; } copy_prop_state; @@ -202,25 +215,26 @@ static bool copy_prop_src_cb(nir_src *src, void *_state) { copy_prop_state *state = (copy_prop_state *) _state; - while (copy_prop_src(src, state->parent_instr, NULL)) + while (copy_prop_src(src, state->parent_instr, NULL, state->prop_loops)) state->progress = true; return true; }
[Mesa-dev] V2 Simple loop unrolling in NIR
V2: Bunch of tidy ups from feedback and things I noticed after sending the RFC. This series does the equivalent of the simple unroll in GLSL IR. The main difference is that currently it unrolls everything with an iteration count < 32, the GLSL IR pass also tries to limit unrolling based on the number of nodes it contains but this seemed a little simplistic so I have left this out for now. I'm still working on the complex unroll equivalent but hacking the cf in NIR is not much fun so I thought I'd send the series as is for now to get some feedback. I guess it also my be useful for Vulkan as is. This series works on ssa defs so for now it's only enabled for Gen8+. Shader-db results for BDW: total instructions in shared programs: 8527200 -> 8526827 (-0.00%) instructions in affected programs: 50339 -> 49966 (-0.74%) helped: 103 HURT: 89 total cycles in shared programs: 70789034 -> 70756662 (-0.05%) cycles in affected programs: 3273418 -> 3241046 (-0.99%) helped: 1027 HURT: 864 total loops in shared programs: 2069 -> 1819 (-12.08%) loops in affected programs: 568 -> 318 (-44.01%) helped: 522 HURT: 280 total spills in shared programs: 2212 -> 2212 (0.00%) spills in affected programs: 0 -> 0 helped: 0 HURT: 0 total fills in shared programs: 1894 -> 1894 (0.00%) fills in affected programs: 0 -> 0 helped: 0 HURT: 0 LOST: 9 GAINED: 0 Almost all of the HURT programs with increased loop counts are from planeshift and basically contain an if () break; a equivalent of complex unroll should fix this up. As for the helped loop counts I'm not entirely sure (haven't checked) why the GLSL IR pass is not unrolling them as the ones I've looked at do not seem like they should be skipped and seem to produce acceptable output in NIR. I'm seeing a single regression from this series on hardware I don't own I suspect this may be cause by patch 1 but need to confirm. Test: piglit.spec.!opengl 2_0.max-samplers Status: fail Platform/arch: snb/m64, g965/m64, ilk/m64, g45/m64 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 01/13] i965: use nir_lower_indirect_derefs() for GLSL
This moves the nir_lower_indirect_derefs() call into brw_preprocess_nir() so thats is called by both OpenGL and Vulkan and removes that call to the old GLSL IR pass lower_variable_index_to_cond_assign() We want to do this pass in nir to be able to move loop unrolling to nir. There is a increase of 1-3 instructions in a small number of shaders, and 2 Kerbal Space program shaders that increase by 32 instructions. Shader-db results BDW: total instructions in shared programs: 8705873 -> 8706194 (0.00%) instructions in affected programs: 32515 -> 32836 (0.99%) helped: 3 HURT: 79 total cycles in shared programs: 74618120 -> 74583476 (-0.05%) cycles in affected programs: 528104 -> 493460 (-6.56%) helped: 47 HURT: 37 LOST: 2 GAINED: 0 --- src/intel/vulkan/anv_pipeline.c| 8 src/mesa/drivers/dri/i965/brw_link.cpp | 14 -- src/mesa/drivers/dri/i965/brw_nir.c| 8 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 88f414e..ac6bf56 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -182,14 +182,6 @@ anv_shader_compile_to_nir(struct anv_device *device, nir_shader_gather_info(nir, entry_point->impl); - nir_variable_mode indirect_mask = 0; - if (compiler->glsl_compiler_options[stage].EmitNoIndirectInput) - indirect_mask |= nir_var_shader_in; - if (compiler->glsl_compiler_options[stage].EmitNoIndirectTemp) - indirect_mask |= nir_var_local; - - nir_lower_indirect_derefs(nir, indirect_mask); - return nir; } diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 4800be0..369f79d 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -139,20 +139,6 @@ process_glsl_ir(gl_shader_stage stage, do_copy_propagation(shader->ir); - bool lowered_variable_indexing = - lower_variable_index_to_cond_assign((gl_shader_stage)stage, - shader->ir, - options->EmitNoIndirectInput, - options->EmitNoIndirectOutput, - options->EmitNoIndirectTemp, - options->EmitNoIndirectUniform); - - if (unlikely(brw->perf_debug && lowered_variable_indexing)) { - perf_debug("Unsupported form of variable indexing in %s; falling " - "back to very inefficient code generation\n", - _mesa_shader_stage_to_abbrev(shader->Stage)); - } - bool progress; do { progress = false; diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index 24a64cb..29a3e3e 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -453,6 +453,14 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir) /* Lower a bunch of stuff */ OPT_V(nir_lower_var_copies); + nir_variable_mode indirect_mask = 0; + if (compiler->glsl_compiler_options[nir->stage].EmitNoIndirectInput) + indirect_mask |= nir_var_shader_in; + if (compiler->glsl_compiler_options[nir->stage].EmitNoIndirectTemp) + indirect_mask |= nir_var_local; + + nir_lower_indirect_derefs(nir, indirect_mask); + /* Get rid of split copies */ nir = nir_optimize(nir, is_scalar); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/3] isl: add support for Android libmesa_isl static library
On 08/26/2016 02:51 PM, Mauro Rossi wrote: 2016-08-26 12:27 GMT+02:00 Tapani Pälli>: Hi; This is patch is causing build issues for me, how was this tested? Hi, thanks for highlighting the issue, My patch was tested and reviewed, the current android build breakage due to following commit, upstreamed 13 hours ago: https://cgit.freedesktop.org/mesa/mesa/commit/src/intel?id=bebc1a1d995e33f173ea207848bcddd81f6dd19a ok TMK there is a collaboration in place to quickly fix this kind of situations: - mesa-devs highlight potential build breakage issues, usually within a few hours, one day top - Rob Herring has a CI job used for alerting about build breakages - android-x86 team members periodically check (in my case usually on a per weekly basis) In this case I've seen you already submitted the correction patch, I'll check with my usual weekly schedule and report if I see any trouble. Thanks, will try out your patch today and report back. Kind regards Mauro ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] android: fix build issues with genxml, isl
On 08/28/2016 03:51 AM, Mauro Rossi wrote: Hi Emil, Jason, Tapani, this weekend I had planned to check mesa-dev with marshmallow-x86 and nougat-x86,builds, so here you can find the port to android of commit bebc1a1d995e33f173ea207848bcddd81f6dd19a Built successfully and tested on Sandybridge. Added also the same formatted patch as attachment in case gmail causes problems. Super, will test this. Did you notice that genxml blorp things won't work for gen < 8? This was at least the situation for me, I have disabled everything gen < 8 locally and was planning to take better look at why things fail later. Mauro From 4769f3e4b51fc804676d2b7b2ea320cfa5fffdde Mon Sep 17 00:00:00 2001 From: Mauro RossiDate: Sat, 27 Aug 2016 17:19:34 +0200 Subject: [PATCH] android: intel: Flatten the makefile structure Android porting of commit bebc1a1 "intel: Flatten the makefile structure" Automake approach was followed, by moving makefiles a level up, naming them Android.genxml.mk and Android.isl.mk, performing the necessary adjustments to the paths, adding src/intel/Android.mk and fixing mesa top level makefile. --- Android.mk | 3 +- src/intel/Android.genxml.mk | 97 src/intel/Android.isl.mk| 216 +++ src/intel/Android.mk| 29 ++ src/intel/genxml/Android.mk | 97 src/intel/isl/Android.mk| 217 6 files changed, 343 insertions(+), 316 deletions(-) create mode 100644 src/intel/Android.genxml.mk create mode 100644 src/intel/Android.isl.mk create mode 100644 src/intel/Android.mk delete mode 100644 src/intel/genxml/Android.mk delete mode 100644 src/intel/isl/Android.mk diff --git a/Android.mk b/Android.mk index f673029..4a63384 100644 --- a/Android.mk +++ b/Android.mk @@ -90,8 +90,7 @@ SUBDIRS := \ src/mesa \ src/util \ src/egl \ - src/intel/genxml \ - src/intel/isl \ + src/intel \ src/mesa/drivers/dri INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/intel/Android.genxml.mk b/src/intel/Android.genxml.mk new file mode 100644 index 000..79de784 --- /dev/null +++ b/src/intel/Android.genxml.mk @@ -0,0 +1,97 @@ +# Copyright © 2016 Intel Corporation +# Copyright © 2016 Mauro Rossi +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +# --- +# Build libmesa_genxml +# --- + +include $(CLEAR_VARS) + +LOCAL_MODULE := libmesa_genxml + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +intermediates := $(call local-generated-sources-dir) + +# dummy.c source file is generated to meet the build system's rules. +LOCAL_GENERATED_SOURCES += $(intermediates)/dummy.c + +$(intermediates)/dummy.c: + @mkdir -p $(dir $@) + @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) touch $@ + +# This is the list of auto-generated files headers +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(GENXML_GENERATED_FILES)) + +define header-gen + @mkdir -p $(dir $@) + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) $(PRIVATE_SCRIPT) $(PRIVATE_XML) > $@ +endef + +$(intermediates)/genxml/gen4_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py +$(intermediates)/genxml/gen4_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen4.xml +$(intermediates)/genxml/gen4_pack.h: $(LOCAL_PATH)/genxml/gen4.xml $(LOCAL_PATH)/genxml/gen_pack_header.py + $(call header-gen) + +$(intermediates)/genxml/gen45_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py +$(intermediates)/genxml/gen45_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen45.xml +$(intermediates)/genxml/gen45_pack.h: $(LOCAL_PATH)/genxml/gen45.xml $(LOCAL_PATH)/genxml/gen_pack_header.py + $(call header-gen) + +$(intermediates)/genxml/gen5_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2)
Re: [Mesa-dev] [PATCH] automake: egl: Android: Add libEGL dependencies
On 08/26/2016 03:58 PM, Emil Velikov wrote: On 26 August 2016 at 08:50, Tapani Pälliwrote: Reviewed-by: Tapani Pälli What happened with my suggestion about getting things fixed as opposed to adding tape over things, namely these thread [1] ? Can someone please look into that one instead or give me some tips how I can get things into AOSP ? Last time I've looked AOSP had longer and more convoluted procedures than anything in the Linux graphics stack. I'm not sure when this kind of 'big change' would happen, would be nice to have a working solution now and then discuss better solution in peace? (trying to reduce the amount of patches that have to be applied to get things working/built) Thanks Emil [1] https://lists.freedesktop.org/archives/mesa-dev/2016-May/117757.html // Tapani ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97525] [VDPAU]: artifacts when trying video sharpening and noise-reduction before CSC
https://bugs.freedesktop.org/show_bug.cgi?id=97525 Bug ID: 97525 Summary: [VDPAU]: artifacts when trying video sharpening and noise-reduction before CSC Product: Mesa Version: unspecified Hardware: Other OS: All Status: NEW Severity: enhancement Priority: medium Component: Other Assignee: mesa-dev@lists.freedesktop.org Reporter: nayan26deshm...@gmail.com QA Contact: mesa-dev@lists.freedesktop.org When we apply noise reduction or sharpness filters before CSC, it leads to various chroma effects. I had submitted patches for this change to the list and had a discussion of the possible reasons for this. I attaching a link to our conversation. https://lists.freedesktop.org/archives/mesa-dev/2016-August/125735.html -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Update Khronos-supplied headers to r33100
On 08/29/2016 03:18 AM, Ilia Mirkin wrote: > On Sun, Aug 28, 2016 at 1:10 PM, Ilia Mirkinwrote: >> As retrieved from opengl.org and khronos.org. Maintained the APPLE hack >> in GL/glext.h manually. Added gl32.h. >> >> Signed-off-by: Ilia Mirkin Acked-by: Edward O'Callaghan >> --- >> >> I want this for OES_viewport_array, as well as the likely upcoming support >> for ES 3.2. >> >> Technically these headers don't matter for almost anything inside mesa, but >> they're the ones we ship, so should probably keep them up to date. >> >> include/GL/glext.h |9 +- >> include/GL/glxext.h| 36 +- >> include/GL/wglext.h|6 +- >> include/GLES2/gl2.h| 154 +++- >> include/GLES2/gl2ext.h | 262 +- >> include/GLES2/gl2platform.h|2 +- >> include/GLES3/gl3.h| 280 +- >> include/GLES3/gl31.h | 348 ++- >> include/GLES3/gl32.h | 1825 + >> src/mapi/glapi/registry/gl.xml | 1964 >> >> 10 files changed, 4677 insertions(+), 209 deletions(-) >> create mode 100644 include/GLES3/gl32.h > > Oops, looks like this is too big for the list. You can see the full > commit at > https://github.com/imirkin/mesa/commit/99eb35e30b4727f9c9914e73dd0d9f79cb570570.patch > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeonsi: add support for cull distances. (v1.1)
On 08/29/2016 12:16 PM, Dave Airlie wrote: > From: Dave Airlie> > This should be all that is required for cull distances to work > on radeonsi. > > v1.1: whitespace cleanup, add docs fix clipdist_mask usage. > > Signed-off-by: Dave Airlie Reviewed-by: Edward O'Callaghan > --- > docs/features.txt | 2 +- > docs/relnotes/12.1.0.html | 1 + > src/gallium/drivers/radeonsi/si_pipe.c | 2 +- > src/gallium/drivers/radeonsi/si_state.c | 7 --- > 4 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/docs/features.txt b/docs/features.txt > index 26e8ff7..4ca1b99 100644 > --- a/docs/features.txt > +++ b/docs/features.txt > @@ -211,7 +211,7 @@ GL 4.5, GLSL 4.50: >GL_ARB_ES3_1_compatibilityDONE (i965/gen8+, > nvc0, radeonsi) >GL_ARB_clip_control DONE (i965, nv50, > nvc0, r600, radeonsi, llvmpipe, softpipe, swr) >GL_ARB_conditional_render_invertedDONE (i965, nv50, > nvc0, r600, radeonsi, llvmpipe, softpipe, swr) > - GL_ARB_cull_distance DONE (i965, nv50, > nvc0, llvmpipe, softpipe, swr) > + GL_ARB_cull_distance DONE (i965, nv50, > nvc0, radeonsi, llvmpipe, softpipe, swr) >GL_ARB_derivative_control DONE (i965, nv50, > nvc0, r600, radeonsi) >GL_ARB_direct_state_accessDONE (all drivers) >GL_ARB_get_texture_sub_image DONE (all drivers) > diff --git a/docs/relnotes/12.1.0.html b/docs/relnotes/12.1.0.html > index d22d14b..c7f005d 100644 > --- a/docs/relnotes/12.1.0.html > +++ b/docs/relnotes/12.1.0.html > @@ -47,6 +47,7 @@ Note: some of the new features are only available with > certain drivers. > OpenGL ES 3.1 on i965/hsw > GL_ARB_ES3_1_compatibility on i965 > GL_ARB_clear_texture on r600, radeonsi > +GL_ARB_cull_distance on radeonsi > GL_ARB_enhanced_layouts on i965 > GL_ARB_indirect_parameters on radeonsi > GL_ARB_shader_draw_parameters on radeonsi > diff --git a/src/gallium/drivers/radeonsi/si_pipe.c > b/src/gallium/drivers/radeonsi/si_pipe.c > index 8e7d021..8f9e6f5 100644 > --- a/src/gallium/drivers/radeonsi/si_pipe.c > +++ b/src/gallium/drivers/radeonsi/si_pipe.c > @@ -399,6 +399,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum > pipe_cap param) > case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED: > case PIPE_CAP_STRING_MARKER: > case PIPE_CAP_CLEAR_TEXTURE: > + case PIPE_CAP_CULL_DISTANCE: > return 1; > > case PIPE_CAP_RESOURCE_FROM_USER_MEMORY: > @@ -448,7 +449,6 @@ static int si_get_param(struct pipe_screen* pscreen, enum > pipe_cap param) > case PIPE_CAP_TEXTURE_GATHER_OFFSETS: > case PIPE_CAP_VERTEXID_NOBASE: > case PIPE_CAP_QUERY_BUFFER_OBJECT: > - case PIPE_CAP_CULL_DISTANCE: > case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES: > case PIPE_CAP_TGSI_VOTE: > case PIPE_CAP_MAX_WINDOW_RECTANGLES: > diff --git a/src/gallium/drivers/radeonsi/si_state.c > b/src/gallium/drivers/radeonsi/si_state.c > index 25dfe26..375e74b 100644 > --- a/src/gallium/drivers/radeonsi/si_state.c > +++ b/src/gallium/drivers/radeonsi/si_state.c > @@ -650,21 +650,22 @@ static void si_emit_clip_regs(struct si_context *sctx, > struct r600_atom *atom) > info->properties[TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION]; > unsigned clipdist_mask = > info->writes_clipvertex ? SIX_BITS : info->clipdist_writemask; > + unsigned total_mask = clipdist_mask | (info->culldist_writemask << > info->num_written_clipdistance); > > radeon_set_context_reg(cs, R_02881C_PA_CL_VS_OUT_CNTL, > S_02881C_USE_VTX_POINT_SIZE(info->writes_psize) | > S_02881C_USE_VTX_EDGE_FLAG(info->writes_edgeflag) | > S_02881C_USE_VTX_RENDER_TARGET_INDX(info->writes_layer) | > S_02881C_USE_VTX_VIEWPORT_INDX(info->writes_viewport_index) | > - S_02881C_VS_OUT_CCDIST0_VEC_ENA((clipdist_mask & 0x0F) != 0) | > - S_02881C_VS_OUT_CCDIST1_VEC_ENA((clipdist_mask & 0xF0) != 0) | > + S_02881C_VS_OUT_CCDIST0_VEC_ENA((total_mask & 0x0F) != 0) | > + S_02881C_VS_OUT_CCDIST1_VEC_ENA((total_mask & 0xF0) != 0) | > S_02881C_VS_OUT_MISC_VEC_ENA(info->writes_psize || > info->writes_edgeflag || > info->writes_layer || >info->writes_viewport_index) | > S_02881C_VS_OUT_MISC_SIDE_BUS_ENA(1) | > (sctx->queued.named.rasterizer->clip_plane_enable & > - clipdist_mask)); > + clipdist_mask) | (info->culldist_writemask << 8)); > radeon_set_context_reg(cs, R_028810_PA_CL_CLIP_CNTL, >
Re: [Mesa-dev] [PATCH] glsl: initialise pointer to NULL
On Monday, August 29, 2016 12:03:47 PM PDT Timothy Arceri wrote: > Fixes uninitialised warning and covery defect. > > Cc: Kenneth Graunke> --- > src/compiler/glsl/lower_blend_equation_advanced.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/compiler/glsl/lower_blend_equation_advanced.cpp > b/src/compiler/glsl/lower_blend_equation_advanced.cpp > index 1c095dd..a998df1 100644 > --- a/src/compiler/glsl/lower_blend_equation_advanced.cpp > +++ b/src/compiler/glsl/lower_blend_equation_advanced.cpp > @@ -438,7 +438,7 @@ deref_output(ir_variable *var) > static ir_function_signature * > get_main(gl_linked_shader *sh) > { > - ir_function_signature *sig; > + ir_function_signature *sig = NULL; > /* We can't use _mesa_get_main_function_signature() because we don't > * have a symbol table at this point. Just go find main() by hand. > */ > I wrote this same patch yesterday but accidentally only sent out the FLT_EPSILON one. Sorry for the trouble. Let's call that a: Reviewed-by: Kenneth Graunke signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] radeonsi: add support for cull distances. (v1.1)
From: Dave AirlieThis should be all that is required for cull distances to work on radeonsi. v1.1: whitespace cleanup, add docs fix clipdist_mask usage. Signed-off-by: Dave Airlie --- docs/features.txt | 2 +- docs/relnotes/12.1.0.html | 1 + src/gallium/drivers/radeonsi/si_pipe.c | 2 +- src/gallium/drivers/radeonsi/si_state.c | 7 --- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 26e8ff7..4ca1b99 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -211,7 +211,7 @@ GL 4.5, GLSL 4.50: GL_ARB_ES3_1_compatibilityDONE (i965/gen8+, nvc0, radeonsi) GL_ARB_clip_control DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe, swr) GL_ARB_conditional_render_invertedDONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe, swr) - GL_ARB_cull_distance DONE (i965, nv50, nvc0, llvmpipe, softpipe, swr) + GL_ARB_cull_distance DONE (i965, nv50, nvc0, radeonsi, llvmpipe, softpipe, swr) GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600, radeonsi) GL_ARB_direct_state_accessDONE (all drivers) GL_ARB_get_texture_sub_image DONE (all drivers) diff --git a/docs/relnotes/12.1.0.html b/docs/relnotes/12.1.0.html index d22d14b..c7f005d 100644 --- a/docs/relnotes/12.1.0.html +++ b/docs/relnotes/12.1.0.html @@ -47,6 +47,7 @@ Note: some of the new features are only available with certain drivers. OpenGL ES 3.1 on i965/hsw GL_ARB_ES3_1_compatibility on i965 GL_ARB_clear_texture on r600, radeonsi +GL_ARB_cull_distance on radeonsi GL_ARB_enhanced_layouts on i965 GL_ARB_indirect_parameters on radeonsi GL_ARB_shader_draw_parameters on radeonsi diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 8e7d021..8f9e6f5 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -399,6 +399,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED: case PIPE_CAP_STRING_MARKER: case PIPE_CAP_CLEAR_TEXTURE: + case PIPE_CAP_CULL_DISTANCE: return 1; case PIPE_CAP_RESOURCE_FROM_USER_MEMORY: @@ -448,7 +449,6 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_TEXTURE_GATHER_OFFSETS: case PIPE_CAP_VERTEXID_NOBASE: case PIPE_CAP_QUERY_BUFFER_OBJECT: - case PIPE_CAP_CULL_DISTANCE: case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES: case PIPE_CAP_TGSI_VOTE: case PIPE_CAP_MAX_WINDOW_RECTANGLES: diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 25dfe26..375e74b 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -650,21 +650,22 @@ static void si_emit_clip_regs(struct si_context *sctx, struct r600_atom *atom) info->properties[TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION]; unsigned clipdist_mask = info->writes_clipvertex ? SIX_BITS : info->clipdist_writemask; + unsigned total_mask = clipdist_mask | (info->culldist_writemask << info->num_written_clipdistance); radeon_set_context_reg(cs, R_02881C_PA_CL_VS_OUT_CNTL, S_02881C_USE_VTX_POINT_SIZE(info->writes_psize) | S_02881C_USE_VTX_EDGE_FLAG(info->writes_edgeflag) | S_02881C_USE_VTX_RENDER_TARGET_INDX(info->writes_layer) | S_02881C_USE_VTX_VIEWPORT_INDX(info->writes_viewport_index) | - S_02881C_VS_OUT_CCDIST0_VEC_ENA((clipdist_mask & 0x0F) != 0) | - S_02881C_VS_OUT_CCDIST1_VEC_ENA((clipdist_mask & 0xF0) != 0) | + S_02881C_VS_OUT_CCDIST0_VEC_ENA((total_mask & 0x0F) != 0) | + S_02881C_VS_OUT_CCDIST1_VEC_ENA((total_mask & 0xF0) != 0) | S_02881C_VS_OUT_MISC_VEC_ENA(info->writes_psize || info->writes_edgeflag || info->writes_layer || info->writes_viewport_index) | S_02881C_VS_OUT_MISC_SIDE_BUS_ENA(1) | (sctx->queued.named.rasterizer->clip_plane_enable & -clipdist_mask)); +clipdist_mask) | (info->culldist_writemask << 8)); radeon_set_context_reg(cs, R_028810_PA_CL_CLIP_CNTL, sctx->queued.named.rasterizer->pa_cl_clip_cntl | (clipdist_mask ? 0 : -- 2.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org
[Mesa-dev] [Bug 97260] [bisected] R9 290 low performance in Linux 4.7
https://bugs.freedesktop.org/show_bug.cgi?id=97260 --- Comment #35 from Michel Dänzer--- (In reply to Clésio Luiz from comment #32) > The package xserver-xorg-video-ati from his PPA is from 08/24 though. That doesn't matter; Mesa does, and it looks like it should have my change. It would be interesting if setting draw->num_back = 4 in dri3_update_num_back helps, but otherwise we really need someone who can still reproduce the problem to bisect the kernel. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] spirv: replace assert with unreachable
Fixes uninitialised warning for coord_components. --- src/compiler/spirv/spirv_to_nir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index ca404d8..fda38f9 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -1426,7 +1426,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode, coord_components = 3; break; default: - assert("Invalid sampler type"); + unreachable("Invalid sampler type"); } if (is_array && texop != nir_texop_lod) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/7] glsl: add core plumbing for GL_ANDROID_extension_pack_es31a
Signed-off-by: Ilia Mirkin--- src/compiler/glsl/glsl_parser_extras.cpp | 57 +++- src/compiler/glsl/glsl_parser_extras.h | 2 ++ src/mesa/main/extensions_table.h | 2 ++ src/mesa/main/mtypes.h | 1 + 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index b33cd3a..a44f014 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -523,6 +523,11 @@ struct _mesa_glsl_extension { const char *name; /** +* Whether this extension is a part of AEP +*/ + bool aep; + + /** * Predicate that checks whether the relevant extension is available for * this context. */ @@ -565,9 +570,14 @@ has_##name_str(const struct gl_context *ctx, gl_api api, uint8_t version) \ #undef EXT #define EXT(NAME) \ - { "GL_" #NAME, has_##NAME, \ - &_mesa_glsl_parse_state::NAME##_enable,\ - &_mesa_glsl_parse_state::NAME##_warn } + { "GL_" #NAME, false, has_##NAME,\ + &_mesa_glsl_parse_state::NAME##_enable,\ + &_mesa_glsl_parse_state::NAME##_warn } + +#define EXT_AEP(NAME) \ + { "GL_" #NAME, true, has_##NAME, \ + &_mesa_glsl_parse_state::NAME##_enable,\ + &_mesa_glsl_parse_state::NAME##_warn } /** * Table of extensions that can be enabled/disabled within a shader, @@ -623,7 +633,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { /* KHR extensions go here, sorted alphabetically. */ - EXT(KHR_blend_equation_advanced), + EXT_AEP(KHR_blend_equation_advanced), /* OES extensions go here, sorted alphabetically. */ @@ -632,17 +642,17 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(OES_geometry_shader), EXT(OES_gpu_shader5), EXT(OES_primitive_bounding_box), - EXT(OES_sample_variables), - EXT(OES_shader_image_atomic), + EXT_AEP(OES_sample_variables), + EXT_AEP(OES_shader_image_atomic), EXT(OES_shader_io_blocks), - EXT(OES_shader_multisample_interpolation), + EXT_AEP(OES_shader_multisample_interpolation), EXT(OES_standard_derivatives), EXT(OES_tessellation_point_size), EXT(OES_tessellation_shader), EXT(OES_texture_3D), EXT(OES_texture_buffer), EXT(OES_texture_cube_map_array), - EXT(OES_texture_storage_multisample_2d_array), + EXT_AEP(OES_texture_storage_multisample_2d_array), /* All other extensions go here, sorted alphabetically. */ @@ -651,23 +661,24 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(AMD_shader_trinary_minmax), EXT(AMD_vertex_shader_layer), EXT(AMD_vertex_shader_viewport_index), + EXT(ANDROID_extension_pack_es31a), EXT(EXT_blend_func_extended), EXT(EXT_draw_buffers), EXT(EXT_clip_cull_distance), EXT(EXT_geometry_point_size), - EXT(EXT_geometry_shader), - EXT(EXT_gpu_shader5), - EXT(EXT_primitive_bounding_box), + EXT_AEP(EXT_geometry_shader), + EXT_AEP(EXT_gpu_shader5), + EXT_AEP(EXT_primitive_bounding_box), EXT(EXT_separate_shader_objects), EXT(EXT_shader_framebuffer_fetch), EXT(EXT_shader_integer_mix), - EXT(EXT_shader_io_blocks), + EXT_AEP(EXT_shader_io_blocks), EXT(EXT_shader_samples_identical), EXT(EXT_tessellation_point_size), - EXT(EXT_tessellation_shader), + EXT_AEP(EXT_tessellation_shader), EXT(EXT_texture_array), - EXT(EXT_texture_buffer), - EXT(EXT_texture_cube_map_array), + EXT_AEP(EXT_texture_buffer), + EXT_AEP(EXT_texture_cube_map_array), EXT(MESA_shader_integer_functions), }; @@ -713,7 +724,6 @@ static const _mesa_glsl_extension *find_extension(const char *name) return NULL; } - bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, const char *behavior_string, YYLTYPE *behavior_locp, @@ -768,6 +778,21 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, const _mesa_glsl_extension *extension = find_extension(name); if (extension && extension->compatible_with_state(state, api, gl_version)) { extension->set_flags(state, behavior); + if (extension->available_pred == has_ANDROID_extension_pack_es31a) { +for (unsigned i = 0; + i < ARRAY_SIZE(_mesa_glsl_supported_extensions); ++i) { + const _mesa_glsl_extension *extension = + &_mesa_glsl_supported_extensions[i]; + + if (!extension->aep) + continue; + // AEP should not be enabled if all of the sub-extensions can't + // also be enabled. This is not the proper layer to do such +
[Mesa-dev] [PATCH 6/7] mesa: add a GLES3.2 enums section, and expose new MS line width params
This also exposes them for ARB_ES3_2_compatibility. Signed-off-by: Ilia Mirkin--- src/mesa/main/context.h | 10 ++ src/mesa/main/get.c | 26 -- src/mesa/main/get_hash_generator.py | 12 src/mesa/main/get_hash_params.py| 5 + 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 4cd149d..520b3bb 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -318,6 +318,16 @@ _mesa_is_gles31(const struct gl_context *ctx) /** + * Checks if the context is for GLES 3.2 or later + */ +static inline bool +_mesa_is_gles32(const struct gl_context *ctx) +{ + return ctx->API == API_OPENGLES2 && ctx->Version >= 32; +} + + +/** * Checks if the context supports geometry shaders. */ static inline bool diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 810ccb9..3cabb2b 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -142,6 +142,7 @@ enum value_extra { EXTRA_API_ES2, EXTRA_API_ES3, EXTRA_API_ES31, + EXTRA_API_ES32, EXTRA_NEW_BUFFERS, EXTRA_NEW_FRAG_CLAMP, EXTRA_VALID_DRAW_BUFFER, @@ -416,6 +417,12 @@ static const int extra_ARB_gpu_shader5_or_OES_sample_variables[] = { EXTRA_END }; +static const int extra_ES32[] = { + EXT(ARB_ES3_2_compatibility), + EXTRA_API_ES32, + EXTRA_END +}; + EXTRA_EXT(ARB_texture_cube_map); EXTRA_EXT(EXT_texture_array); EXTRA_EXT(NV_fog_distance); @@ -1164,6 +1171,11 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d if (_mesa_is_gles31(ctx)) api_found = GL_TRUE; break; + case EXTRA_API_ES32: + api_check = GL_TRUE; + if (_mesa_is_gles32(ctx)) +api_found = GL_TRUE; +break; case EXTRA_API_GL: api_check = GL_TRUE; if (_mesa_is_desktop_gl(ctx)) @@ -1312,12 +1324,14 @@ find_value(const char *func, GLenum pname, void **p, union value *v) * value since it's compatible with GLES2 its entry in table_set[] is at the * end. */ - STATIC_ASSERT(ARRAY_SIZE(table_set) == API_OPENGL_LAST + 3); - if (_mesa_is_gles3(ctx)) { - api = API_OPENGL_LAST + 1; - } - if (_mesa_is_gles31(ctx)) { - api = API_OPENGL_LAST + 2; + STATIC_ASSERT(ARRAY_SIZE(table_set) == API_OPENGL_LAST + 4); + if (ctx->API == API_OPENGLES2) { + if (ctx->Version >= 32) + api = API_OPENGL_LAST + 3; + else if (ctx->Version >= 31) + api = API_OPENGL_LAST + 2; + else if (ctx->Version >= 30) + api = API_OPENGL_LAST + 1; } mask = ARRAY_SIZE(table(api)) - 1; hash = (pname * prime_factor); diff --git a/src/mesa/main/get_hash_generator.py b/src/mesa/main/get_hash_generator.py index c777b78..a8b4647 100644 --- a/src/mesa/main/get_hash_generator.py +++ b/src/mesa/main/get_hash_generator.py @@ -44,7 +44,7 @@ prime_factor = 89 prime_step = 281 hash_table_size = 1024 -gl_apis=set(["GL", "GL_CORE", "GLES", "GLES2", "GLES3", "GLES31"]) +gl_apis=set(["GL", "GL_CORE", "GLES", "GLES2", "GLES3", "GLES31", "GLES32"]) def print_header(): print "typedef const unsigned short table_t[%d];\n" % (hash_table_size) @@ -69,6 +69,7 @@ api_enum = [ 'GL_CORE', 'GLES3', # Not in gl_api enum in mtypes.h 'GLES31', # Not in gl_api enum in mtypes.h + 'GLES32', # Not in gl_api enum in mtypes.h ] def api_index(api): @@ -168,13 +169,15 @@ def generate_hash_tables(enum_list, enabled_apis, param_descriptors): for api in valid_apis: add_to_hash_table(tables[api], hash_val, len(params)) -# Also add GLES2 items to the GLES3 and GLES31 hash table +# Also add GLES2 items to the GLES3+ hash tables if api == "GLES2": add_to_hash_table(tables["GLES3"], hash_val, len(params)) add_to_hash_table(tables["GLES31"], hash_val, len(params)) -# Also add GLES3 items to the GLES31 hash table + add_to_hash_table(tables["GLES32"], hash_val, len(params)) +# Also add GLES3 items to the GLES31+ hash tables if api == "GLES3": add_to_hash_table(tables["GLES31"], hash_val, len(params)) + add_to_hash_table(tables["GLES32"], hash_val, len(params)) params.append(["GL_" + enum_name, param[1]]) sorted_tables={} @@ -210,7 +213,8 @@ if __name__ == '__main__': die("missing descriptor file (-f)\n") # generate the code for all APIs - enabled_apis = set(["GLES", "GLES2", "GLES3", "GLES31", "GL", "GL_CORE"]) + enabled_apis = set(["GLES", "GLES2", "GLES3", "GLES31", "GLES32", + "GL", "GL_CORE"]) try: api_desc = gl_XML.parse_GL_API(api_desc_file) diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index a206c85..0ff2af9 100644 ---
[Mesa-dev] [PATCH 7/7] mesa: introduce glPrimitiveBoundingBoxARB entrypoint
This requires a bit of rejiggering, since normally ES entrypoints alias core ones, not vice-versa. Signed-off-by: Ilia Mirkin--- src/mapi/glapi/gen/es_EXT.xml | 19 - src/mapi/glapi/gen/gl_API.xml | 37 + src/mesa/main/tests/dispatch_sanity.cpp | 3 +++ 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index b9fbec4..332dc5e 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -1342,23 +1342,4 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index c39aa22..17c59db 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -8318,6 +8318,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 42fe61a..c87b1dc 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1866,6 +1866,9 @@ const struct function gl_core_functions_possible[] = { { "glMultiDrawArraysIndirectCountARB", 31, -1 }, { "glMultiDrawElementsIndirectCountARB", 31, -1 }, + /* GL_ARB_ES3_2_compatibility */ + { "glPrimitiveBoundingBoxARB", 45, -1 }, + { NULL, 0, -1 } }; -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/7] mapi: don't forget to expose GetPointerv in GL ES 3.2
I left this out of my previous commit that went around enabling all of the other ES 3.2 entrypoints. Signed-off-by: Ilia Mirkin--- src/mapi/glapi/gen/gl_API.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index b5d010b..c39aa22 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -3185,7 +3185,7 @@ - + -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/7] main: add KHR_robustness to ES 3.2 extension requirements
Signed-off-by: Ilia Mirkin--- 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 cfc1638..85ec9de 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -531,6 +531,7 @@ compute_version_es2(const struct gl_extensions *extensions, extensions->EXT_shader_integer_mix); const bool ver_3_2 = (ver_3_1 && extensions->KHR_blend_equation_advanced && + extensions->KHR_robustness && extensions->KHR_texture_compression_astc_ldr && extensions->OES_copy_image && extensions->ARB_draw_buffers_blend && -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/7] glsl: expose max atomic counter/buffer consts for tess in ES 3.2
Curiously OES/EXT_tessellation_shader leave these out, while ES 3.2 adds them in. Signed-off-by: Ilia Mirkin--- src/compiler/glsl/builtin_variables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 036261f..93d8c92 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -759,7 +759,7 @@ builtin_variable_generator::generate_constants() add_const("gl_MaxGeometryAtomicCounters", state->Const.MaxGeometryAtomicCounters); } - if (!state->es_shader) { + if (state->is_version(110, 320)) { add_const("gl_MaxTessControlAtomicCounters", state->Const.MaxTessControlAtomicCounters); add_const("gl_MaxTessEvaluationAtomicCounters", @@ -781,7 +781,7 @@ builtin_variable_generator::generate_constants() add_const("gl_MaxGeometryAtomicCounterBuffers", state->Const.MaxGeometryAtomicCounterBuffers); } - if (!state->es_shader) { + if (state->is_version(110, 320)) { add_const("gl_MaxTessControlAtomicCounterBuffers", state->Const.MaxTessControlAtomicCounterBuffers); add_const("gl_MaxTessEvaluationAtomicCounterBuffers", -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/7] Core ES 3.2 + AEP left-overs
While we're waiting for the tessellation patches to land, I went ahead and implemented what's necessary for ES 3.2 (and ARB_ES3_2_compatibility) along with AEP. It's not that much. These apply on top of my bounding box patches. You can find a full tree here: https://github.com/imirkin/mesa/commits/gles32 [It also has Ken's tess patches, as well as patches to flip these various features on for st/mesa and i965.] Ilia Mirkin (7): main: add KHR_robustness to ES 3.2 extension requirements mapi: don't forget to expose GetPointerv in GL ES 3.2 glsl: expose max atomic counter/buffer consts for tess in ES 3.2 glsl: add core plumbing for GL_ANDROID_extension_pack_es31a mesa: introduce MS variants of line width min/max/granularity mesa: add a GLES3.2 enums section, and expose new MS line width params mesa: introduce glPrimitiveBoundingBoxARB entrypoint src/compiler/glsl/builtin_variables.cpp | 4 +- src/compiler/glsl/glsl_parser_extras.cpp| 57 + src/compiler/glsl/glsl_parser_extras.h | 2 + src/mapi/glapi/gen/es_EXT.xml | 19 -- src/mapi/glapi/gen/gl_API.xml | 39 +++- src/mesa/drivers/dri/i965/brw_context.c | 5 +++ src/mesa/main/context.c | 3 ++ src/mesa/main/context.h | 10 + src/mesa/main/extensions_table.h| 2 + src/mesa/main/get.c | 26 ++--- src/mesa/main/get_hash_generator.py | 12 -- src/mesa/main/get_hash_params.py| 5 +++ src/mesa/main/mtypes.h | 3 ++ src/mesa/main/tests/dispatch_sanity.cpp | 3 ++ src/mesa/main/version.c | 1 + src/mesa/state_tracker/st_atom_rasterizer.c | 16 +--- src/mesa/state_tracker/st_extensions.c | 1 + 17 files changed, 154 insertions(+), 54 deletions(-) -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 5/7] mesa: introduce MS variants of line width min/max/granularity
These are exposed in ES 3.2. However this moves all st/mesa to clamping on the MS variants. But for now the MS variants are initialized to the AA values. Signed-off-by: Ilia Mirkin--- src/mesa/drivers/dri/i965/brw_context.c | 5 + src/mesa/main/context.c | 3 +++ src/mesa/main/mtypes.h | 2 ++ src/mesa/state_tracker/st_atom_rasterizer.c | 16 ++-- src/mesa/state_tracker/st_extensions.c | 1 + 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 888097d..b29df32 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -604,14 +604,19 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.MinLineWidth = 1.0; ctx->Const.MinLineWidthAA = 1.0; + ctx->Const.MinLineWidthMS = 1.0; if (brw->gen >= 6) { ctx->Const.MaxLineWidth = 7.375; ctx->Const.MaxLineWidthAA = 7.375; + ctx->Const.MaxLineWidthMS = 7.375; ctx->Const.LineWidthGranularity = 0.125; + ctx->Const.LineWidthGranularityMS = 0.125; } else { ctx->Const.MaxLineWidth = 7.0; ctx->Const.MaxLineWidthAA = 7.0; + ctx->Const.MaxLineWidthMS = 7.0; ctx->Const.LineWidthGranularity = 0.5; + ctx->Const.LineWidthGranularityMS = 0.5; } /* For non-antialiased lines, we have to round the line width to the diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f550b0c..f0a5d64 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -575,7 +575,10 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api) consts->MaxLineWidth = MAX_LINE_WIDTH; consts->MinLineWidthAA = MIN_LINE_WIDTH; consts->MaxLineWidthAA = MAX_LINE_WIDTH; + consts->MinLineWidthMS = MIN_LINE_WIDTH; + consts->MaxLineWidthMS = MAX_LINE_WIDTH; consts->LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY; + consts->LineWidthGranularityMS = (GLfloat) LINE_WIDTH_GRANULARITY; consts->MaxClipPlanes = 6; consts->MaxLights = MAX_LIGHTS; consts->MaxShininess = 128.0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 2a93f29..a5bdf93 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3451,7 +3451,9 @@ struct gl_constants GLfloat PointSizeGranularity; GLfloat MinLineWidth, MaxLineWidth; /**< aliased */ GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ + GLfloat MinLineWidthMS, MaxLineWidthMS; /**< multisampled */ GLfloat LineWidthGranularity; + GLfloat LineWidthGranularityMS; GLuint MaxClipPlanes; GLuint MaxLights; diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index ca975aa..c364b07 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -226,10 +226,17 @@ static void update_raster_state( struct st_context *st ) ctx->Point.MaxSize); } - /* _NEW_LINE -*/ + /* _NEW_MULTISAMPLE */ + raster->multisample = _mesa_is_multisample_enabled(ctx); + + /* _NEW_LINE | _NEW_MULTISAMPLE */ raster->line_smooth = ctx->Line.SmoothFlag; - if (ctx->Line.SmoothFlag) { + if (raster->multisample) { + raster->line_width = CLAMP(ctx->Line.Width, + ctx->Const.MinLineWidthMS, + ctx->Const.MaxLineWidthMS); + } + else if (ctx->Line.SmoothFlag) { raster->line_width = CLAMP(ctx->Line.Width, ctx->Const.MinLineWidthAA, ctx->Const.MaxLineWidthAA); @@ -245,9 +252,6 @@ static void update_raster_state( struct st_context *st ) /* GL stipple factor is in [1,256], remap to [0, 255] here */ raster->line_stipple_factor = ctx->Line.StippleFactor - 1; - /* _NEW_MULTISAMPLE */ - raster->multisample = _mesa_is_multisample_enabled(ctx); - /* _NEW_MULTISAMPLE | _NEW_BUFFERS */ raster->force_persample_interp = !st->force_persample_in_shader && diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index f86a5a3..b8c3ece 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -121,6 +121,7 @@ void st_init_limits(struct pipe_screen *screen, _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_LINE_WIDTH)); c->MaxLineWidthAA = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_LINE_WIDTH_AA)); + c->MaxLineWidthMS = c->MaxLineWidthAA; c->MaxPointSize = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_POINT_WIDTH)); -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glsl: initialise pointer to NULL
Fixes uninitialised warning and covery defect. Cc: Kenneth Graunke--- src/compiler/glsl/lower_blend_equation_advanced.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/lower_blend_equation_advanced.cpp b/src/compiler/glsl/lower_blend_equation_advanced.cpp index 1c095dd..a998df1 100644 --- a/src/compiler/glsl/lower_blend_equation_advanced.cpp +++ b/src/compiler/glsl/lower_blend_equation_advanced.cpp @@ -438,7 +438,7 @@ deref_output(ir_variable *var) static ir_function_signature * get_main(gl_linked_shader *sh) { - ir_function_signature *sig; + ir_function_signature *sig = NULL; /* We can't use _mesa_get_main_function_signature() because we don't * have a symbol table at this point. Just go find main() by hand. */ -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] loader/dri3: Overhaul dri3_update_num_back
On 28/08/16 03:03 AM, Dieter Nützel wrote: > Am 25.08.2016 11:09, schrieb Michel Dänzer: >> On 24/08/16 06:35 AM, Eric Anholt wrote: >>> Michel Dänzerwrites: On 20/08/16 04:42 AM, Eric Anholt wrote: > Michel Dänzer writes: > >> From: Michel Dänzer >> >> Always use 3 buffers when flipping. With only 2 buffers, we have >> to wait >> for a flip to complete (which takes non-0 time even with asynchronous >> flips) before we can start working on the next frame. We were >> previously >> only using 2 buffers for flipping if the X server supports >> asynchronous >> flips, even when we're not using asynchronous flips. This could >> result >> in bad performance (the referenced bug report is an extreme case, >> where >> the inter-frame stalls were preventing the GPU from reaching its >> maximum >> clocks). >> >> I couldn't measure any performance boost using 4 buffers with >> flipping. >> Performance actually seemed to go down slightly, but that might have >> been just noise. >> >> Without flipping, a single back buffer is enough for swap interval 0, >> but we need to use 2 back buffers when the swap interval is non-0, >> otherwise we have to wait for the swap interval to pass before we can >> start working on the next frame. This condition was previously >> reversed. >> >> Cc: "12.0 11.2" >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97260 >> Signed-off-by: Michel Dänzer > > Reviewed-by: Eric Anholt Thanks. > > Hello Michel, > > found this _before_ your commit, but haven't had time, so... > > With this patch Blender at least 2.76b flicker horribly with > > 'User Preferences...' -> 'Window Draw Method: Automatic' > Switching to: > 'Window Draw Method: Tripple Buffer' > fix it. > > I'll add this to the related bug if you want. It's a blender bug: https://bugs.freedesktop.org/show_bug.cgi?id=97059 -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] android: fix build issues with genxml, isl
> While you're at it, I've got another build-breaking branch here: > > https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/blorp-vulkan > > It's almost reviewed so I'll be pushing soon. If you could provide a > squash-in, that would be great. > > --Jason Hi Jason, here it is, built marshmallow-x86 successfully after breaking commit "i965: Move blorp into src/intel/blorp" also attached to email, in case of gmail issues. This patch has to be applied on top of my former "[PATCH] android: intel: Flatten the makefile structure" KR Mauro >From 3ae8ea625b5cb091438de421d9762ea8bcb8e2bc Mon Sep 17 00:00:00 2001 From: Mauro RossiDate: Mon, 29 Aug 2016 03:08:02 +0200 Subject: [PATCH] android: i965: Move blorp into src/intel/blorp Port to android of commit "i965: Move blorp into src/intel/blorp" libmesa_blorp static library module is built by Android.blorp.mk the necessary dependencies and includes are declared and nir_opcodes.h generated header is included by using the macro generated-sources-dir-for which requires LOCAL_MODULE_CLASS --- src/intel/Android.blorp.mk | 47 src/intel/Android.mk | 1 + src/mesa/drivers/dri/i965/Android.mk | 1 + 3 files changed, 49 insertions(+) create mode 100644 src/intel/Android.blorp.mk diff --git a/src/intel/Android.blorp.mk b/src/intel/Android.blorp.mk new file mode 100644 index 000..268d5eb --- /dev/null +++ b/src/intel/Android.blorp.mk @@ -0,0 +1,47 @@ +# Copyright © 2016 Intel Corporation +# Copyright © 2016 Mauro Rossi +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +# --- +# Build libmesa_blorp +# --- + +include $(CLEAR_VARS) + +LOCAL_MODULE := libmesa_blorp + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +LOCAL_SRC_FILES := $(BLORP_FILES) + +LOCAL_C_INCLUDES := := \ + $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \ + $(MESA_TOP)/src/gallium/auxiliary \ + $(MESA_TOP)/src/gallium/include \ + $(MESA_TOP)/src/mapi \ + $(MESA_TOP)/src/mesa \ + $(MESA_TOP)/src/mesa/drivers/dri/i965 + +LOCAL_STATIC_LIBRARIES := libmesa_nir + +LOCAL_SHARED_LIBRARIES := libdrm_intel + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/src/intel/Android.mk b/src/intel/Android.mk index 114b111..0e9c29d 100644 --- a/src/intel/Android.mk +++ b/src/intel/Android.mk @@ -25,5 +25,6 @@ LOCAL_PATH := $(call my-dir) # Import variables include $(LOCAL_PATH)/Makefile.sources +include $(LOCAL_PATH)/Android.blorp.mk include $(LOCAL_PATH)/Android.genxml.mk include $(LOCAL_PATH)/Android.isl.mk diff --git a/src/mesa/drivers/dri/i965/Android.mk b/src/mesa/drivers/dri/i965/Android.mk index e6bcedb..32adb9a 100644 --- a/src/mesa/drivers/dri/i965/Android.mk +++ b/src/mesa/drivers/dri/i965/Android.mk @@ -178,6 +178,7 @@ LOCAL_SRC_FILES := \ LOCAL_WHOLE_STATIC_LIBRARIES := \ $(MESA_DRI_WHOLE_STATIC_LIBRARIES) \ $(I965_PERGEN_LIBS) \ + libmesa_blorp \ libmesa_isl LOCAL_SHARED_LIBRARIES := \ -- 2.7.4 From 3ae8ea625b5cb091438de421d9762ea8bcb8e2bc Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Mon, 29 Aug 2016 03:08:02 +0200 Subject: [PATCH] android: i965: Move blorp into src/intel/blorp Port to android of commit "i965: Move blorp into src/intel/blorp" libmesa_blorp static library module is built by Android.blorp.mk the necessary dependencies and includes are declared and nir_opcodes.h generated header is included by using the macro generated-sources-dir-for which requires LOCAL_MODULE_CLASS --- src/intel/Android.blorp.mk | 47 src/intel/Android.mk | 1 + src/mesa/drivers/dri/i965/Android.mk | 1 + 3 files changed, 49 insertions(+) create mode 100644 src/intel/Android.blorp.mk diff --git a/src/intel/Android.blorp.mk b/src/intel/Android.blorp.mk new file mode 100644
Re: [Mesa-dev] [PATCH 05/13] nouveau: Enable EXT_texture_env_dot3 on NV10 and NV20
On Sun, Aug 28, 2016 at 9:05 PM, Ian Romanickwrote: > On 08/28/2016 08:56 AM, Ilia Mirkin wrote: >> FWIW this fails for GL_DOT3_RGBA_EXT but works for GL_DOT3_RGB_EXT >> [according to glean's texCombine test]. (I suspect the existing > > Looking at the test results... any idea what it's actually doing? > Ignoring alpha and using 1.0? Using garbage? Other? We... it's unclear that the results can be trusted. There's an error in setting the RC_OUT_ALPHA value which means that the hardware is in some pseudo-inconsistent state, potentially. (The error is thrown when the graph engine processes the register write request from the command FIFO, in the form of an interrupt.) For a while I was getting 0,0,0,0.25, and then I started getting 1,1,1,0.25. The "real" answer was supposed to be 1,1,1,1: $ NOUVEAU_VIEUX=1 bin/glean -o -v -v -v -t +texCombine --quick texCombine: FAIL rgba8, db, z24, s8, win+pmap, id 33 expected 1, 1, 1, 1, got 0, 0, 0, 0.247059 in Single Texture Test Current combine state: Incoming Fragment RGBA = 0, 0.25, 0.5, 0.75 Texture Unit 0: GL_COMBINE_RGB_EXT = GL_DOT3_RGBA_EXT GL_COMBINE_ALPHA_EXT = GL_MODULATE GL_SOURCE0_RGB_EXT = GL_TEXTURE GL_SOURCE1_RGB_EXT = GL_TEXTURE GL_SOURCE2_RGB_EXT = GL_CONSTANT_EXT GL_SOURCE0_ALPHA_EXT = GL_TEXTURE GL_SOURCE1_ALPHA_EXT = GL_TEXTURE GL_SOURCE2_ALPHA_EXT = GL_CONSTANT_EXT GL_OPERAND0_RGB_EXT = GL_SRC_COLOR GL_OPERAND1_RGB_EXT = GL_SRC_COLOR GL_OPERAND2_RGB_EXT = GL_SRC_ALPHA GL_OPERAND0_ALPHA_EXT = GL_SRC_ALPHA GL_OPERAND1_ALPHA_EXT = GL_SRC_ALPHA GL_OPERAND2_ALPHA_EXT = GL_SRC_ALPHA GL_RGB_SCALE_EXT = 1 GL_ALPHA_SCALE = 1 Tex Env RGBA = 0.25, 0.5, 0.75, 1 Texture RGBA = 1, 0, 0.25, 0.5 To be super-clear - this is not your fault - it was already like that for the non-EXT version. But I'm hoping you could provide some hints as to why it's happening and/or how I could fix it. And I'm pretty sure the RGB_EXT thing works, because the texcombine test runs that first and there are no errors from it. -ilia > >> GL_DOT3_RGBA/RGB had a similar behavior.) I'm testing in a slightly >> unsupported environment - the NV25 graph class running on a NV34 >> (GeForce FX 5200), but I think it's legit. >> >> Unfortunately I know *nothing* about register combiners. Any chance >> you could explain what *should* be happening wrt their hookup? [Or >> even better, glance at the code.] >> >> As part of the test, I'm getting this error: >> >> nouveau :09:01.0: gr: intr 0010 [ERROR] nsource 0002 >> [DATA_ERROR] nstatus 0200 [BAD_ARGUMENT] ch 3 [glean[1436]] subc 7 >> class 0597 mthd 0aa0 data 20c0 >> >> Method 0aa0 is RC_OUT_ALPHA(0) >> [https://github.com/envytools/envytools/blob/master/rnndb/graph/nv20_3d.xml#L485], >> and data 20c0 decodes as >> >> $ lookup -a 25 -d SUBCHAN -- -v obj-class NV25_3D 0aa0 20c0 >> RC_OUT_ALPHA[0] => { CD_OUTPUT = ZERO | AB_OUTPUT = SPARE0 | >> SUM_OUTPUT = ZERO | AB_DOT_PRODUCT | BIAS = NONE | SCALE = NONE } >> >> Thanks, >> >> -ilia >> >> On Wed, Aug 24, 2016 at 2:57 PM, Ilia Mirkin wrote: >>> On Wed, Aug 24, 2016 at 2:46 PM, Ian Romanick wrote: From: Ian Romanick GL_DOT3_RGB_EXT and GL_DOT3_RGBA_EXT. are nearly identical to GL_DOT3_RGB and GL_DOT3_RGBA. The only difference is the _EXT versions do not apply the post-scale. Just smash logscale to 0 so that RC_OUT_SCALE_1 is always used. NOTE: I have not actually tested this. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/nouveau/nv10_context.c| 1 + src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 16 +++- src/mesa/drivers/dri/nouveau/nv20_context.c| 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index 00a9358..7a86ba2 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -448,6 +448,7 @@ nv10_context_create(struct nouveau_screen *screen, gl_api api, ctx->Extensions.ARB_texture_env_crossbar = true; ctx->Extensions.ARB_texture_env_combine = true; ctx->Extensions.ARB_texture_env_dot3 = true; + ctx->Extensions.EXT_texture_env_dot3 = true; ctx->Extensions.NV_fog_distance = true; ctx->Extensions.NV_texture_rectangle = true; if (ctx->Mesa_DXTn) { diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c index e78eac3..c6e4bb0 100644 ---
Re: [Mesa-dev] [Mesa-stable] [PATCH] main: add missing EXTRA_END in OES_sample_variables get check
Reviewed-by: Ian RomanickOn 08/28/2016 04:22 PM, Ilia Mirkin wrote: > Fixes: 3002296cb68 (mesa: add GL_OES_shader_multisample_interpolation support) > Signed-off-by: Ilia Mirkin > Cc: > --- > src/mesa/main/get.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c > index fb9a86f..810ccb9 100644 > --- a/src/mesa/main/get.c > +++ b/src/mesa/main/get.c > @@ -413,6 +413,7 @@ static const int > extra_ARB_gpu_shader5_or_oes_geometry_shader[] = { > static const int extra_ARB_gpu_shader5_or_OES_sample_variables[] = { > EXT(ARB_gpu_shader5), > EXT(OES_sample_variables), > + EXTRA_END > }; > > EXTRA_EXT(ARB_texture_cube_map); > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 05/13] nouveau: Enable EXT_texture_env_dot3 on NV10 and NV20
On 08/28/2016 08:56 AM, Ilia Mirkin wrote: > FWIW this fails for GL_DOT3_RGBA_EXT but works for GL_DOT3_RGB_EXT > [according to glean's texCombine test]. (I suspect the existing Looking at the test results... any idea what it's actually doing? Ignoring alpha and using 1.0? Using garbage? Other? > GL_DOT3_RGBA/RGB had a similar behavior.) I'm testing in a slightly > unsupported environment - the NV25 graph class running on a NV34 > (GeForce FX 5200), but I think it's legit. > > Unfortunately I know *nothing* about register combiners. Any chance > you could explain what *should* be happening wrt their hookup? [Or > even better, glance at the code.] > > As part of the test, I'm getting this error: > > nouveau :09:01.0: gr: intr 0010 [ERROR] nsource 0002 > [DATA_ERROR] nstatus 0200 [BAD_ARGUMENT] ch 3 [glean[1436]] subc 7 > class 0597 mthd 0aa0 data 20c0 > > Method 0aa0 is RC_OUT_ALPHA(0) > [https://github.com/envytools/envytools/blob/master/rnndb/graph/nv20_3d.xml#L485], > and data 20c0 decodes as > > $ lookup -a 25 -d SUBCHAN -- -v obj-class NV25_3D 0aa0 20c0 > RC_OUT_ALPHA[0] => { CD_OUTPUT = ZERO | AB_OUTPUT = SPARE0 | > SUM_OUTPUT = ZERO | AB_DOT_PRODUCT | BIAS = NONE | SCALE = NONE } > > Thanks, > > -ilia > > On Wed, Aug 24, 2016 at 2:57 PM, Ilia Mirkinwrote: >> On Wed, Aug 24, 2016 at 2:46 PM, Ian Romanick wrote: >>> From: Ian Romanick >>> >>> GL_DOT3_RGB_EXT and GL_DOT3_RGBA_EXT. are nearly identical to >>> GL_DOT3_RGB and GL_DOT3_RGBA. The only difference is the _EXT >>> versions do not apply the post-scale. Just smash logscale to 0 so >>> that RC_OUT_SCALE_1 is always used. >>> >>> NOTE: I have not actually tested this. >>> >>> Signed-off-by: Ian Romanick >>> --- >>> src/mesa/drivers/dri/nouveau/nv10_context.c| 1 + >>> src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 16 +++- >>> src/mesa/drivers/dri/nouveau/nv20_context.c| 1 + >>> 3 files changed, 17 insertions(+), 1 deletion(-) >>> >>> diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c >>> b/src/mesa/drivers/dri/nouveau/nv10_context.c >>> index 00a9358..7a86ba2 100644 >>> --- a/src/mesa/drivers/dri/nouveau/nv10_context.c >>> +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c >>> @@ -448,6 +448,7 @@ nv10_context_create(struct nouveau_screen *screen, >>> gl_api api, >>> ctx->Extensions.ARB_texture_env_crossbar = true; >>> ctx->Extensions.ARB_texture_env_combine = true; >>> ctx->Extensions.ARB_texture_env_dot3 = true; >>> + ctx->Extensions.EXT_texture_env_dot3 = true; >>> ctx->Extensions.NV_fog_distance = true; >>> ctx->Extensions.NV_texture_rectangle = true; >>> if (ctx->Mesa_DXTn) { >>> diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >>> b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >>> index e78eac3..c6e4bb0 100644 >>> --- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >>> +++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >>> @@ -276,6 +276,20 @@ setup_combiner(struct combiner_state *rc) >>> rc->out = RC_OUT_DOT_AB; >>> break; >>> >>> + case GL_DOT3_RGB_EXT: >>> + case GL_DOT3_RGBA_EXT: >>> + INPUT_ARG(rc, A, 0, NORMALIZE); >>> + INPUT_ARG(rc, B, 1, NORMALIZE); >>> + >>> + rc->out = RC_OUT_DOT_AB; >>> + >>> + /* The EXT version of the DOT3 extension does not support >>> the >>> +* scale factor, but the ARB version (and the version in >>> +* OpenGL 1.3) does. >>> +*/ >>> + rc->logscale = 0; >> >> rc->logscale comes from _CurrentCombine->ScaleShiftRGB/A -- I guess >> not a lot of harm in just forcing it here, but it'd be a little >> cleaner if that were not necessary. In the current state, though, this >> is >> >> Acked-by: Ilia Mirkin >> >>> + break; >>> + >>> default: >>> assert(0); >>> } >>> @@ -305,7 +319,7 @@ nv10_get_general_combiner(struct gl_context *ctx, int i, >>> if (ctx->Texture.Unit[i]._Current) { >>> INIT_COMBINER(RGB, ctx, _c, i); >>> >>> - if (rc_c.mode == GL_DOT3_RGBA) >>> + if (rc_c.mode == GL_DOT3_RGBA || rc_c.mode == >>> GL_DOT3_RGBA_EXT) >>> rc_a = rc_c; >>> else >>> INIT_COMBINER(A, ctx, _a, i); >>> diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c >>> b/src/mesa/drivers/dri/nouveau/nv20_context.c >>> index 14329a2..ec638c0 100644 >>> --- a/src/mesa/drivers/dri/nouveau/nv20_context.c >>> +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c >>> @@ -459,6 +459,7 @@ nv20_context_create(struct nouveau_screen *screen, >>> gl_api api, >>> ctx->Extensions.ARB_texture_env_crossbar = true; >>>
Re: [Mesa-dev] [PATCH 1/4] mesa: add scaffolding for OES/EXT_primitive_bounding_box
Series is Reviewed-by: Ian RomanickOn 08/28/2016 11:32 AM, Ilia Mirkin wrote: > Signed-off-by: Ilia Mirkin > --- > src/compiler/glsl/glsl_parser_extras.cpp | 2 ++ > src/compiler/glsl/glsl_parser_extras.h | 4 +++ > src/mapi/glapi/gen/es_EXT.xml| 49 > > src/mapi/glapi/gen/gl_genexec.py | 1 + > src/mesa/Makefile.sources| 2 ++ > src/mesa/main/bbox.c | 44 > src/mesa/main/bbox.h | 42 +++ > src/mesa/main/context.c | 2 ++ > src/mesa/main/extensions_table.h | 2 ++ > src/mesa/main/mtypes.h | 1 + > src/mesa/main/tests/dispatch_sanity.cpp | 3 ++ > src/mesa/main/version.c | 2 +- > 12 files changed, 153 insertions(+), 1 deletion(-) > create mode 100644 src/mesa/main/bbox.c > create mode 100644 src/mesa/main/bbox.h > > diff --git a/src/compiler/glsl/glsl_parser_extras.cpp > b/src/compiler/glsl/glsl_parser_extras.cpp > index f393278..2c7e015 100644 > --- a/src/compiler/glsl/glsl_parser_extras.cpp > +++ b/src/compiler/glsl/glsl_parser_extras.cpp > @@ -631,6 +631,7 @@ static const _mesa_glsl_extension > _mesa_glsl_supported_extensions[] = { > EXT(OES_geometry_point_size), > EXT(OES_geometry_shader), > EXT(OES_gpu_shader5), > + EXT(OES_primitive_bounding_box), > EXT(OES_sample_variables), > EXT(OES_shader_image_atomic), > EXT(OES_shader_io_blocks), > @@ -656,6 +657,7 @@ static const _mesa_glsl_extension > _mesa_glsl_supported_extensions[] = { > EXT(EXT_geometry_point_size), > EXT(EXT_geometry_shader), > EXT(EXT_gpu_shader5), > + EXT(EXT_primitive_bounding_box), > EXT(EXT_separate_shader_objects), > EXT(EXT_shader_framebuffer_fetch), > EXT(EXT_shader_integer_mix), > diff --git a/src/compiler/glsl/glsl_parser_extras.h > b/src/compiler/glsl/glsl_parser_extras.h > index 6d408ef..e146fe1 100644 > --- a/src/compiler/glsl/glsl_parser_extras.h > +++ b/src/compiler/glsl/glsl_parser_extras.h > @@ -672,6 +672,8 @@ struct _mesa_glsl_parse_state { > bool OES_geometry_shader_warn; > bool OES_gpu_shader5_enable; > bool OES_gpu_shader5_warn; > + bool OES_primitive_bounding_box_enable; > + bool OES_primitive_bounding_box_warn; > bool OES_sample_variables_enable; > bool OES_sample_variables_warn; > bool OES_shader_image_atomic_enable; > @@ -719,6 +721,8 @@ struct _mesa_glsl_parse_state { > bool EXT_geometry_shader_warn; > bool EXT_gpu_shader5_enable; > bool EXT_gpu_shader5_warn; > + bool EXT_primitive_bounding_box_enable; > + bool EXT_primitive_bounding_box_warn; > bool EXT_separate_shader_objects_enable; > bool EXT_separate_shader_objects_warn; > bool EXT_shader_framebuffer_fetch_enable; > diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml > index 6f2d643..b9fbec4 100644 > --- a/src/mapi/glapi/gen/es_EXT.xml > +++ b/src/mapi/glapi/gen/es_EXT.xml > @@ -939,6 +939,21 @@ > > > > + > + > + alias="PrimitiveBoundingBox"> > + > + > + > + > + > + > + > + > + > + > + > + > xmlns:xi="http://www.w3.org/2001/XInclude"/> > > > @@ -1094,6 +1109,21 @@ > > > > + > + > + alias="PrimitiveBoundingBox"> > + > + > + > + > + > + > + > + > + > + > + > + > > > > @@ -1312,4 +1342,23 @@ > > > > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > diff --git a/src/mapi/glapi/gen/gl_genexec.py > b/src/mapi/glapi/gen/gl_genexec.py > index 85e7990..183e6ff 100644 > --- a/src/mapi/glapi/gen/gl_genexec.py > +++ b/src/mapi/glapi/gen/gl_genexec.py > @@ -56,6 +56,7 @@ header = """/** > #include "main/blit.h" > #include "main/bufferobj.h" > #include "main/arrayobj.h" > +#include "main/bbox.h" > #include "main/buffers.h" > #include "main/clear.h" > #include "main/clip.h" > diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources > index 3622760..969f711 100644 > --- a/src/mesa/Makefile.sources > +++ b/src/mesa/Makefile.sources > @@ -26,6 +26,8 @@ MAIN_FILES = \ > main/attrib.h \ > main/barrier.c \ > main/barrier.h \ > + main/bbox.c \ > + main/bbox.h \ > main/blend.c \ > main/blend.h \ > main/blit.c \ > diff --git a/src/mesa/main/bbox.c b/src/mesa/main/bbox.c > new file mode 100644 > index 000..0ef5705 > --- /dev/null > +++ b/src/mesa/main/bbox.c > @@ -0,0 +1,44 @@ > +/* > + * Mesa 3-D graphics library > + * > + * Copyright (C) 2016 Ilia Mirkin. All Rights Reserved. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated
Re: [Mesa-dev] [PATCH 1/2] compiler: add printable values for cull distance varyings.
Patches 1&2 are, Reviewed-by: Edward O'CallaghanOn 08/29/2016 10:22 AM, Dave Airlie wrote: > From: Dave Airlie > > We need these for spir-v/nir shaders. > > Signed-off-by: Dave Airlie > --- > src/compiler/shader_enums.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c > index 00261d1..97c5b30 100644 > --- a/src/compiler/shader_enums.c > +++ b/src/compiler/shader_enums.c > @@ -151,6 +151,8 @@ gl_varying_slot_name(gl_varying_slot slot) >ENUM(VARYING_SLOT_CLIP_VERTEX), >ENUM(VARYING_SLOT_CLIP_DIST0), >ENUM(VARYING_SLOT_CLIP_DIST1), > + ENUM(VARYING_SLOT_CULL_DIST0), > + ENUM(VARYING_SLOT_CULL_DIST1), >ENUM(VARYING_SLOT_PRIMITIVE_ID), >ENUM(VARYING_SLOT_LAYER), >ENUM(VARYING_SLOT_VIEWPORT), > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] spirv: translate cull distance semantic.
From: Dave AirlieThis just translates to the correct cull distance slot. Signed-off-by: Dave Airlie --- src/compiler/spirv/vtn_variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 84664ad..1a07cc8 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -783,7 +783,7 @@ vtn_get_builtin_location(struct vtn_builder *b, *location = VARYING_SLOT_CLIP_DIST0; /* XXX CLIP_DIST1? */ break; case SpvBuiltInCullDistance: - /* XXX figure this out */ + *location = VARYING_SLOT_CULL_DIST0; break; case SpvBuiltInVertexIndex: *location = SYSTEM_VALUE_VERTEX_ID; -- 2.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] compiler: add printable values for cull distance varyings.
From: Dave AirlieWe need these for spir-v/nir shaders. Signed-off-by: Dave Airlie --- src/compiler/shader_enums.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c index 00261d1..97c5b30 100644 --- a/src/compiler/shader_enums.c +++ b/src/compiler/shader_enums.c @@ -151,6 +151,8 @@ gl_varying_slot_name(gl_varying_slot slot) ENUM(VARYING_SLOT_CLIP_VERTEX), ENUM(VARYING_SLOT_CLIP_DIST0), ENUM(VARYING_SLOT_CLIP_DIST1), + ENUM(VARYING_SLOT_CULL_DIST0), + ENUM(VARYING_SLOT_CULL_DIST1), ENUM(VARYING_SLOT_PRIMITIVE_ID), ENUM(VARYING_SLOT_LAYER), ENUM(VARYING_SLOT_VIEWPORT), -- 2.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeonsi: Don't use global variables for tess lds
Missing Signoff-by line but otherwise with that fix, Reviewed-By: Edward O'CallaghanOn 08/27/2016 05:52 AM, Tom Stellard wrote: > We were allocating global variables for the maximum LDS size > which made the compiler think we were using all of LDS, which > isn't the case. > --- > src/gallium/drivers/radeonsi/si_shader.c | 15 ++- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/src/gallium/drivers/radeonsi/si_shader.c > b/src/gallium/drivers/radeonsi/si_shader.c > index 64c367e..5d972cb 100644 > --- a/src/gallium/drivers/radeonsi/si_shader.c > +++ b/src/gallium/drivers/radeonsi/si_shader.c > @@ -5420,16 +5420,13 @@ static unsigned llvm_get_type_size(LLVMTypeRef type) > static void declare_tess_lds(struct si_shader_context *ctx) > { > struct gallivm_state *gallivm = >radeon_bld.gallivm; > - LLVMTypeRef i32 = ctx->radeon_bld.soa.bld_base.uint_bld.elem_type; > - unsigned lds_size = ctx->screen->b.chip_class >= CIK ? 65536 : 32768; > + struct lp_build_tgsi_context *bld_base = >radeon_bld.soa.bld_base; > + struct lp_build_context *uint = _base->uint_bld; > > - /* The actual size is computed outside of the shader to reduce > - * the number of shader variants. */ > - ctx->lds = > - LLVMAddGlobalInAddressSpace(gallivm->module, > - LLVMArrayType(i32, lds_size / 4), > - "tess_lds", > - LOCAL_ADDR_SPACE); > + unsigned lds_size = ctx->screen->b.chip_class >= CIK ? 65536 : 32768; > + ctx->lds = LLVMBuildIntToPtr(gallivm->builder, uint->zero, > + LLVMPointerType(LLVMArrayType(ctx->i32, lds_size / 4), > LOCAL_ADDR_SPACE), > + "tess_lds"); > } > > static void create_function(struct si_shader_context *ctx) > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] st/clover: Define __OPENCL_VERSION__ on the device side
On 08/29/2016 12:42 AM, Niels Ole Salscheider wrote: > This is required by the OpenCL standard. > > Signed-off-by: Niels Ole SalscheiderReviewed-by: Edward O'Callaghan > --- > src/gallium/state_trackers/clover/llvm/invocation.cpp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp > b/src/gallium/state_trackers/clover/llvm/invocation.cpp > index 5490d72..b5e8b52 100644 > --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp > @@ -153,6 +153,9 @@ namespace { >// Add libclc include >c.getPreprocessorOpts().Includes.push_back("clc/clc.h"); > > + // Add definition for the OpenCL version > + c.getPreprocessorOpts().addMacroDef("__OPENCL_VERSION__=110"); > + >// clc.h requires that this macro be defined: > > c.getPreprocessorOpts().addMacroDef("cl_clang_storage_class_specifiers"); >c.getPreprocessorOpts().addRemappedFile( > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: add EXT_texture_cube_map_array support
I had intended to do this, but I forgot. Thanks. Reviewed-by: Ian RomanickOn 08/27/2016 03:05 PM, Ilia Mirkin wrote: > This is identical to OES_texture_cube_map_array support. dEQP has tests > which use this extension. Also it is part of AEP. > > Signed-off-by: Ilia Mirkin > --- > src/compiler/glsl/builtin_functions.cpp | 2 ++ > src/compiler/glsl/builtin_types.cpp | 2 ++ > src/compiler/glsl/glsl_lexer.ll | 14 +++--- > src/compiler/glsl/glsl_parser_extras.cpp | 1 + > src/compiler/glsl/glsl_parser_extras.h | 3 +++ > src/mesa/main/extensions_table.h | 1 + > 6 files changed, 16 insertions(+), 7 deletions(-) > > diff --git a/src/compiler/glsl/builtin_functions.cpp > b/src/compiler/glsl/builtin_functions.cpp > index 64bf8d8..19ef99e 100644 > --- a/src/compiler/glsl/builtin_functions.cpp > +++ b/src/compiler/glsl/builtin_functions.cpp > @@ -249,6 +249,7 @@ gpu_shader5_or_OES_texture_cube_map_array(const > _mesa_glsl_parse_state *state) > { > return state->is_version(400, 320) || >state->ARB_gpu_shader5_enable || > + state->EXT_texture_cube_map_array_enable || >state->OES_texture_cube_map_array_enable; > } > > @@ -371,6 +372,7 @@ texture_gather_cube_map_array(const > _mesa_glsl_parse_state *state) > return state->is_version(400, 320) || >state->ARB_texture_gather_enable || >state->ARB_gpu_shader5_enable || > + state->EXT_texture_cube_map_array_enable || >state->OES_texture_cube_map_array_enable; > } > > diff --git a/src/compiler/glsl/builtin_types.cpp > b/src/compiler/glsl/builtin_types.cpp > index d40f785..000f811 100644 > --- a/src/compiler/glsl/builtin_types.cpp > +++ b/src/compiler/glsl/builtin_types.cpp > @@ -299,6 +299,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state > *state) > * is harmless. > */ > if (state->ARB_texture_cube_map_array_enable || > + state->EXT_texture_cube_map_array_enable || > state->OES_texture_cube_map_array_enable) { >add_type(symbols, glsl_type::samplerCubeArray_type); >add_type(symbols, glsl_type::samplerCubeArrayShadow_type); > @@ -339,6 +340,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state > *state) > } > > if (state->ARB_shader_image_load_store_enable || > + state->EXT_texture_cube_map_array_enable || > state->OES_texture_cube_map_array_enable) { >add_type(symbols, glsl_type::imageCubeArray_type); >add_type(symbols, glsl_type::iimageCubeArray_type); > diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll > index 2ed11ef..d5e5d4c 100644 > --- a/src/compiler/glsl/glsl_lexer.ll > +++ b/src/compiler/glsl/glsl_lexer.ll > @@ -348,10 +348,10 @@ isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, > yyextra->ARB_texture_mul > usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, > yyextra->ARB_texture_multisample_enable || > yyextra->OES_texture_storage_multisample_2d_array_enable, USAMPLER2DMSARRAY); > > /* keywords available with ARB_texture_cube_map_array_enable extension on > desktop GLSL */ > -samplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable, SAMPLERCUBEARRAY); > -isamplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); > -usamplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable, USAMPLERCUBEARRAY); > -samplerCubeArrayShadow KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); > +samplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable || > yyextra->EXT_texture_cube_map_array_enable, SAMPLERCUBEARRAY); > +isamplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable || > yyextra->EXT_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); > +usamplerCubeArray KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable || > yyextra->EXT_texture_cube_map_array_enable, USAMPLERCUBEARRAY); > +samplerCubeArrayShadow KEYWORD_WITH_ALT(400, 310, 400, 320, > yyextra->ARB_texture_cube_map_array_enable || > yyextra->OES_texture_cube_map_array_enable || > yyextra->EXT_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); > > samplerExternalOES { > if (yyextra->OES_EGL_image_external_enable) > @@ -372,7 +372,7 @@ imageCube KEYWORD_WITH_ALT(130,
Re: [Mesa-dev] [PATCH] mesa: remove OES_shader_io_blocks enable
Reviewed-by: Ian RomanickOn 08/27/2016 02:20 PM, Ilia Mirkin wrote: > This extension should just be available whenever ES 3.1 is available. > With the new extension verification infrastructure, it will only be > enable-able on a #version 310 es shader, rendering the original reason > for having a separate enable moot. > > Signed-off-by: Ilia Mirkin > --- > src/mesa/drivers/dri/i965/intel_extensions.c | 1 - > src/mesa/main/extensions_table.h | 4 ++-- > src/mesa/main/mtypes.h | 1 - > src/mesa/state_tracker/st_extensions.c | 6 -- > 4 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c > b/src/mesa/drivers/dri/i965/intel_extensions.c > index 48822b7..3ca30d0 100644 > --- a/src/mesa/drivers/dri/i965/intel_extensions.c > +++ b/src/mesa/drivers/dri/i965/intel_extensions.c > @@ -399,7 +399,6 @@ intelInitExtensions(struct gl_context *ctx) >ctx->Extensions.ARB_gpu_shader_fp64 = true; >ctx->Extensions.ARB_vertex_attrib_64bit = true; >ctx->Extensions.OES_geometry_shader = true; > - ctx->Extensions.OES_shader_io_blocks = true; >ctx->Extensions.OES_texture_cube_map_array = true; > } > > diff --git a/src/mesa/main/extensions_table.h > b/src/mesa/main/extensions_table.h > index f4d55c3..fd4eccb 100644 > --- a/src/mesa/main/extensions_table.h > +++ b/src/mesa/main/extensions_table.h > @@ -232,7 +232,7 @@ EXT(EXT_separate_shader_objects , dummy_true > EXT(EXT_separate_specular_color , dummy_true > , GLL, x , x , x , 1997) > EXT(EXT_shader_framebuffer_fetch, MESA_shader_framebuffer_fetch > , x , x , x , ES2, 2013) > EXT(EXT_shader_integer_mix , EXT_shader_integer_mix > , GLL, GLC, x , 30, 2013) > -EXT(EXT_shader_io_blocks, OES_shader_io_blocks > , x , x , x , 31, 2014) > +EXT(EXT_shader_io_blocks, dummy_true > , x , x , x , 31, 2014) > EXT(EXT_shader_samples_identical, EXT_shader_samples_identical > , GLL, GLC, x , 31, 2015) > EXT(EXT_shadow_funcs, ARB_shadow > , GLL, x , x , x , 2002) > EXT(EXT_stencil_two_side, EXT_stencil_two_side > , GLL, x , x , x , 2001) > @@ -359,7 +359,7 @@ EXT(OES_rgb8_rgba8 , dummy_true > EXT(OES_sample_shading , OES_sample_variables > , x , x , x , 30, 2014) > EXT(OES_sample_variables, OES_sample_variables > , x , x , x , 30, 2014) > EXT(OES_shader_image_atomic , ARB_shader_image_load_store > , x , x , x , 31, 2015) > -EXT(OES_shader_io_blocks, OES_shader_io_blocks > , x , x , x , 31, 2014) > +EXT(OES_shader_io_blocks, dummy_true > , x , x , x , 31, 2014) > EXT(OES_shader_multisample_interpolation, OES_sample_variables > , x , x , x , 30, 2014) > EXT(OES_single_precision, dummy_true > , x , x , ES1, x , 2003) > EXT(OES_standard_derivatives, OES_standard_derivatives > , x , x , x , ES2, 2005) > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h > index 3f83f84..8d8488f 100644 > --- a/src/mesa/main/mtypes.h > +++ b/src/mesa/main/mtypes.h > @@ -3944,7 +3944,6 @@ struct gl_extensions > GLboolean OES_copy_image; > GLboolean OES_primitive_bounding_box; > GLboolean OES_sample_variables; > - GLboolean OES_shader_io_blocks; > GLboolean OES_standard_derivatives; > GLboolean OES_texture_buffer; > GLboolean OES_texture_cube_map_array; > diff --git a/src/mesa/state_tracker/st_extensions.c > b/src/mesa/state_tracker/st_extensions.c > index 1f53bdf..f86a5a3 100644 > --- a/src/mesa/state_tracker/st_extensions.c > +++ b/src/mesa/state_tracker/st_extensions.c > @@ -1210,10 +1210,4 @@ void st_init_extensions(struct pipe_screen *screen, >extensions->ARB_texture_multisample && >extensions->ARB_gpu_shader5 && >extensions->EXT_shader_integer_mix; > - > - /* And if we have enough for ES 3.1, we can also expose > -* OES_shader_io_blocks, which is only hidden due to the compiler not > being > -* able to version-restrict things. > -*/ > - extensions->OES_shader_io_blocks = extensions->ARB_ES3_1_compatibility; > } > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] main: add missing EXTRA_END in OES_sample_variables get check
Fixes: 3002296cb68 (mesa: add GL_OES_shader_multisample_interpolation support) Signed-off-by: Ilia MirkinCc: --- src/mesa/main/get.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index fb9a86f..810ccb9 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -413,6 +413,7 @@ static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = { static const int extra_ARB_gpu_shader5_or_OES_sample_variables[] = { EXT(ARB_gpu_shader5), EXT(OES_sample_variables), + EXTRA_END }; EXTRA_EXT(ARB_texture_cube_map); -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] main: use KHR_blend_equation_advanced enable for ES 3.2 availability
Rb On Aug 28, 2016 11:40 AM, "Ilia Mirkin"wrote: > Signed-off-by: Ilia Mirkin > --- > src/mesa/main/version.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c > index 2aa96d5..cfc1638 100644 > --- a/src/mesa/main/version.c > +++ b/src/mesa/main/version.c > @@ -530,7 +530,7 @@ compute_version_es2(const struct gl_extensions > *extensions, > extensions->ARB_gpu_shader5 && > extensions->EXT_shader_integer_mix); > const bool ver_3_2 = (ver_3_1 && > - /*extensions->KHR_blend_equation_advanced*/ > false && > + extensions->KHR_blend_equation_advanced && > extensions->KHR_texture_compression_astc_ldr && > extensions->OES_copy_image && > extensions->ARB_draw_buffers_blend && > -- > 2.7.3 > > ___ > 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/3] mesa: Handle OES_texture_view tokens
This patch isn't right. These enum values are the same as the desktop version, so your new cases will never actually be used. On Mon, Aug 29, 2016 at 2:24 AM, Francesco Ansanelliwrote: > Signed-off-by: Francesco Ansanelli > --- > src/mesa/main/texparam.c | 48 ++ > > 1 file changed, 48 insertions(+) > > diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c > index bdd3fcb..4dd97b1 100644 > --- a/src/mesa/main/texparam.c > +++ b/src/mesa/main/texparam.c > @@ -1960,6 +1960,30 @@ get_tex_parameterfv(struct gl_context *ctx, > *params = (GLfloat) obj->NumLayers; > break; > > + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLfloat) obj->MinLevel; > + break; > + > + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLfloat) obj->NumLevels; > + break; > + > + case GL_TEXTURE_VIEW_MIN_LAYER_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLfloat) obj->MinLayer; > + break; > + > + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLfloat) obj->NumLayers; > + break; > + >case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: > if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_ > image_external) > goto invalid_pname; > @@ -2192,6 +2216,30 @@ get_tex_parameteriv(struct gl_context *ctx, > *params = (GLint) obj->NumLayers; > break; > > + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLint) obj->MinLevel; > + break; > + > + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLint) obj->NumLevels; > + break; > + > + case GL_TEXTURE_VIEW_MIN_LAYER_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLint) obj->MinLayer; > + break; > + > + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: > + if (!ctx->Extensions.OES_texture_view) > +goto invalid_pname; > + *params = (GLint) obj->NumLayers; > + break; > + >case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: > if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_ > image_external) > goto invalid_pname; > -- > 1.7.9.5 > > ___ > 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/2] clover: Use device cap to query pointer size instead of hardcoded 32bits
Jan Veselywrites: > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97513 > Signed-off-by: Jan Vesely Reviewed-by: Francisco Jerez > --- > src/gallium/state_trackers/clover/api/device.cpp | 2 +- > src/gallium/state_trackers/clover/core/device.cpp | 6 ++ > src/gallium/state_trackers/clover/core/device.hpp | 1 + > 3 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/state_trackers/clover/api/device.cpp > b/src/gallium/state_trackers/clover/api/device.cpp > index 11f21e9..f7bd61b 100644 > --- a/src/gallium/state_trackers/clover/api/device.cpp > +++ b/src/gallium/state_trackers/clover/api/device.cpp > @@ -158,7 +158,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param, >break; > > case CL_DEVICE_ADDRESS_BITS: > - buf.as_scalar() = 32; > + buf.as_scalar() = dev.address_bits(); >break; > > case CL_DEVICE_MAX_READ_IMAGE_ARGS: > diff --git a/src/gallium/state_trackers/clover/core/device.cpp > b/src/gallium/state_trackers/clover/core/device.cpp > index 39f39f4..8825f99 100644 > --- a/src/gallium/state_trackers/clover/core/device.cpp > +++ b/src/gallium/state_trackers/clover/core/device.cpp > @@ -193,6 +193,12 @@ device::subgroup_size() const { >PIPE_COMPUTE_CAP_SUBGROUP_SIZE)[0]; > } > > +cl_uint > +device::address_bits() const { > + return get_compute_param(pipe, ir_format(), > + PIPE_COMPUTE_CAP_ADDRESS_BITS)[0]; > +} > + > std::string > device::device_name() const { > return pipe->get_name(pipe); > diff --git a/src/gallium/state_trackers/clover/core/device.hpp > b/src/gallium/state_trackers/clover/core/device.hpp > index 2857847..6cf6c7f 100644 > --- a/src/gallium/state_trackers/clover/core/device.hpp > +++ b/src/gallium/state_trackers/clover/core/device.hpp > @@ -68,6 +68,7 @@ namespace clover { > >std::vector max_block_size() const; >cl_uint subgroup_size() const; > + cl_uint address_bits() const; >std::string device_name() const; >std::string vendor_name() const; >enum pipe_shader_ir ir_format() const; > -- > 2.7.4 signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] main: use KHR_blend_equation_advanced enable for ES 3.2 availability
Signed-off-by: Ilia Mirkin--- src/mesa/main/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 2aa96d5..cfc1638 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -530,7 +530,7 @@ compute_version_es2(const struct gl_extensions *extensions, extensions->ARB_gpu_shader5 && extensions->EXT_shader_integer_mix); const bool ver_3_2 = (ver_3_1 && - /*extensions->KHR_blend_equation_advanced*/ false && + extensions->KHR_blend_equation_advanced && extensions->KHR_texture_compression_astc_ldr && extensions->OES_copy_image && extensions->ARB_draw_buffers_blend && -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/4] mesa: add support for GL_PRIMITIVE_BOUNDING_BOX storage and query
Signed-off-by: Ilia Mirkin--- src/mesa/main/bbox.c | 19 +++ src/mesa/main/get.c | 28 src/mesa/main/get_hash_params.py | 3 +++ src/mesa/main/mtypes.h | 7 +++ 4 files changed, 57 insertions(+) diff --git a/src/mesa/main/bbox.c b/src/mesa/main/bbox.c index 0ef5705..2184330 100644 --- a/src/mesa/main/bbox.c +++ b/src/mesa/main/bbox.c @@ -36,9 +36,28 @@ _mesa_PrimitiveBoundingBox( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) { + GET_CURRENT_CONTEXT(ctx); + + ctx->PrimitiveBoundingBox[0] = minX; + ctx->PrimitiveBoundingBox[1] = minY; + ctx->PrimitiveBoundingBox[2] = minZ; + ctx->PrimitiveBoundingBox[3] = minW; + ctx->PrimitiveBoundingBox[4] = maxX; + ctx->PrimitiveBoundingBox[5] = maxY; + ctx->PrimitiveBoundingBox[6] = maxZ; + ctx->PrimitiveBoundingBox[7] = maxW; } void _mesa_init_bbox(struct gl_context *ctx) { + ctx->PrimitiveBoundingBox[0] = + ctx->PrimitiveBoundingBox[1] = + ctx->PrimitiveBoundingBox[2] = -1.0f; + + ctx->PrimitiveBoundingBox[3] = + ctx->PrimitiveBoundingBox[4] = + ctx->PrimitiveBoundingBox[5] = + ctx->PrimitiveBoundingBox[6] = + ctx->PrimitiveBoundingBox[7] = 1.0f; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 0aa9065..fb9a86f 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -111,6 +111,7 @@ enum value_type { TYPE_FLOAT_2, TYPE_FLOAT_3, TYPE_FLOAT_4, + TYPE_FLOAT_8, TYPE_FLOATN, TYPE_FLOATN_2, TYPE_FLOATN_3, @@ -218,6 +219,7 @@ union value { #define CONTEXT_FLOAT2(field) CONTEXT_FIELD(field, TYPE_FLOAT_2) #define CONTEXT_FLOAT3(field) CONTEXT_FIELD(field, TYPE_FLOAT_3) #define CONTEXT_FLOAT4(field) CONTEXT_FIELD(field, TYPE_FLOAT_4) +#define CONTEXT_FLOAT8(field) CONTEXT_FIELD(field, TYPE_FLOAT_8) #define CONTEXT_MATRIX(field) CONTEXT_FIELD(field, TYPE_MATRIX) #define CONTEXT_MATRIX_T(field) CONTEXT_FIELD(field, TYPE_MATRIX_T) @@ -466,6 +468,7 @@ EXTRA_EXT(NVX_gpu_memory_info); EXTRA_EXT(ARB_cull_distance); EXTRA_EXT(EXT_window_rectangles); EXTRA_EXT(KHR_blend_equation_advanced_coherent); +EXTRA_EXT(OES_primitive_bounding_box); static const int extra_ARB_color_buffer_float_or_glcore[] = { @@ -1390,6 +1393,11 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params) params[0] = INT_TO_BOOLEAN(d->offset); break; + case TYPE_FLOAT_8: + params[7] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[7]); + params[6] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[6]); + params[5] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[5]); + params[4] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[4]); case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]); @@ -1478,6 +1486,11 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params) params[0] = (GLfloat) d->offset; break; + case TYPE_FLOAT_8: + params[7] = ((GLfloat *) p)[7]; + params[6] = ((GLfloat *) p)[6]; + params[5] = ((GLfloat *) p)[5]; + params[4] = ((GLfloat *) p)[4]; case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = ((GLfloat *) p)[3]; @@ -1566,6 +1579,11 @@ _mesa_GetIntegerv(GLenum pname, GLint *params) params[0] = d->offset; break; + case TYPE_FLOAT_8: + params[7] = IROUND(((GLfloat *) p)[7]); + params[6] = IROUND(((GLfloat *) p)[6]); + params[5] = IROUND(((GLfloat *) p)[5]); + params[4] = IROUND(((GLfloat *) p)[4]); case TYPE_FLOAT_4: params[3] = IROUND(((GLfloat *) p)[3]); case TYPE_FLOAT_3: @@ -1660,6 +1678,11 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params) params[0] = d->offset; break; + case TYPE_FLOAT_8: + params[7] = IROUND64(((GLfloat *) p)[7]); + params[6] = IROUND64(((GLfloat *) p)[6]); + params[5] = IROUND64(((GLfloat *) p)[5]); + params[4] = IROUND64(((GLfloat *) p)[4]); case TYPE_FLOAT_4: params[3] = IROUND64(((GLfloat *) p)[3]); case TYPE_FLOAT_3: @@ -1754,6 +1777,11 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params) params[0] = d->offset; break; + case TYPE_FLOAT_8: + params[7] = ((GLfloat *) p)[7]; + params[6] = ((GLfloat *) p)[6]; + params[5] = ((GLfloat *) p)[5]; + params[4] = ((GLfloat *) p)[4]; case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = ((GLfloat *) p)[3]; diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 35af48b..a206c85 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -607,6 +607,9 @@ descriptor=[ # GL_ARB_texture_buffer_range [ "TEXTURE_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.TextureBufferOffsetAlignment), extra_ARB_texture_buffer_range" ], + +# GL_OES_primitive_bounding_box + [ "PRIMITIVE_BOUNDING_BOX_ARB", "CONTEXT_FLOAT8(PrimitiveBoundingBox), extra_OES_primitive_bounding_box" ],
[Mesa-dev] [PATCH 1/4] mesa: add scaffolding for OES/EXT_primitive_bounding_box
Signed-off-by: Ilia Mirkin--- src/compiler/glsl/glsl_parser_extras.cpp | 2 ++ src/compiler/glsl/glsl_parser_extras.h | 4 +++ src/mapi/glapi/gen/es_EXT.xml| 49 src/mapi/glapi/gen/gl_genexec.py | 1 + src/mesa/Makefile.sources| 2 ++ src/mesa/main/bbox.c | 44 src/mesa/main/bbox.h | 42 +++ src/mesa/main/context.c | 2 ++ src/mesa/main/extensions_table.h | 2 ++ src/mesa/main/mtypes.h | 1 + src/mesa/main/tests/dispatch_sanity.cpp | 3 ++ src/mesa/main/version.c | 2 +- 12 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 src/mesa/main/bbox.c create mode 100644 src/mesa/main/bbox.h diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index f393278..2c7e015 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -631,6 +631,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(OES_geometry_point_size), EXT(OES_geometry_shader), EXT(OES_gpu_shader5), + EXT(OES_primitive_bounding_box), EXT(OES_sample_variables), EXT(OES_shader_image_atomic), EXT(OES_shader_io_blocks), @@ -656,6 +657,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(EXT_geometry_point_size), EXT(EXT_geometry_shader), EXT(EXT_gpu_shader5), + EXT(EXT_primitive_bounding_box), EXT(EXT_separate_shader_objects), EXT(EXT_shader_framebuffer_fetch), EXT(EXT_shader_integer_mix), diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 6d408ef..e146fe1 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -672,6 +672,8 @@ struct _mesa_glsl_parse_state { bool OES_geometry_shader_warn; bool OES_gpu_shader5_enable; bool OES_gpu_shader5_warn; + bool OES_primitive_bounding_box_enable; + bool OES_primitive_bounding_box_warn; bool OES_sample_variables_enable; bool OES_sample_variables_warn; bool OES_shader_image_atomic_enable; @@ -719,6 +721,8 @@ struct _mesa_glsl_parse_state { bool EXT_geometry_shader_warn; bool EXT_gpu_shader5_enable; bool EXT_gpu_shader5_warn; + bool EXT_primitive_bounding_box_enable; + bool EXT_primitive_bounding_box_warn; bool EXT_separate_shader_objects_enable; bool EXT_separate_shader_objects_warn; bool EXT_shader_framebuffer_fetch_enable; diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 6f2d643..b9fbec4 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -939,6 +939,21 @@ + + + + + + + + + + + + + + + http://www.w3.org/2001/XInclude"/> @@ -1094,6 +1109,21 @@ + + + + + + + + + + + + + + + @@ -1312,4 +1342,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 85e7990..183e6ff 100644 --- a/src/mapi/glapi/gen/gl_genexec.py +++ b/src/mapi/glapi/gen/gl_genexec.py @@ -56,6 +56,7 @@ header = """/** #include "main/blit.h" #include "main/bufferobj.h" #include "main/arrayobj.h" +#include "main/bbox.h" #include "main/buffers.h" #include "main/clear.h" #include "main/clip.h" diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources index 3622760..969f711 100644 --- a/src/mesa/Makefile.sources +++ b/src/mesa/Makefile.sources @@ -26,6 +26,8 @@ MAIN_FILES = \ main/attrib.h \ main/barrier.c \ main/barrier.h \ + main/bbox.c \ + main/bbox.h \ main/blend.c \ main/blend.h \ main/blit.c \ diff --git a/src/mesa/main/bbox.c b/src/mesa/main/bbox.c new file mode 100644 index 000..0ef5705 --- /dev/null +++ b/src/mesa/main/bbox.c @@ -0,0 +1,44 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 2016 Ilia Mirkin. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS
[Mesa-dev] [PATCH 4/4] st/mesa: provide the null implementation of bounding box outputs in tcs
Until hardware appears (in a gallium driver) that can make use of the TCS-outputted gl_BoundingBox, we just request that the variable gets assigned as a regular patch variable. Signed-off-by: Ilia Mirkin--- Note that this passes all "*bounding_box*" tests in gles31-master.txt in dEQP on a nvc0 driver with geom and tess shaders enabled. docs/features.txt | 2 +- docs/relnotes/12.1.0.html | 1 + src/mesa/state_tracker/st_extensions.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/features.txt b/docs/features.txt index 4c755c6..34e7d74 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -262,7 +262,7 @@ GLES3.2, GLSL ES 3.2: GL_OES_draw_elements_base_vertex DONE (all drivers) GL_OES_geometry_shaderDONE (i965/gen8+, nvc0, radeonsi) GL_OES_gpu_shader5DONE (all drivers that support GL_ARB_gpu_shader5) - GL_OES_primitive_bounding_box not started + GL_OES_primitive_bounding_box DONE (nvc0, radeonsi) GL_OES_sample_shading DONE (i965, nvc0, r600, radeonsi) GL_OES_sample_variables DONE (i965, nvc0, r600, radeonsi) GL_OES_shader_image_atomicDONE (all drivers that support GL_ARB_shader_image_load_store) diff --git a/docs/relnotes/12.1.0.html b/docs/relnotes/12.1.0.html index f77ef91..fa0a21d 100644 --- a/docs/relnotes/12.1.0.html +++ b/docs/relnotes/12.1.0.html @@ -58,6 +58,7 @@ Note: some of the new features are only available with certain drivers. GL_KHR_texture_compression_astc_sliced_3d on i965 GL_OES_copy_image on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe GL_OES_geometry_shader on i965/gen8+, nvc0, radeonsi +GL_OES_primitive_bounding_box on nvc0, radeonsi GL_OES_texture_cube_map_array on i965/gen8+, nvc0, radeonsi diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index c7ec10c..a975885 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1224,4 +1224,7 @@ void st_init_extensions(struct pipe_screen *screen, extensions->ARB_ES3_1_compatibility && extensions->OES_geometry_shader && extensions->ARB_texture_cube_map_array; + + extensions->OES_primitive_bounding_box = extensions->ARB_ES3_1_compatibility; + consts->NoPrimitiveBoundingBoxOutput = true; } -- 2.7.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/4] glsl: add gl_BoundingBox and associated varying slots
Signed-off-by: Ilia Mirkin--- src/compiler/glsl/builtin_variables.cpp | 12 src/compiler/glsl/ir_set_program_inouts.cpp | 4 +++- src/compiler/shader_enums.c | 2 ++ src/compiler/shader_enums.h | 4 src/mesa/main/mtypes.h | 5 + src/mesa/program/prog_print.c | 4 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index d379de6..036261f 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -1045,6 +1045,18 @@ builtin_variable_generator::generate_tcs_special_vars() "gl_TessLevelOuter")->data.patch = 1; add_output(VARYING_SLOT_TESS_LEVEL_INNER, array(float_t, 2), "gl_TessLevelInner")->data.patch = 1; + /* XXX What to do if multiple are flipped on? */ + int bbox_slot = state->ctx->Const.NoPrimitiveBoundingBoxOutput ? -1 : + VARYING_SLOT_BOUNDING_BOX0; + if (state->EXT_primitive_bounding_box_enable) + add_output(bbox_slot, array(vec4_t, 2), "gl_BoundingBoxEXT") + ->data.patch = 1; + if (state->OES_primitive_bounding_box_enable) + add_output(bbox_slot, array(vec4_t, 2), "gl_BoundingBoxOES") + ->data.patch = 1; + if (state->is_version(0, 320) || state->ARB_ES3_2_compatibility_enable) + add_output(bbox_slot, array(vec4_t, 2), "gl_BoundingBox") + ->data.patch = 1; } diff --git a/src/compiler/glsl/ir_set_program_inouts.cpp b/src/compiler/glsl/ir_set_program_inouts.cpp index fcfbcd4..efb2831 100644 --- a/src/compiler/glsl/ir_set_program_inouts.cpp +++ b/src/compiler/glsl/ir_set_program_inouts.cpp @@ -99,7 +99,9 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len, int idx = var->data.location + var->data.index + offset + i; bool is_patch_generic = var->data.patch && idx != VARYING_SLOT_TESS_LEVEL_INNER && - idx != VARYING_SLOT_TESS_LEVEL_OUTER; + idx != VARYING_SLOT_TESS_LEVEL_OUTER && + idx != VARYING_SLOT_BOUNDING_BOX0 && + idx != VARYING_SLOT_BOUNDING_BOX1; GLbitfield64 bitfield; if (is_patch_generic) { diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c index 00261d1..729a358 100644 --- a/src/compiler/shader_enums.c +++ b/src/compiler/shader_enums.c @@ -158,6 +158,8 @@ gl_varying_slot_name(gl_varying_slot slot) ENUM(VARYING_SLOT_PNTC), ENUM(VARYING_SLOT_TESS_LEVEL_OUTER), ENUM(VARYING_SLOT_TESS_LEVEL_INNER), + ENUM(VARYING_SLOT_BOUNDING_BOX0), + ENUM(VARYING_SLOT_BOUNDING_BOX1), ENUM(VARYING_SLOT_VAR0), ENUM(VARYING_SLOT_VAR1), ENUM(VARYING_SLOT_VAR2), diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index e128b17..c3a62e0 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -214,6 +214,8 @@ typedef enum VARYING_SLOT_PNTC, /* FS only */ VARYING_SLOT_TESS_LEVEL_OUTER, /* Only appears as TCS output. */ VARYING_SLOT_TESS_LEVEL_INNER, /* Only appears as TCS output. */ + VARYING_SLOT_BOUNDING_BOX0, /* Only appears as TCS output. */ + VARYING_SLOT_BOUNDING_BOX1, /* Only appears as TCS output. */ VARYING_SLOT_VAR0, /* First generic varying slot */ /* the remaining are simply for the benefit of gl_varying_slot_name() * and not to be construed as an upper bound: @@ -294,6 +296,8 @@ const char *gl_varying_slot_name(gl_varying_slot slot); #define VARYING_BIT_PNTC BITFIELD64_BIT(VARYING_SLOT_PNTC) #define VARYING_BIT_TESS_LEVEL_OUTER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_OUTER) #define VARYING_BIT_TESS_LEVEL_INNER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_INNER) +#define VARYING_BIT_BOUNDING_BOX0 BITFIELD64_BIT(VARYING_SLOT_BOUNDING_BOX0) +#define VARYING_BIT_BOUNDING_BOX1 BITFIELD64_BIT(VARYING_SLOT_BOUNDING_BOX1) #define VARYING_BIT_VAR(V) BITFIELD64_BIT(VARYING_SLOT_VAR0 + (V)) /*@}*/ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f8f9c46..6b8dab6 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -110,6 +110,8 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot) case VARYING_SLOT_LAYER: case VARYING_SLOT_TESS_LEVEL_OUTER: case VARYING_SLOT_TESS_LEVEL_INNER: + case VARYING_SLOT_BOUNDING_BOX0: + case VARYING_SLOT_BOUNDING_BOX1: return GL_FALSE; default: return GL_TRUE; @@ -3788,6 +3790,9 @@ struct gl_constants bool LowerCsDerivedVariables;/**< Lower gl_GlobalInvocationID and * gl_LocalInvocationIndex based on * other builtin variables. */ + + /** GL_OES_primitive_bounding_box */ + bool NoPrimitiveBoundingBoxOutput; }; diff --git
[Mesa-dev] [PATCH v2 1/2] gallium: add cap to export device pointer size
v2: document the new cap Signed-off-by: Jan Vesely--- src/gallium/docs/source/screen.rst | 1 + src/gallium/drivers/ilo/ilo_screen.c | 6 ++ src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++ src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++ src/gallium/drivers/radeon/r600_pipe_common.c | 8 src/gallium/drivers/softpipe/sp_screen.c | 1 + src/gallium/include/pipe/p_defines.h | 1 + 7 files changed, 21 insertions(+) diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index c00d012..8c67604 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -496,6 +496,7 @@ pipe_screen::get_compute_param. non-zero means yes, zero means no. Value type: ``uint32_t`` * ``PIPE_COMPUTE_CAP_SUBGROUP_SIZE``: The size of a basic execution unit in threads. Also known as wavefront size, warp size or SIMD width. +* ``PIPE_COMPUTE_CAP_ADDRESS_BITS``: The default compute device address space size specified as an unsigned integer value in bits. .. _pipe_bind: diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index 050c03b..b9e5ad6 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -199,6 +199,7 @@ ilo_get_compute_param(struct pipe_screen *screen, uint32_t max_compute_units; uint32_t images_supported; uint32_t subgroup_size; + uint32_t address_bits; } val; const void *ptr; int size; @@ -266,6 +267,11 @@ ilo_get_compute_param(struct pipe_screen *screen, ptr = _input_size; size = sizeof(val.max_input_size); break; + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + val.address_bits = 32; + ptr = _bits; + size = sizeof(val.address_bits); + break; case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: val.max_mem_alloc_size = 1u << 31; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index d878547..57c0c2b 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -418,6 +418,8 @@ nv50_screen_get_compute_param(struct pipe_screen *pscreen, RET((uint32_t []) { screen->mp_count }); case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + RET((uint32_t []) { 32 }); default: return 0; } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index f139f66..e7bfbbe 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -479,6 +479,8 @@ nvc0_screen_get_compute_param(struct pipe_screen *pscreen, RET((uint32_t []) { screen->mp_count_compute }); case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + RET((uint32_t []) { 64 }); default: return 0; } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index b1da22f..1b15594 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -881,6 +881,14 @@ static int r600_get_compute_param(struct pipe_screen *screen, *max_threads_per_block = 256; } return sizeof(uint64_t); + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + if (ret) { + uint32_t *address_bits = ret; + address_bits[0] = 32; + if (rscreen->chip_class >= SI) + address_bits[0] = 64; + } + return 1 * sizeof(uint32_t); case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: if (ret) { diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index b742bde..cd4269f 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -521,6 +521,7 @@ softpipe_get_compute_param(struct pipe_screen *_screen, case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED: case PIPE_COMPUTE_CAP_SUBGROUP_SIZE: + case PIPE_COMPUTE_CAP_ADDRESS_BITS: break; } return 0; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 1e4d802..5361ed6 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -834,6 +834,7 @@ enum pipe_shader_ir */ enum pipe_compute_cap { + PIPE_COMPUTE_CAP_ADDRESS_BITS, PIPE_COMPUTE_CAP_IR_TARGET, PIPE_COMPUTE_CAP_GRID_DIMENSION, PIPE_COMPUTE_CAP_MAX_GRID_SIZE, -- 2.7.4 ___
Re: [Mesa-dev] [PATCH 1/2] gallium: add cap to export device pointer size
On Sun, 2016-08-28 at 13:16 -0400, Ilia Mirkin wrote: > Please add documentation for this new cap in > src/gallium/docs/source/screen.rst . What is this supposed to > represent btw? All G80+ GPUs operate in a 40-bit virtual address > space, but pre-fermi there's no ability to get a compute shader to > access more than a 32-bit window at a time (actually 16 such windows, > I believe, effectively getting it to 36-bit). Fermi+ GPUs are, > however, able to operate with both 32- and 64-bit pointers. (I forget > what happens if you use a 32-bit pointer... I think the upper word > might be pre-configured to a fixed value somewhere.) It's just to report correct answer to clGetDeviceInfo. specs say: "The default compute device address space size specified as an unsigned integer value in bits." passing pointer types is illegal and useless for CL1.x, although you might be able to to cheat around this by using cl_ulong/uint. (I haven't looked into details of cl 2.0 SVM) If the window needs to be selected outside of the pointer (config register, instruction immediate, ...) it's still 32bit pointer. I think EG/CM works in a similar way. Jan > > On Sun, Aug 28, 2016 at 1:12 PM, Jan Vesely> wrote: > > > > Signed-off-by: Jan Vesely > > --- > > src/gallium/drivers/ilo/ilo_screen.c | 6 ++ > > src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++ > > src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++ > > src/gallium/drivers/radeon/r600_pipe_common.c | 8 > > src/gallium/drivers/softpipe/sp_screen.c | 1 + > > src/gallium/include/pipe/p_defines.h | 1 + > > 6 files changed, 20 insertions(+) > > > > diff --git a/src/gallium/drivers/ilo/ilo_screen.c > > b/src/gallium/drivers/ilo/ilo_screen.c > > index 050c03b..b9e5ad6 100644 > > --- a/src/gallium/drivers/ilo/ilo_screen.c > > +++ b/src/gallium/drivers/ilo/ilo_screen.c > > @@ -199,6 +199,7 @@ ilo_get_compute_param(struct pipe_screen > > *screen, > > uint32_t max_compute_units; > > uint32_t images_supported; > > uint32_t subgroup_size; > > + uint32_t address_bits; > > } val; > > const void *ptr; > > int size; > > @@ -266,6 +267,11 @@ ilo_get_compute_param(struct pipe_screen > > *screen, > > ptr = _input_size; > > size = sizeof(val.max_input_size); > > break; > > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > > + val.address_bits = 32; > > + ptr = _bits; > > + size = sizeof(val.address_bits); > > + break; > > case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: > > val.max_mem_alloc_size = 1u << 31; > > > > diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c > > b/src/gallium/drivers/nouveau/nv50/nv50_screen.c > > index d878547..57c0c2b 100644 > > --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c > > +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c > > @@ -418,6 +418,8 @@ nv50_screen_get_compute_param(struct > > pipe_screen *pscreen, > > RET((uint32_t []) { screen->mp_count }); > > case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: > > RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ > > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > > + RET((uint32_t []) { 32 }); > > default: > > return 0; > > } > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > > b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > > index f139f66..e7bfbbe 100644 > > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > > @@ -479,6 +479,8 @@ nvc0_screen_get_compute_param(struct > > pipe_screen *pscreen, > > RET((uint32_t []) { screen->mp_count_compute }); > > case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: > > RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ > > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > > + RET((uint32_t []) { 64 }); > > default: > > return 0; > > } > > diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c > > b/src/gallium/drivers/radeon/r600_pipe_common.c > > index b1da22f..1b15594 100644 > > --- a/src/gallium/drivers/radeon/r600_pipe_common.c > > +++ b/src/gallium/drivers/radeon/r600_pipe_common.c > > @@ -881,6 +881,14 @@ static int r600_get_compute_param(struct > > pipe_screen *screen, > > *max_threads_per_block = 256; > > } > > return sizeof(uint64_t); > > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > > + if (ret) { > > + uint32_t *address_bits = ret; > > + address_bits[0] = 32; > > + if (rscreen->chip_class >= SI) > > + address_bits[0] = 64; > > + } > > + return 1 * sizeof(uint32_t); > > > > case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: > > if (ret) { > > diff --git a/src/gallium/drivers/softpipe/sp_screen.c > >
Re: [Mesa-dev] [PATCH] Update Khronos-supplied headers to r33100
On Sun, Aug 28, 2016 at 1:10 PM, Ilia Mirkinwrote: > As retrieved from opengl.org and khronos.org. Maintained the APPLE hack > in GL/glext.h manually. Added gl32.h. > > Signed-off-by: Ilia Mirkin > --- > > I want this for OES_viewport_array, as well as the likely upcoming support > for ES 3.2. > > Technically these headers don't matter for almost anything inside mesa, but > they're the ones we ship, so should probably keep them up to date. > > include/GL/glext.h |9 +- > include/GL/glxext.h| 36 +- > include/GL/wglext.h|6 +- > include/GLES2/gl2.h| 154 +++- > include/GLES2/gl2ext.h | 262 +- > include/GLES2/gl2platform.h|2 +- > include/GLES3/gl3.h| 280 +- > include/GLES3/gl31.h | 348 ++- > include/GLES3/gl32.h | 1825 + > src/mapi/glapi/registry/gl.xml | 1964 > > 10 files changed, 4677 insertions(+), 209 deletions(-) > create mode 100644 include/GLES3/gl32.h Oops, looks like this is too big for the list. You can see the full commit at https://github.com/imirkin/mesa/commit/99eb35e30b4727f9c9914e73dd0d9f79cb570570.patch ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] gallium: add cap to export device pointer size
Please add documentation for this new cap in src/gallium/docs/source/screen.rst . What is this supposed to represent btw? All G80+ GPUs operate in a 40-bit virtual address space, but pre-fermi there's no ability to get a compute shader to access more than a 32-bit window at a time (actually 16 such windows, I believe, effectively getting it to 36-bit). Fermi+ GPUs are, however, able to operate with both 32- and 64-bit pointers. (I forget what happens if you use a 32-bit pointer... I think the upper word might be pre-configured to a fixed value somewhere.) On Sun, Aug 28, 2016 at 1:12 PM, Jan Veselywrote: > Signed-off-by: Jan Vesely > --- > src/gallium/drivers/ilo/ilo_screen.c | 6 ++ > src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++ > src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++ > src/gallium/drivers/radeon/r600_pipe_common.c | 8 > src/gallium/drivers/softpipe/sp_screen.c | 1 + > src/gallium/include/pipe/p_defines.h | 1 + > 6 files changed, 20 insertions(+) > > diff --git a/src/gallium/drivers/ilo/ilo_screen.c > b/src/gallium/drivers/ilo/ilo_screen.c > index 050c03b..b9e5ad6 100644 > --- a/src/gallium/drivers/ilo/ilo_screen.c > +++ b/src/gallium/drivers/ilo/ilo_screen.c > @@ -199,6 +199,7 @@ ilo_get_compute_param(struct pipe_screen *screen, >uint32_t max_compute_units; >uint32_t images_supported; >uint32_t subgroup_size; > + uint32_t address_bits; > } val; > const void *ptr; > int size; > @@ -266,6 +267,11 @@ ilo_get_compute_param(struct pipe_screen *screen, >ptr = _input_size; >size = sizeof(val.max_input_size); >break; > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > + val.address_bits = 32; > + ptr = _bits; > + size = sizeof(val.address_bits); > + break; > case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: >val.max_mem_alloc_size = 1u << 31; > > diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c > b/src/gallium/drivers/nouveau/nv50/nv50_screen.c > index d878547..57c0c2b 100644 > --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c > +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c > @@ -418,6 +418,8 @@ nv50_screen_get_compute_param(struct pipe_screen *pscreen, >RET((uint32_t []) { screen->mp_count }); > case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: >RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > + RET((uint32_t []) { 32 }); > default: >return 0; > } > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > index f139f66..e7bfbbe 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c > @@ -479,6 +479,8 @@ nvc0_screen_get_compute_param(struct pipe_screen *pscreen, >RET((uint32_t []) { screen->mp_count_compute }); > case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: >RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > + RET((uint32_t []) { 64 }); > default: >return 0; > } > diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c > b/src/gallium/drivers/radeon/r600_pipe_common.c > index b1da22f..1b15594 100644 > --- a/src/gallium/drivers/radeon/r600_pipe_common.c > +++ b/src/gallium/drivers/radeon/r600_pipe_common.c > @@ -881,6 +881,14 @@ static int r600_get_compute_param(struct pipe_screen > *screen, > *max_threads_per_block = 256; > } > return sizeof(uint64_t); > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: > + if (ret) { > + uint32_t *address_bits = ret; > + address_bits[0] = 32; > + if (rscreen->chip_class >= SI) > + address_bits[0] = 64; > + } > + return 1 * sizeof(uint32_t); > > case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: > if (ret) { > diff --git a/src/gallium/drivers/softpipe/sp_screen.c > b/src/gallium/drivers/softpipe/sp_screen.c > index b742bde..cd4269f 100644 > --- a/src/gallium/drivers/softpipe/sp_screen.c > +++ b/src/gallium/drivers/softpipe/sp_screen.c > @@ -521,6 +521,7 @@ softpipe_get_compute_param(struct pipe_screen *_screen, > case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: > case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED: > case PIPE_COMPUTE_CAP_SUBGROUP_SIZE: > + case PIPE_COMPUTE_CAP_ADDRESS_BITS: >break; > } > return 0; > diff --git a/src/gallium/include/pipe/p_defines.h > b/src/gallium/include/pipe/p_defines.h > index 1e4d802..5361ed6 100644 > --- a/src/gallium/include/pipe/p_defines.h > +++ b/src/gallium/include/pipe/p_defines.h > @@ -834,6 +834,7 @@ enum pipe_shader_ir > */ > enum pipe_compute_cap > { > + PIPE_COMPUTE_CAP_ADDRESS_BITS, >
[Mesa-dev] [PATCH 2/2] clover: Use device cap to query pointer size instead of hardcoded 32bits
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97513 Signed-off-by: Jan Vesely--- src/gallium/state_trackers/clover/api/device.cpp | 2 +- src/gallium/state_trackers/clover/core/device.cpp | 6 ++ src/gallium/state_trackers/clover/core/device.hpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp index 11f21e9..f7bd61b 100644 --- a/src/gallium/state_trackers/clover/api/device.cpp +++ b/src/gallium/state_trackers/clover/api/device.cpp @@ -158,7 +158,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param, break; case CL_DEVICE_ADDRESS_BITS: - buf.as_scalar() = 32; + buf.as_scalar() = dev.address_bits(); break; case CL_DEVICE_MAX_READ_IMAGE_ARGS: diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index 39f39f4..8825f99 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -193,6 +193,12 @@ device::subgroup_size() const { PIPE_COMPUTE_CAP_SUBGROUP_SIZE)[0]; } +cl_uint +device::address_bits() const { + return get_compute_param(pipe, ir_format(), + PIPE_COMPUTE_CAP_ADDRESS_BITS)[0]; +} + std::string device::device_name() const { return pipe->get_name(pipe); diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp index 2857847..6cf6c7f 100644 --- a/src/gallium/state_trackers/clover/core/device.hpp +++ b/src/gallium/state_trackers/clover/core/device.hpp @@ -68,6 +68,7 @@ namespace clover { std::vector max_block_size() const; cl_uint subgroup_size() const; + cl_uint address_bits() const; std::string device_name() const; std::string vendor_name() const; enum pipe_shader_ir ir_format() const; -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] gallium: add cap to export device pointer size
Signed-off-by: Jan Vesely--- src/gallium/drivers/ilo/ilo_screen.c | 6 ++ src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++ src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++ src/gallium/drivers/radeon/r600_pipe_common.c | 8 src/gallium/drivers/softpipe/sp_screen.c | 1 + src/gallium/include/pipe/p_defines.h | 1 + 6 files changed, 20 insertions(+) diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index 050c03b..b9e5ad6 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -199,6 +199,7 @@ ilo_get_compute_param(struct pipe_screen *screen, uint32_t max_compute_units; uint32_t images_supported; uint32_t subgroup_size; + uint32_t address_bits; } val; const void *ptr; int size; @@ -266,6 +267,11 @@ ilo_get_compute_param(struct pipe_screen *screen, ptr = _input_size; size = sizeof(val.max_input_size); break; + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + val.address_bits = 32; + ptr = _bits; + size = sizeof(val.address_bits); + break; case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: val.max_mem_alloc_size = 1u << 31; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index d878547..57c0c2b 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -418,6 +418,8 @@ nv50_screen_get_compute_param(struct pipe_screen *pscreen, RET((uint32_t []) { screen->mp_count }); case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + RET((uint32_t []) { 32 }); default: return 0; } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index f139f66..e7bfbbe 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -479,6 +479,8 @@ nvc0_screen_get_compute_param(struct pipe_screen *pscreen, RET((uint32_t []) { screen->mp_count_compute }); case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */ + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + RET((uint32_t []) { 64 }); default: return 0; } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index b1da22f..1b15594 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -881,6 +881,14 @@ static int r600_get_compute_param(struct pipe_screen *screen, *max_threads_per_block = 256; } return sizeof(uint64_t); + case PIPE_COMPUTE_CAP_ADDRESS_BITS: + if (ret) { + uint32_t *address_bits = ret; + address_bits[0] = 32; + if (rscreen->chip_class >= SI) + address_bits[0] = 64; + } + return 1 * sizeof(uint32_t); case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: if (ret) { diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index b742bde..cd4269f 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -521,6 +521,7 @@ softpipe_get_compute_param(struct pipe_screen *_screen, case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED: case PIPE_COMPUTE_CAP_SUBGROUP_SIZE: + case PIPE_COMPUTE_CAP_ADDRESS_BITS: break; } return 0; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 1e4d802..5361ed6 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -834,6 +834,7 @@ enum pipe_shader_ir */ enum pipe_compute_cap { + PIPE_COMPUTE_CAP_ADDRESS_BITS, PIPE_COMPUTE_CAP_IR_TARGET, PIPE_COMPUTE_CAP_GRID_DIMENSION, PIPE_COMPUTE_CAP_MAX_GRID_SIZE, -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 05/13] nouveau: Enable EXT_texture_env_dot3 on NV10 and NV20
FWIW this fails for GL_DOT3_RGBA_EXT but works for GL_DOT3_RGB_EXT [according to glean's texCombine test]. (I suspect the existing GL_DOT3_RGBA/RGB had a similar behavior.) I'm testing in a slightly unsupported environment - the NV25 graph class running on a NV34 (GeForce FX 5200), but I think it's legit. Unfortunately I know *nothing* about register combiners. Any chance you could explain what *should* be happening wrt their hookup? [Or even better, glance at the code.] As part of the test, I'm getting this error: nouveau :09:01.0: gr: intr 0010 [ERROR] nsource 0002 [DATA_ERROR] nstatus 0200 [BAD_ARGUMENT] ch 3 [glean[1436]] subc 7 class 0597 mthd 0aa0 data 20c0 Method 0aa0 is RC_OUT_ALPHA(0) [https://github.com/envytools/envytools/blob/master/rnndb/graph/nv20_3d.xml#L485], and data 20c0 decodes as $ lookup -a 25 -d SUBCHAN -- -v obj-class NV25_3D 0aa0 20c0 RC_OUT_ALPHA[0] => { CD_OUTPUT = ZERO | AB_OUTPUT = SPARE0 | SUM_OUTPUT = ZERO | AB_DOT_PRODUCT | BIAS = NONE | SCALE = NONE } Thanks, -ilia On Wed, Aug 24, 2016 at 2:57 PM, Ilia Mirkinwrote: > On Wed, Aug 24, 2016 at 2:46 PM, Ian Romanick wrote: >> From: Ian Romanick >> >> GL_DOT3_RGB_EXT and GL_DOT3_RGBA_EXT. are nearly identical to >> GL_DOT3_RGB and GL_DOT3_RGBA. The only difference is the _EXT >> versions do not apply the post-scale. Just smash logscale to 0 so >> that RC_OUT_SCALE_1 is always used. >> >> NOTE: I have not actually tested this. >> >> Signed-off-by: Ian Romanick >> --- >> src/mesa/drivers/dri/nouveau/nv10_context.c| 1 + >> src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 16 +++- >> src/mesa/drivers/dri/nouveau/nv20_context.c| 1 + >> 3 files changed, 17 insertions(+), 1 deletion(-) >> >> diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c >> b/src/mesa/drivers/dri/nouveau/nv10_context.c >> index 00a9358..7a86ba2 100644 >> --- a/src/mesa/drivers/dri/nouveau/nv10_context.c >> +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c >> @@ -448,6 +448,7 @@ nv10_context_create(struct nouveau_screen *screen, >> gl_api api, >> ctx->Extensions.ARB_texture_env_crossbar = true; >> ctx->Extensions.ARB_texture_env_combine = true; >> ctx->Extensions.ARB_texture_env_dot3 = true; >> + ctx->Extensions.EXT_texture_env_dot3 = true; >> ctx->Extensions.NV_fog_distance = true; >> ctx->Extensions.NV_texture_rectangle = true; >> if (ctx->Mesa_DXTn) { >> diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >> b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >> index e78eac3..c6e4bb0 100644 >> --- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >> +++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c >> @@ -276,6 +276,20 @@ setup_combiner(struct combiner_state *rc) >> rc->out = RC_OUT_DOT_AB; >> break; >> >> + case GL_DOT3_RGB_EXT: >> + case GL_DOT3_RGBA_EXT: >> + INPUT_ARG(rc, A, 0, NORMALIZE); >> + INPUT_ARG(rc, B, 1, NORMALIZE); >> + >> + rc->out = RC_OUT_DOT_AB; >> + >> + /* The EXT version of the DOT3 extension does not support the >> +* scale factor, but the ARB version (and the version in >> +* OpenGL 1.3) does. >> +*/ >> + rc->logscale = 0; > > rc->logscale comes from _CurrentCombine->ScaleShiftRGB/A -- I guess > not a lot of harm in just forcing it here, but it'd be a little > cleaner if that were not necessary. In the current state, though, this > is > > Acked-by: Ilia Mirkin > >> + break; >> + >> default: >> assert(0); >> } >> @@ -305,7 +319,7 @@ nv10_get_general_combiner(struct gl_context *ctx, int i, >> if (ctx->Texture.Unit[i]._Current) { >> INIT_COMBINER(RGB, ctx, _c, i); >> >> - if (rc_c.mode == GL_DOT3_RGBA) >> + if (rc_c.mode == GL_DOT3_RGBA || rc_c.mode == >> GL_DOT3_RGBA_EXT) >> rc_a = rc_c; >> else >> INIT_COMBINER(A, ctx, _a, i); >> diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c >> b/src/mesa/drivers/dri/nouveau/nv20_context.c >> index 14329a2..ec638c0 100644 >> --- a/src/mesa/drivers/dri/nouveau/nv20_context.c >> +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c >> @@ -459,6 +459,7 @@ nv20_context_create(struct nouveau_screen *screen, >> gl_api api, >> ctx->Extensions.ARB_texture_env_crossbar = true; >> ctx->Extensions.ARB_texture_env_combine = true; >> ctx->Extensions.ARB_texture_env_dot3 = true; >> + ctx->Extensions.EXT_texture_env_dot3 = true; >> ctx->Extensions.NV_fog_distance = true; >> ctx->Extensions.NV_texture_rectangle = true; >> if (ctx->Mesa_DXTn) { >> -- >> 2.5.5 >> >>
[Mesa-dev] [Bug 97516] GLX_OML_swap_method not fully supported
https://bugs.freedesktop.org/show_bug.cgi?id=97516 Fabian Maurerchanged: What|Removed |Added CC||dark.shad...@web.de -- You are receiving this mail because: You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97516] GLX_OML_swap_method not fully supported
https://bugs.freedesktop.org/show_bug.cgi?id=97516 Bug ID: 97516 Summary: GLX_OML_swap_method not fully supported Product: Mesa Version: git Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Other Assignee: mesa-dev@lists.freedesktop.org Reporter: dark.shad...@web.de QA Contact: mesa-dev@lists.freedesktop.org Created attachment 126086 --> https://bugs.freedesktop.org/attachment.cgi?id=126086=edit Example code how I did the check, code taken from wine According to a check for extensions (glxinfo) the driver supports "GLX_OML_swap_method", but no pixelformat supports the values "GLX_SWAP_EXCHANGE_OML" or "GLX_SWAP_COPY_OML". This means pglXChooseFBConfig too fails if it is requested. Attached a snipped from the wine code to show how I checked for the support. Tell me if you need more information. Systeminfo: -Arch 64bit -Radeon R9 285 using amdgpu and opensource driver -OpenGL core profile version string: 4.3 (Core Profile) Mesa 12.1.0-devel -OpenGL version string: 3.0 Mesa 12.1.0-devel -mesa-git and mesa-libgl-git (84367.fb89551), libdrm-git (5912.b214b05) -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] st/clover: Define __OPENCL_VERSION__ on the device side
This is required by the OpenCL standard. Signed-off-by: Niels Ole Salscheider--- src/gallium/state_trackers/clover/llvm/invocation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 5490d72..b5e8b52 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -153,6 +153,9 @@ namespace { // Add libclc include c.getPreprocessorOpts().Includes.push_back("clc/clc.h"); + // Add definition for the OpenCL version + c.getPreprocessorOpts().addMacroDef("__OPENCL_VERSION__=110"); + // clc.h requires that this macro be defined: c.getPreprocessorOpts().addMacroDef("cl_clang_storage_class_specifiers"); c.getPreprocessorOpts().addRemappedFile( -- 2.9.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] GL_OES_texture_view RFC
The most important part of this exercise is to get tests up and running. Unfortunately there are none in dEQP. I think the simplest path would be to get the existing ones to build as gles31 as well as GL. Check the blend func extended tests to see how that is done. Overall feedback: - are you sure the oes tokens are different than desktop? Normally they're the same. - imho it's not really important to have the oes suffix in messages. On Aug 28, 2016 10:31 AM, "Francesco Ansanelli"wrote: > Hi list, > > I tried to figure how this extension could be hooked-up. > > I fear last patch is a bit an hack because we may want to add also the EXT > one... But this could be figured later. > > In any case, please review. > > Cheers, > Francesco > > ___ > 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
[Mesa-dev] GL_OES_texture_view RFC
Hi list, I tried to figure how this extension could be hooked-up. I fear last patch is a bit an hack because we may want to add also the EXT one... But this could be figured later. In any case, please review. Cheers, Francesco ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] mesa: implement GL_OES_texture_view
XXX still need to figure how to treat the removed VIEW_CLASS* and formats. Signed-off-by: Francesco Ansanelli--- src/mesa/main/textureview.c | 69 +-- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c index ed66c17..1a65923 100644 --- a/src/mesa/main/textureview.c +++ b/src/mesa/main/textureview.c @@ -387,8 +387,10 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) switch (origTarget) { case GL_TEXTURE_1D: case GL_TEXTURE_1D_ARRAY: - RETURN_IF_SUPPORTED(TEXTURE_1D); - RETURN_IF_SUPPORTED(TEXTURE_1D_ARRAY); + if (!_mesa_is_gles3(ctx)) { + RETURN_IF_SUPPORTED(TEXTURE_1D); + RETURN_IF_SUPPORTED(TEXTURE_1D_ARRAY); + } break; case GL_TEXTURE_2D: RETURN_IF_SUPPORTED(TEXTURE_2D); @@ -398,7 +400,8 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) RETURN_IF_SUPPORTED(TEXTURE_3D); break; case GL_TEXTURE_RECTANGLE: - RETURN_IF_SUPPORTED(TEXTURE_RECTANGLE); + if (!_mesa_is_gles3(ctx)) + RETURN_IF_SUPPORTED(TEXTURE_RECTANGLE); break; case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_2D_ARRAY: @@ -415,7 +418,8 @@ target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) break; } _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureView(illegal target=%s)", + "glTextureView%s(illegal target=%s)", + _mesa_is_gles3(ctx) ? "OES" : "", _mesa_enum_to_string(newTarget)); return false; } @@ -514,7 +518,7 @@ _mesa_set_texture_view_state(struct gl_context *ctx, } /** - * glTextureView (ARB_texture_view) + * glTextureView (ARB_texture_view / OES_texture_view) * If an error is found, record it with _mesa_error() * \return none. */ @@ -537,14 +541,15 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTextureView %d %s %d %s %d %d %d %d\n", + _mesa_debug(ctx, "glTextureView%s %d %s %d %s %d %d %d %d\n", + _mesa_is_gles3(ctx) ? "OES" : "", texture, _mesa_enum_to_string(target), origtexture, _mesa_enum_to_string(internalformat), minlevel, numlevels, minlayer, numlayers); if (origtexture == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(origtexture = %u)", - origtexture); + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView%s(origtexture = %u)", + _mesa_is_gles3(ctx) ? "OES" : "", origtexture); return; } @@ -555,8 +560,8 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, * is generated. */ if (!origTexObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(origtexture = %u)", - origtexture); + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView%s(origtexture = %u)", + _mesa_is_gles3(ctx) ? "OES" : "", origtexture); return; } @@ -565,13 +570,15 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, */ if (!origTexObj->Immutable) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureView(origtexture not immutable)"); + "glTextureView%s(origtexture not immutable)", + _mesa_is_gles3(ctx) ? "OES" : ""); return; } /* If is 0, INVALID_VALUE is generated. */ if (texture == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(texture = 0)"); + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView%s(texture = 0)", + _mesa_is_gles3(ctx) ? "OES" : ""); return; } @@ -581,7 +588,8 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, texObj = _mesa_lookup_texture(ctx, texture); if (texObj == NULL) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureView(texture = %u non-gen name)", texture); + "glTextureView%s(texture = %u non-gen name)", + _mesa_is_gles3(ctx) ? "OES" : "", texture); return; } @@ -590,7 +598,8 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, */ if (texObj->Target) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureView(texture = %u already bound)", texture); + "glTextureView%s(texture = %u already bound)", + _mesa_is_gles3(ctx) ? "OES" : "", texture); return; } @@ -607,16 +616,16 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, newViewMinLayer = origTexObj->MinLayer + minlayer; if (newViewMinLevel >= (origTexObj->MinLevel + origTexObj->NumLevels)) { _mesa_error(ctx, GL_INVALID_VALUE, -
[Mesa-dev] [PATCH 1/3] glapi: add GL_OES_texture_view
Signed-off-by: Francesco Ansanelli--- src/mapi/glapi/gen/es_EXT.xml | 15 +++ src/mesa/main/extensions_table.h|1 + src/mesa/main/mtypes.h |1 + src/mesa/main/tests/dispatch_sanity.cpp |3 +++ 4 files changed, 20 insertions(+) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 6f2d643..f2570e5 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -1112,6 +1112,21 @@ + + + + + + + + + + + + + + + https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] mesa: Handle OES_texture_view tokens
Signed-off-by: Francesco Ansanelli--- src/mesa/main/texparam.c | 48 ++ 1 file changed, 48 insertions(+) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index bdd3fcb..4dd97b1 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1960,6 +1960,30 @@ get_tex_parameterfv(struct gl_context *ctx, *params = (GLfloat) obj->NumLayers; break; + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLfloat) obj->MinLevel; + break; + + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLfloat) obj->NumLevels; + break; + + case GL_TEXTURE_VIEW_MIN_LAYER_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLfloat) obj->MinLayer; + break; + + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLfloat) obj->NumLayers; + break; + case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external) goto invalid_pname; @@ -2192,6 +2216,30 @@ get_tex_parameteriv(struct gl_context *ctx, *params = (GLint) obj->NumLayers; break; + case GL_TEXTURE_VIEW_MIN_LEVEL_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLint) obj->MinLevel; + break; + + case GL_TEXTURE_VIEW_NUM_LEVELS_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLint) obj->NumLevels; + break; + + case GL_TEXTURE_VIEW_MIN_LAYER_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLint) obj->MinLayer; + break; + + case GL_TEXTURE_VIEW_NUM_LAYERS_OES: + if (!ctx->Extensions.OES_texture_view) +goto invalid_pname; + *params = (GLint) obj->NumLayers; + break; + case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external) goto invalid_pname; -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] r600g: Avoid duplicated initialization of TGSI_OPCODE_DFMA
On Saturday, August 27, 2016, Jan Veselywrote: > On Sat, 2016-08-27 at 12:05 -0400, Rhys Kidd wrote: > > As reported by Clang, TGSI_OPCODE_DFMA (defined magic number 118) is > > currently initialized twice for Cayman and Evergreen. > > When Jan Vesely added double precision FMA opcode it did make sense > > to locate it immediately after TGSI_OPCODE_DMAD, although this is > > out of order. > > > > This change cleans up the prior magic number definition and ensures > > any later reordering of this struct will not create problems. > > > > Prior change was: > > > > commit 015e2e0fce3eea7884f8df275c2fadc35143a324 > > Author: Jan Vesely > > > Date: Sat Jul 2 16:14:54 2016 -0400 > > > > r600g: Add double precision FMA ops > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96782 > > Fixes: 54c4d525da7c7fc1e103d7a3e6db015abb132d5d ("r600g: Enable > > FMA on chips that support it") > > > > Signed-off-by: Jan Vesely > > > Tested-by: James Harvey > > > Signed-off-by: Marek Olšák > > > > > Signed-off-by: Rhys Kidd > > > So much for using magic numbers. > Reviewed-by: Jan Vesely > > > thanks, > Jan Thanks for reviewing Jan. > > > --- > > src/gallium/drivers/r600/r600_shader.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/src/gallium/drivers/r600/r600_shader.c > > b/src/gallium/drivers/r600/r600_shader.c > > index 64aacca..a39301f 100644 > > --- a/src/gallium/drivers/r600/r600_shader.c > > +++ b/src/gallium/drivers/r600/r600_shader.c > > @@ -9210,7 +9210,7 @@ static const struct > > r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = > > [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP, > > tgsi_unsupported}, > > [TGSI_OPCODE_KILL_IF] = { ALU_OP2_KILLGT, > > tgsi_kill}, /* conditional kill */ > > [TGSI_OPCODE_END] = { ALU_OP0_NOP, tgsi_end}, /* aka > > HALT */ > > - [118] = { ALU_OP0_NOP, > > tgsi_unsupported}, > > + /* Refer below for TGSI_OPCODE_DFMA */ > > [TGSI_OPCODE_F2I] = { ALU_OP1_FLT_TO_INT, tgsi_f2i}, > > [TGSI_OPCODE_IDIV] = { ALU_OP0_NOP, tgsi_idiv}, > > [TGSI_OPCODE_IMAX] = { ALU_OP2_MAX_INT, tgsi_op2}, > > @@ -9433,7 +9433,7 @@ static const struct > > r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = > > [TGSI_OPCODE_BREAKC]= { ALU_OP0_NOP, > > tgsi_unsupported}, > > [TGSI_OPCODE_KILL_IF] = { ALU_OP2_KILLGT, > > tgsi_kill}, /* conditional kill */ > > [TGSI_OPCODE_END] = { ALU_OP0_NOP, tgsi_end}, /* aka > > HALT */ > > - [118] = { ALU_OP0_NOP, > > tgsi_unsupported}, > > + /* Refer below for TGSI_OPCODE_DFMA */ > > [TGSI_OPCODE_F2I] = { ALU_OP1_FLT_TO_INT, tgsi_op2}, > > [TGSI_OPCODE_IDIV] = { ALU_OP0_NOP, tgsi_idiv}, > > [TGSI_OPCODE_IMAX] = { ALU_OP2_MAX_INT, tgsi_op2}, > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97260] [bisected] R9 290 low performance in Linux 4.7
https://bugs.freedesktop.org/show_bug.cgi?id=97260 --- Comment #34 from nadro-li...@wp.pl --- Sorry for a wrong information in my previous post, it looks like I had problems with 'forced vblank_mode to 1' in some apps. I downloaded fresh kernel 4.8rc3 from Ubuntu Kernel PPA + Mesa from Padoka PPA and all works fine at now. (I tested Shadow of Mordor and OpenMW with vblank_mode set to 0 and 1). -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97260] [bisected] R9 290 low performance in Linux 4.7
https://bugs.freedesktop.org/show_bug.cgi?id=97260 --- Comment #33 from nadro-li...@wp.pl --- I didn't test mesa with provided patch, but I always run games with vblank_mode=0 (most of the time via game menu options -> Vsync disabled) and DRI3 enabled, so it looks like provided mesa patch will not fix issues on my R9 380 (I still use kernel 4.8 RC1 without async page flip). I see big regression eg. in Shadow of Mordor and OpenMW, but IIRC Metro 2033 and LL (both Redux) were affected too. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev