[Mesa-dev] [PATCH] nv50: TXF already has integer arguments, don't try to convert from f32
Fixes the texelFetch piglit tests. Signed-off-by: Ilia Mirkin imir...@alum.mit.edu --- Verified a few things, but it's hard to check this fully. They array-texture piglit test fails if the conversion isn't done at all, and texelFetch starts passing if the conversion is removed. Dunno if this is the sort of thing worth sticking a stable tag on, so leaving it out. Feel free to add on commit. .../drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp| 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp index caaf09f..07f3a21 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp @@ -575,14 +575,16 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i) if (i-op == OP_TXB || i-op == OP_TXL) i-swapSources(dref, lod); - // array index must be converted to u32 if (i-tex.target.isArray()) { - Value *layer = i-getSrc(arg - 1); - LValue *src = new_LValue(func, FILE_GPR); - bld.mkCvt(OP_CVT, TYPE_U32, src, TYPE_F32, layer); - bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511)); - i-setSrc(arg - 1, src); - + if (i-op != OP_TXF) { + // array index must be converted to u32, but it's already an integer + // for TXF + Value *layer = i-getSrc(arg - 1); + LValue *src = new_LValue(func, FILE_GPR); + bld.mkCvt(OP_CVT, TYPE_U32, src, TYPE_F32, layer); + bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511)); + i-setSrc(arg - 1, src); + } if (i-tex.target.isCube()) { std::vectorValue * acube, a2d; int c; -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] gl_SampleMaskIn[] support
This adds another tiny piece of ARB_gpu_shader5. From the ARB_gpu_shader5 specification: The variable gl_SampleMaskIn is an array of integers, each holding a bitfield indicating the set of samples covered by the primitive generating the fragment during multisample rasterization. The array has ceil(s/32) elements, where s is the maximum number of color samples supported by the implementation. Bit n or word w in the bitfield is set if and only if the sample numbered w*32+n is considered covered for this fragment shader invocation. At this stage we statically set the size of the array to be 1, same as we do for ARB_sample_shading's gl_SampleMask[] output, since none of our supported hardware can do 32x MSAA. -- Chris ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] mesa: add SYSTEM_VALUE_SAMPLE_MASK_IN
Signed-off-by: Chris Forbes chr...@ijw.co.nz --- src/mesa/main/mtypes.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index db3cc3b..29e3e12 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -280,6 +280,7 @@ typedef enum */ #define SYSTEM_BIT_SAMPLE_ID BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_ID) #define SYSTEM_BIT_SAMPLE_POS BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_POS) +#define SYSTEM_BIT_SAMPLE_MASK_IN BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_MASK_IN) /** * Determine if the given gl_varying_slot appears in the fragment shader. @@ -1968,12 +1969,13 @@ typedef enum */ typedef enum { - SYSTEM_VALUE_FRONT_FACE, /** Fragment shader only (not done yet) */ - SYSTEM_VALUE_VERTEX_ID, /** Vertex shader only */ - SYSTEM_VALUE_INSTANCE_ID, /** Vertex shader only */ - SYSTEM_VALUE_SAMPLE_ID, /** Fragment shader only */ - SYSTEM_VALUE_SAMPLE_POS, /** Fragment shader only */ - SYSTEM_VALUE_MAX /** Number of values */ + SYSTEM_VALUE_FRONT_FACE, /** Fragment shader only (not done yet) */ + SYSTEM_VALUE_VERTEX_ID, /** Vertex shader only */ + SYSTEM_VALUE_INSTANCE_ID,/** Vertex shader only */ + SYSTEM_VALUE_SAMPLE_ID, /** Fragment shader only */ + SYSTEM_VALUE_SAMPLE_POS, /** Fragment shader only */ + SYSTEM_VALUE_SAMPLE_MASK_IN, /** Fragment shader only */ + SYSTEM_VALUE_MAX /** Number of values */ } gl_system_value; -- 1.8.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] glsl: add gl_SampleMaskIn[] builtin
Signed-off-by: Chris Forbes chr...@ijw.co.nz --- src/glsl/builtin_variables.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index d0e76e3..19643ec 100644 --- a/src/glsl/builtin_variables.cpp +++ b/src/glsl/builtin_variables.cpp @@ -858,6 +858,10 @@ builtin_variable_generator::generate_fs_special_vars() */ add_output(FRAG_RESULT_SAMPLE_MASK, array(int_t, 1), gl_SampleMask); } + + if (state-ARB_gpu_shader5_enable) { + add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), gl_SampleMaskIn); + } } -- 1.8.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] i965/fs: add support for gl_SampleMaskIn[]
Signed-off-by: Chris Forbes chr...@ijw.co.nz --- src/mesa/drivers/dri/i965/brw_fs.cpp | 22 +- src/mesa/drivers/dri/i965/brw_fs.h | 1 + src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 ++ src/mesa/drivers/dri/i965/brw_wm.h | 1 + src/mesa/drivers/dri/i965/gen7_wm_state.c| 4 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index dbd93e7..9063563 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1255,6 +1255,16 @@ fs_visitor::emit_sampleid_setup(ir_variable *ir) return reg; } +fs_reg * +fs_visitor::emit_samplemaskin_setup(ir_variable *ir) +{ + assert(brw-gen = 7); + this-current_annotation = compute gl_SampleMaskIn; + fs_reg *reg = new(this-mem_ctx) fs_reg(this, ir-type); + emit(MOV(*reg, fs_reg(retype(brw_vec8_grf(c-sample_mask_reg, 0), BRW_REGISTER_TYPE_D; + return reg; +} + fs_reg fs_visitor::fix_math_operand(fs_reg src) { @@ -3073,7 +3083,17 @@ fs_visitor::setup_payload_gen6() c-nr_payload_regs++; } - /* R32-: bary for 32-pixel. */ + /* R32: MSAA input coverage mask */ + if (fp-Base.SystemValuesRead SYSTEM_BIT_SAMPLE_MASK_IN) { + c-sample_mask_reg = c-nr_payload_regs; + c-nr_payload_regs++; + if (dispatch_width == 16) { + /* R33: input coverage mask if not 8-wide. */ + c-nr_payload_regs++; + } + } + + /* R34-: bary for 32-pixel. */ /* R58-59: interp W for 32-pixel. */ if (fp-Base.OutputsWritten BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index e516046..9bef07c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -340,6 +340,7 @@ public: fs_reg *emit_frontfacing_interpolation(ir_variable *ir); fs_reg *emit_samplepos_setup(ir_variable *ir); fs_reg *emit_sampleid_setup(ir_variable *ir); + fs_reg *emit_samplemaskin_setup(ir_variable *ir); fs_reg *emit_general_interpolation(ir_variable *ir); void emit_interpolation_setup_gen4(); void emit_interpolation_setup_gen6(); diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index a28dc6c..da75410 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -136,6 +136,8 @@ fs_visitor::visit(ir_variable *ir) reg = emit_samplepos_setup(ir); } else if (ir-location == SYSTEM_VALUE_SAMPLE_ID) { reg = emit_sampleid_setup(ir); + } else if (ir-location == SYSTEM_VALUE_SAMPLE_MASK_IN) { + reg = emit_samplemaskin_setup(ir); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 556b5ae..2ee126b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -88,6 +88,7 @@ struct brw_wm_compile { uint8_t aa_dest_stencil_reg; uint8_t dest_depth_reg; uint8_t sample_pos_reg; + uint8_t sample_mask_reg; uint8_t barycentric_coord_reg[BRW_WM_BARYCENTRIC_INTERP_MODE_COUNT]; uint8_t nr_payload_regs; GLuint source_depth_to_render_target:1; diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index abbc73c..b6561bb 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -112,6 +112,10 @@ upload_wm_state(struct brw_context *brw) dw2 |= GEN7_WM_MSDISPMODE_PERSAMPLE; } + if (fp-program.Base.SystemValuesRead SYSTEM_BIT_SAMPLE_MASK_IN) { + dw1 |= GEN7_WM_USES_INPUT_COVERAGE_MASK; + } + BEGIN_BATCH(3); OUT_BATCH(_3DSTATE_WM 16 | (3 - 2)); OUT_BATCH(dw1); -- 1.8.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 63132] [r600/llvm] src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:1887:lp_emit_declaration_soa: Assertion `idx 256' failed.
https://bugs.freedesktop.org/show_bug.cgi?id=63132 --- Comment #7 from Laurent carlier lordhea...@gmail.com --- pixmark_piano_benchmark works since http://cgit.freedesktop.org/mesa/mesa/commit/?id=797894036d1196805f02a2428fff82ece5855af7 It's slow but no more llvm errors -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] dri megadriver_stub: provide compatibility with older DRI loader
On 12/06/2013 07:11 PM, Jordan Justen wrote: To help the transition period when DRI loaders are being updated to support the newer __driDriverExtensions_foo mechanism, we populate __DRIextension with the extensions returned by __driDriverExtensions_foo during a library contructor constructor (typo) function. We find the driver foo's name by using the dladdr function which gives the path of the dynamic library's name that was being loaded. v2: * dladdr on public symbol __driDriverExtensions rather than static megadriver_stub_init. * Incorporate fixes and suggestions from Keith Signed-off-by: Jordan Justen jordan.l.jus...@intel.com Cc: 10.0 mesa-sta...@lists.freedesktop.org --- src/mesa/drivers/dri/common/megadriver_stub.c | 125 ++ 1 file changed, 125 insertions(+) diff --git a/src/mesa/drivers/dri/common/megadriver_stub.c b/src/mesa/drivers/dri/common/megadriver_stub.c index 6bf5d73..cb1078d 100644 --- a/src/mesa/drivers/dri/common/megadriver_stub.c +++ b/src/mesa/drivers/dri/common/megadriver_stub.c @@ -23,6 +23,131 @@ #include stdio.h #include dri_util.h +#include dlfcn.h +#include main/macros.h + +/* The extensions that allow the megadriver stub to provide backward + * compatibility for the older DRI driver loader require GNU + * extensions from dlfcn.h. + */ +#ifdef _GNU_SOURCE + +#define MEGADRIVER_STUB_MAX_EXTENSIONS 10 +#define LIB_PATH_SUFFIX _dri.so +#define LIB_PATH_SUFFIX_LENGTH (sizeof(LIB_PATH_SUFFIX)-1) + +/* This is the table of extensions that the loader will dlsym() for. + * + * Initially it is empty for the megadriver stub, but the library + * contructor may initialize it based on the name of the library that + * is being loaded. + */ +PUBLIC const __DRIextension * +__driDriverExtensions[MEGADRIVER_STUB_MAX_EXTENSIONS] = { + NULL +}; + +/** + * This is a contructor function for the megadriver dynamic library. constructor (typo) + * + * When the driver is dlopen'ed, this function will run. It will + * search for the name of the foo_dri.so file that was opened using + * the dladdr function. + * + * After finding foo's name, it will call __driDriverGetExtensions_foo + * and use the return to update __driDriverExtensions to enable + * compatibility with older DRI driver loaders. + */ +__attribute__((constructor)) static void +megadriver_stub_init(void) +{ + Dl_info info; + char *driver_name; + size_t name_len; + char *get_extensions_name; + const __DRIextension **(*get_extensions)(void); + const __DRIextension **extensions; + int i; + + /* Call dladdr on __driDriverExtensions. We are really +* interested in the returned info.dli_fname so we can +* figure out the path name of the library being loaded. +*/ + i = dladdr((void*) __driDriverExtensions, info); + if (i == 0) + return; + + /* Search for the last '/' character in the path. */ + driver_name = strrchr(info.dli_fname, '/'); + if (driver_name != NULL) { + /* Skip '/' character */ + driver_name++; + } else { + /* Try using the start of the path */ + driver_name = (char*) info.dli_fname; + } + + /* Make sure the path ends with _dri.so */ + name_len = strlen(driver_name); + i = name_len - LIB_PATH_SUFFIX_LENGTH; + if (i 0 || strcmp(driver_name + i, LIB_PATH_SUFFIX) != 0) + return; + + /* Duplicate the string so we can modify it. +* So far we've been using info.dli_fname. +*/ + driver_name = strdup(driver_name); + if (!driver_name) + return; + + /* The path ends with _dri.so. Chop this part of the +* string off. Then we'll have the driver's final name. +*/ + driver_name[i] = '\0'; + + i = asprintf(get_extensions_name, %s_%s, +__DRI_DRIVER_GET_EXTENSIONS, driver_name); + free(driver_name); + if (i == -1) + return; + + /* dlsym to get the driver's get extensions function. We +* don't have the dlopen handle, so we have to use +* RTLD_DEFAULT. It seems unlikely that the symbol will +* be found in another library, but this isn't optimal. +*/ + get_extensions = dlsym(RTLD_DEFAULT, get_extensions_name); + free(get_extensions_name); + if (!get_extensions) + return; + + /* Use the newer DRI loader entrypoint to find extensions. +* We will then expose these extensions via the older +* __driDriverExtensions symbol. +*/ + extensions = get_extensions(); + + /* Copy the extensions into the __driDriverExtensions array +* we declared. +*/ + for (i = 0; i ARRAY_SIZE(__driDriverExtensions); i++) { + __driDriverExtensions[i] = extensions[i]; + if (extensions[i] == NULL) + break; + } + + /* If the driver had more extensions than we reserved, then +* bail out. +*/ + if (i == ARRAY_SIZE(__driDriverExtensions)) { + __driDriverExtensions[0] =
Re: [Mesa-dev] [PATCH 3/3] i965/fs: add support for gl_SampleMaskIn[]
I'd appreciate an assert(brw-gen = 7); Will do, thanks for the review. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [Nouveau] [PATCH] nv50: enable MPEG-4 for NVA3+ (VP4.0)
On 07/12/2013 17:09, Ilia Mirkin wrote: On Sat, Dec 7, 2013 at 8:11 AM, Martin Peres martin.pe...@free.fr wrote: From: Martin Peres martin.pe...@labri.fr This patch is a follow-up from Ilia Mirkin's enable H.264 patch which solves the problem that prevented MPEG-4 videos to play correctly. Tested on an nva3. I might reword this as VP3/VP4 now work on all the codecs they are supposed to, remove old restriction. Tested on NVA3 Or something like that... Yeah, that would make more sense. Feel free to reword it before committing. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] nv50: enable MPEG-4 for NVA3+ (VP4.0)
From: Martin Peres martin.pe...@labri.fr This patch is a follow-up from Ilia Mirkin's enable H.264 patch which solves the problem that prevented MPEG-4 videos to play correctly. Tested on an nva3. Signed-off-by: Martin Peres martin.pe...@labri.fr Tested-by: Martin Peres martin.pe...@labri.fr Cc: 10.0 mesa-sta...@lists.freedesktop.org --- src/gallium/drivers/nouveau/nouveau_vp3_video.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c index 2f4196c..0843b78 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c @@ -362,11 +362,6 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_format codec = u_reduce_video_profile(profile); switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - /* For now, mpeg4 doesn't work on pre-nvc0. */ - if (chipset 0xc0) - return codec == PIPE_VIDEO_FORMAT_MPEG12 || -codec == PIPE_VIDEO_FORMAT_VC1 || -codec == PIPE_VIDEO_FORMAT_MPEG4_AVC; /* In the general case, this should work, once the pre-nvc0 problems are * resolved. */ return profile = PIPE_VIDEO_PROFILE_MPEG1 ( -- 1.8.4.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 69874] Automake throws a lot of [...] option 'subdir-objects' is disabled
https://bugs.freedesktop.org/show_bug.cgi?id=69874 Alexandre Demers alexandre.f.dem...@gmail.com changed: What|Removed |Added CC||alexandre.f.dem...@gmail.co ||m -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/5] radeonsi: fix binding the dummy pixel shader
On Fre, 2013-12-06 at 20:14 +0100, Marek Olšák wrote: On Fri, Dec 6, 2013 at 4:08 AM, Michel Dänzer mic...@daenzer.net wrote: On Don, 2013-12-05 at 18:43 +0100, Marek Olšák wrote: From: Marek Olšák marek.ol...@amd.com This fixes valgrind errors in glxinfo. [...] diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 9831fd8..b644d56 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2282,15 +2282,12 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state) if (rctx-vs_shader == sel) return; - rctx-vs_shader = sel; - - if (sel sel-current) { - si_pm4_bind_state(rctx, vs, sel-current-pm4); - rctx-b.streamout.stride_in_dw = sel-so.stride; - } else { - si_pm4_bind_state(rctx, vs, rctx-dummy_pixel_shader-pm4); - } + if (!sel || !sel-current) + return; + rctx-vs_shader = sel; + si_pm4_bind_state(rctx, vs, sel-current-pm4); + rctx-b.streamout.stride_in_dw = sel-so.stride; rctx-b.flags |= R600_CONTEXT_INV_SHADER_CACHE; } I've been wondering for a while if it's a good idea to use the dummy pixel shader as the vertex shader... It might be safer to just not draw anything if there is no vertex shader, or is there anything sensible a dummy vertex shader could do? The vertex shader must never be NULL when draw_vbo is called. The pixel shader can be NULL if pipe_rasterizer_state::rasterizer_discard is 1. That's the only reason we care about a NULL pixel shader. That's only true if you ignore shader compiler failures. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 63132] [r600/llvm] src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:1887:lp_emit_declaration_soa: Assertion `idx 256' failed.
https://bugs.freedesktop.org/show_bug.cgi?id=63132 Michel Dänzer mic...@daenzer.net changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Assignee|mesa-dev@lists.freedesktop. |dri-devel@lists.freedesktop |org |.org Component|Mesa core |Drivers/Gallium/r600 --- Comment #8 from Michel Dänzer mic...@daenzer.net --- Fixed for r600g/radeonsi in Mesa Git master: commit 797894036d1196805f02a2428fff82ece5855af7 Author: Vincent Lejeune v...@ovi.com Date: Mon Dec 2 00:54:44 2013 +0100 r600/llvm: Allow arbitrary amount of temps in tgsi to llvm -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev