Re: [Mesa-dev] [PATCH V3 1/2] i965/blorp: Add bilinear filtering of samples for multisample scaled blits
On 26 June 2013 19:41, Anuj Phogat anuj.pho...@gmail.com wrote: On Tue, Jun 25, 2013 at 10:27 AM, Paul Berry stereotype...@gmail.com wrote: On 19 June 2013 19:45, Anuj Phogat anuj.pho...@gmail.com wrote: Current implementation of ext_framebuffer_multisample_blit_scaled in i965/blorp uses nearest filtering for multisample scaled blits. Using nearest filtering produces blocky artifacts and negates the benefits of MSAA. That is the reason why extension was not enabled on i965. This patch implements the bilinear filtering of samples in blorp engine. Images generated with this patch are free from blocky artifacts and show big improvement in visual quality. Observed no piglit and gles3 regressions. V3: - Algorithm used for filtering assumes a rectangular grid of samples roughly corresponding to sample locations. - Test the boundary conditions on the edges of texture. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com Thanks for all your effort on this, Anuj. I think we have an algorithm that's going to get us good quality. I have a number of minor comments below, but I think the basic approach is good. --- src/mesa/drivers/dri/i965/brw_blorp.h| 11 ++ src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 257 +-- 2 files changed, 258 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h index ffc27cc..0a15b89 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.h +++ b/src/mesa/drivers/dri/i965/brw_blorp.h @@ -319,6 +319,17 @@ struct brw_blorp_blit_prog_key * than one sample per pixel. */ bool persample_msaa_dispatch; + + /* True for scaled blitting. */ + bool blit_scaled; + + /* Source rectangle dimensions. Used to test boundary conditions in shader +* program. +*/ + float src_x0; + float src_y0; + float src_x1; + float src_y1; Two comments about this: (1) Rather than clamp to the boundary of the source rectangle, I have a minor preference for clamping to the boundary of the source image. This is what I've observed in nVidia's blitter, and it's what's implemented in Mesa's meta path for scaled blits. Also, it would have the benefit of simplifying some of the logic below, since the lower clamp will always be 0. (2) We can't put these numbers in the program key, since they're going to change frequently, and changing the program key causes the program to be recompiled. They need to go in push constants, like we do for the destination rectangle coordinates and the multipliers and offsets. }; class brw_blorp_blit_params : public brw_blorp_params diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 8694128..e99c9df 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -622,7 +622,8 @@ private: void kill_if_outside_dst_rect(); void translate_dst_to_src(); void single_to_blend(); - void manual_blend(unsigned num_samples); + void manual_blend_average(unsigned num_samples); + void manual_blend_linear(unsigned num_samples); Minor nit pick: can we call this function manual_blend_bilinear()? linear is such a generic term that it's hard to guess what it does, but bilinear makes it obvious. void sample(struct brw_reg dst); void texel_fetch(struct brw_reg dst); void mcs_fetch(); @@ -676,6 +677,16 @@ private: */ struct brw_reg y_coords[2]; + /* X, Y coordinates of the pixel from which we need to fetch the specific +* sample. These are used for multisample scaled blitting. +*/ + struct brw_reg x_sample_coords; + struct brw_reg y_sample_coords; + + /* Store the values to use to interpolate in x and y directions */ + struct brw_reg x_lerp; + struct brw_reg y_lerp; + I had trouble guessing what the lerp variables are used for. How about something like this instead? /* Fractional parts of the x and y coordinates, used as bilinear interpolation coefficients */ struct brw_reg x_frac; struct brw_reg y_frac; /* Which element of x_coords and y_coords is currently in use. */ int xy_coord_index; @@ -814,15 +825,17 @@ brw_blorp_blit_program::compile(struct brw_context *brw, * that we want to texture from. Exception: if we are blending, then S is * irrelevant, because we are going to fetch all samples. */ - if (key-blend) { + if (key-blend !key-blit_scaled) { if (brw-intel.gen == 6) { /* Gen6 hardware an automatically blend using the SAMPLE message */ single_to_blend(); sample(texture_data[0]); } else { /* Gen7+ hardware doesn't automaticaly blend. */ -
Re: [Mesa-dev] [PATCH] r300g: add program name check for BSD
On Wed, Jun 26, 2013 at 09:49:08AM -0600, Brian Paul wrote: On 06/26/2013 01:11 AM, Jonathan Gray wrote: program_invocation_short_name is glibc specific. Provide an alternative using getprogname(), which can be found on *BSD and OS X. Signed-off-by: Jonathan Gray j...@jsg.id.au --- src/gallium/drivers/r300/r300_chipset.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git src/gallium/drivers/r300/r300_chipset.c src/gallium/drivers/r300/r300_chipset.c index 11061ed..7f51ccb 100644 --- src/gallium/drivers/r300/r300_chipset.c +++ src/gallium/drivers/r300/r300_chipset.c @@ -30,6 +30,14 @@ #include stdio.h #include errno.h +#undef GET_PROGRAM_NAME +#ifdef __GLIBC__ +# define GET_PROGRAM_NAME() program_invocation_short_name +#else /* *BSD and OS X */ +# include stdlib.h +# define GET_PROGRAM_NAME() getprogname() +#endif + /* r300_chipset: A file all to itself for deducing the various properties of * Radeons. */ @@ -49,7 +57,7 @@ static void r300_apply_hyperz_blacklist(struct r300_capabilities* caps) int i; for (i = 0; i Elements(list); i++) { -if (strcmp(list[i], program_invocation_short_name) == 0) { +if (strcmp(list[i], GET_PROGRAM_NAME()) == 0) { caps-zmask_ram = 0; caps-hiz_ram = 0; break; I think a new gallium utility function for this would be helpful. In fact I've already implemented something like this for our windows driver. Does the attached code look OK you to guys? looks good to me, a few nitpicks inline -Brian #include pipe/p_config.h #include os/os_process.h #include util/u_memory.h #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) # include windows.h #endif it isn't clear if stdlib.h is included here? /** * Return the name of the current process. * \param procname returns the process name, always 0-terminated * \param size size of the procname buffer * \return TRUE or FALSE for success, failure */ boolean os_get_process_name(char *procname, size_t size) { const char *name; #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) char szProcessPath[MAX_PATH]; char *lpProcessName; char *lpProcessExt; GetModuleFileNameA(NULL, szProcessPath, Elements(szProcessPath)); lpProcessName = strrchr(szProcessPath, '\\'); lpProcessName = lpProcessName ? lpProcessName + 1 : szProcessPath; lpProcessExt = strrchr(lpProcessName, '.'); if (lpProcessExt) { *lpProcessExt = '\0'; } name = lpProcessName; #elif defined(__GLIBC__) name = program_invocation_short_name; #else /* *BSD and OS X */ name = getprogname(); #endif assert(procname); assert(size 0); if (name) { strncpy(procname, name, size); procname[size - 1] = 0; and this should be '\0' not 0, though the end result is the same return TRUE; } else { return FALSE; } } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] r300g: Fix make check
From: Tom Stellard thomas.stell...@amd.com --- src/gallium/drivers/r300/Makefile.am |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am index 49264c4..f82b8e9 100644 --- a/src/gallium/drivers/r300/Makefile.am +++ b/src/gallium/drivers/r300/Makefile.am @@ -17,7 +17,8 @@ AM_CFLAGS = \ $(LLVM_CFLAGS) \ $(RADEON_CFLAGS) -r300_compiler_tests_LDADD = libr300.la +r300_compiler_tests_LDADD = libr300.la libr300-helper.la \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la r300_compiler_tests_CPPFLAGS = \ -I$(top_srcdir)/src/gallium/drivers/r300/compiler r300_compiler_tests_SOURCES = \ -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] r300g/compiler: Prevent the regalloc from swizzling texture operands v2
From: Tom Stellard thomas.stell...@amd.com https://bugs.freedesktop.org/show_bug.cgi?id=63520 NOTE: This is a candidate for the stable branches. --- src/gallium/drivers/r300/Makefile.am |1 + .../drivers/r300/compiler/radeon_pair_regalloc.c |8 ++ .../r300/compiler/tests/r300_compiler_tests.c |1 + .../tests/radeon_compiler_regalloc_tests.c | 99 .../compiler/tests/regalloc_tex_1d_swizzle.test| 15 +++ 5 files changed, 124 insertions(+), 0 deletions(-) create mode 100644 src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c create mode 100644 src/gallium/drivers/r300/compiler/tests/regalloc_tex_1d_swizzle.test diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am index f82b8e9..ab8b4e8 100644 --- a/src/gallium/drivers/r300/Makefile.am +++ b/src/gallium/drivers/r300/Makefile.am @@ -24,6 +24,7 @@ r300_compiler_tests_CPPFLAGS = \ r300_compiler_tests_SOURCES = \ $(testdir)/r300_compiler_tests.c \ $(testdir)/radeon_compiler_optimize_tests.c \ + $(testdir)/radeon_compiler_regalloc_tests.c \ $(testdir)/radeon_compiler_util_tests.c \ $(testdir)/rc_test_helpers.c \ $(testdir)/unit_test.c diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c index 6442e0d..1970a34 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c @@ -383,6 +383,14 @@ static enum rc_reg_class variable_get_class( RC_INSTRUCTION_PAIR ) { old_swizzle = r.U.P.Arg-Swizzle; } else { + /* Source operands of TEX +* instructions can't be +* swizzle on r300/r400 GPUs. +*/ + if (!variable-C-is_r500) { + can_change_writemask = 0; + break; + } old_swizzle = r.U.I.Src-Swizzle; } new_swizzle = rc_adjust_channels( diff --git a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c index cc4725a..0406ae6 100644 --- a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c +++ b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c @@ -33,6 +33,7 @@ int main(int argc, char ** argv) { unsigned pass = 1; pass = radeon_compiler_optimize_run_tests(); + pass = radeon_compiler_regalloc_run_tests(); pass = radeon_compiler_util_run_tests(); if (pass) { diff --git a/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c new file mode 100644 index 000..eeb6b07 --- /dev/null +++ b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c @@ -0,0 +1,99 @@ +/* + * Copyright 2013 Advanced Micro Devices, Inc. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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. + * + * Author: Tom Stellard thomas.stell...@amd.com + */ + +#include radeon_program_pair.h + +#include r300_compiler_tests.h +#include rc_test_helpers.h +#include unit_test.h + +static void dummy_allocate_hw_inputs( + struct r300_fragment_program_compiler * c, + void (*allocate)(void * data, unsigned input, unsigned hwreg), +
[Mesa-dev] [PATCH 2/3] r300g/compiler/tests: Add an assembly parser
From: Tom Stellard thomas.stell...@amd.com The assembly parser can be used to load r300 assembly dumps and run them through any of the r300 compiler passes. --- .../r300/compiler/tests/omod_two_writers.test |5 + .../r300/compiler/tests/r300_compiler_tests.h |1 + .../tests/radeon_compiler_optimize_tests.c | 33 +++-- .../drivers/r300/compiler/tests/rc_test_helpers.c | 162 +++- .../drivers/r300/compiler/tests/rc_test_helpers.h | 16 ++ 5 files changed, 201 insertions(+), 16 deletions(-) create mode 100644 src/gallium/drivers/r300/compiler/tests/omod_two_writers.test diff --git a/src/gallium/drivers/r300/compiler/tests/omod_two_writers.test b/src/gallium/drivers/r300/compiler/tests/omod_two_writers.test new file mode 100644 index 000..fb16bb0 --- /dev/null +++ b/src/gallium/drivers/r300/compiler/tests/omod_two_writers.test @@ -0,0 +1,5 @@ +RCP temp[0].x, const[1].x___; +RCP temp[0].y, const[1]._y__; +MUL temp[1].xy, const[0].xx__, temp[0].xy__; +MOV output[0].xy, temp[1].xy; += diff --git a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.h b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.h index 266addf..d40834a 100644 --- a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.h +++ b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.h @@ -26,4 +26,5 @@ */ unsigned radeon_compiler_optimize_run_tests(void); +unsigned radeon_compiler_regalloc_run_tests(void); unsigned radeon_compiler_util_run_tests(void); diff --git a/src/gallium/drivers/r300/compiler/tests/radeon_compiler_optimize_tests.c b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_optimize_tests.c index 600228e..819fb6c 100644 --- a/src/gallium/drivers/r300/compiler/tests/radeon_compiler_optimize_tests.c +++ b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_optimize_tests.c @@ -30,30 +30,42 @@ #include rc_test_helpers.h #include unit_test.h +static unsigned test_rc_optimize( + struct test_result * result, + struct radeon_compiler * c, + const char * filename) +{ + struct rc_test_file test_file; + + test_begin(result); + + if (!load_program(c, test_file, filename)) { + fprintf(stderr, Failed to load program\n); + return 0; + } + + rc_optimize(c, NULL); + return 1; +} + static void test_runner_rc_optimize(struct test_result * result) { + unsigned pass = 1; struct radeon_compiler c; struct rc_instruction *inst; struct rc_instruction *inst_list[3]; unsigned inst_count = 0; float const0[4] = {2.0f, 0.0f, 0.0f, 0.0f}; - unsigned pass = 1; - test_begin(result); init_compiler(c, RC_FRAGMENT_PROGRAM, 1, 0); rc_constants_add_immediate_vec4(c.Program.Constants, const0); - add_instruction(c, RCP temp[0].x, const[1].x___;); - add_instruction(c, RCP temp[0].y, const[1]._y__;); - add_instruction(c, MUL temp[1].xy, const[0].xx__, temp[0].xy__;); - add_instruction(c, MOV output[0].xy, temp[1].xy; ); - - rc_optimize(c, NULL); + test_rc_optimize(result, c, omod_two_writers.test); for(inst = c.Program.Instructions.Next; - inst != c.Program.Instructions; - inst = inst-Next, inst_count++) { + inst != c.Program.Instructions; + inst = inst-Next, inst_count++) { inst_list[inst_count] = inst; } @@ -62,6 +74,7 @@ static void test_runner_rc_optimize(struct test_result * result) inst_list[2]-U.I.Opcode != RC_OPCODE_MOV) { pass = 0; } + test_check(result, pass); } diff --git a/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c b/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c index 551fe05..9a171d3 100644 --- a/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c +++ b/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c @@ -42,6 +42,7 @@ #include radeon_program.h #include radeon_regalloc.h #include radeon_swizzle.h +#include util/u_math.h #include rc_test_helpers.h @@ -61,6 +62,17 @@ struct match_info { int Length; }; +static int is_whitespace(const char *str) +{ + regex_t regex; + int err; + if (regcomp(regex, ^[ \n]+$, REG_EXTENDED)) { + fprintf(stderr, Failed to compile whitespace regex\n); + return 0; + } + return regexec(regex, str, 0, NULL, 0) != REG_NOMATCH; +} + static int match_length(regmatch_t * matches, int index) { return matches[index].rm_eo - matches[index].rm_so; @@ -124,7 +136,7 @@ int init_rc_normal_src( unsigned int src_index, const char * src_str) { - const char * regex_str = (-*)(\\|*)([[:lower:]]*)\\[([[:digit:]])\\](\\.*[[:lower:]-]*); + const char * regex_str =
[Mesa-dev] [Bug 66236] New: glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 Priority: medium Bug ID: 66236 Keywords: regression Assignee: mesa-dev@lists.freedesktop.org Summary: glext.h:4609: error: redefinition of typedef 'GLclampf' Severity: blocker Classification: Unclassified OS: All Reporter: v...@freedesktop.org Hardware: x86-64 (AMD64) Status: NEW Version: git Component: Mesa core Product: Mesa mesa: 9f3cfe6aafc210906be85de065afff7503ef240b (master) $ make [...] CC glapi_dispatch.lo In file included from ../../../include/GL/gl.h:2085, from ../../../src/mapi/glapi/glapi_priv.h:38, from glapi_dispatch.c:40: ../../../include/GL/glext.h:4609: error: redefinition of typedef 'GLclampf' ../../../include/GL/gl.h:161: error: previous declaration of 'GLclampf' was here ../../../include/GL/glext.h:5805: error: redefinition of typedef 'GLclampd' ../../../include/GL/gl.h:163: error: previous declaration of 'GLclampd' was here -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 Vinson Lee v...@freedesktop.org changed: What|Removed |Added CC||bri...@vmware.com --- Comment #1 from Vinson Lee v...@freedesktop.org --- 9a14e412d6de93349a490a9c4534b52c3b524ee9 is the first bad commit commit 9a14e412d6de93349a490a9c4534b52c3b524ee9 Author: Brian Paul bri...@vmware.com Date: Tue Jun 25 10:35:37 2013 -0600 mesa: update glext.h to version 20130624 In glapi_priv.h we always need the typedef for the GLclampx type since GL_OES_fixed_point is now defined in glext.h but the GLclampx type is not. GLclampx is not used by anything in glext.h but we need it for GL ES dispatch. This is a huge patch because the structure of the file has been changed. The following extensions are new, however: GL_AMD_interleaved_elements GL_AMD_shader_trinary_minmax GL_IBM_static_data GL_INTEL_map_texture GL_NV_compute_program5 GL_NV_deep_texture3D GL_NV_draw_texture GL_NV_shader_atomic_counters GL_NV_shader_storage_buffer_object GL_NVX_conditional_render GL_OES_byte_coordinates GL_OES_compressed_paletted_texture GL_OES_fixed_point GL_OES_query_matrix GL_OES_single_precision And these extensions were removed: GL_FfdMaskSGIX GL_INGR_palette_buffer GL_INTEL_texture_scissor GL_SGI_depth_pass_instrument GL_SGIX_fog_scale GL_SGIX_impact_pixel_texture GL_SGIX_texture_select Reviewed-by: José Fonseca jfons...@vmware.com :04 04 21827509bbb51f9f51169a637e659e120753c009 ebe3c6da083247c5663c496e587cf8034002f702 Minclude :04 04 9eae521b2b281ad6c23419d096afa1190f7604a3 b7658dcb83cfb7923a5621fb04a8bfab6e8e0833 Msrc -- 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 1/4] mesa: move declarations before code
- Original Message - On 06/26/2013 04:33 PM, Eric Anholt wrote: Brian Paul bri...@vmware.com writes: On 06/26/2013 03:56 PM, Ian Romanick wrote: Patches 1 and 4 are Reviewed-by: Ian Romanick ian.d.roman...@intel.com For patch 3, I share Jose's concern. I would very much like to see this happen in directories containing code that will be built with MSVC. Yeah, sounds good, but off-hand I have no idea how to do this per-directory. Just add it to AM_CPPFLAGS in the directories you care about. But only if the compiler is gcc, right? Something like: if GCC AM_CPPFLAGS += -Wdeclaration-after-statement endif It's probably easier to have a conditional variable in the top .am / .ac, # Additional flags for cross-platform code if GCC XPLATFORM_CFLAGS = -Wdeclaration-after-statement endif and then unconditionally add on each selected directory AM_CPPFLAGS += $(XPLATFORM_CFLAGS) As this will mean less places to modify if we want to modify the flags, or which compilers they apply. Jose ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] llvmpipe: handle offset_clamp
- Original Message - From: Roland Scheidegger srol...@vmware.com This was just ignored (unless for some reason like unfilled polys draw was handling this). Patch looks good. I'm not convinced of that code, putting the float for the clamp in the key isn't really a good idea. Indeed. Then again the other floats for depth bias are already in there too anyway (should probably have a jit_context for the setup function), so this is just a quick fix. Also, the minimum resolvable depth difference used isn't really right as it should be calculated according to the z values of the current primitive and not be a constant (of course, this only makes a difference for float depth buffers), at least for d3d10, so depth biasing is still not quite right. --- src/gallium/drivers/llvmpipe/lp_state_setup.c | 20 +++- src/gallium/drivers/llvmpipe/lp_state_setup.h |3 ++- src/gallium/drivers/llvmpipe/lp_state_surface.c |2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index ed68b98..2988bed 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -244,6 +244,7 @@ lp_do_offset_tri(struct gallivm_state *gallivm, { LLVMBuilderRef b = gallivm-builder; struct lp_build_context bld; + struct lp_build_context flt_scalar_bld; LLVMValueRef zoffset, mult; LLVMValueRef z0_new, z1_new, z2_new; LLVMValueRef dzdxdzdy, dzdx, dzdy, dzxyz20, dyzzx01, dyzzx01_dzxyz20, dzx01_dyz20; @@ -298,6 +299,18 @@ lp_do_offset_tri(struct gallivm_state *gallivm, lp_build_const_float(gallivm, key-pgon_offset_units), mult, zoffset); + lp_build_context_init(flt_scalar_bld, gallivm, lp_type_float_vec(32, 32)); + if (key-pgon_offset_clamp 0) { + zoffset = lp_build_min(flt_scalar_bld, + lp_build_const_float(gallivm, key-pgon_offset_clamp), + zoffset); + } + else if (key-pgon_offset_clamp 0) { + zoffset = lp_build_max(flt_scalar_bld, + lp_build_const_float(gallivm, key-pgon_offset_clamp), + zoffset); + } + /* yuck */ shuffles[0] = twoi; shuffles[1] = lp_build_const_int32(gallivm, 6); @@ -312,6 +325,10 @@ lp_do_offset_tri(struct gallivm_state *gallivm, zoffset = vec4f_from_scalar(gallivm, zoffset, ); /* clamp and do offset */ + /* +* XXX I suspect the clamp (is that even right to always clamp to fixed 0.0/1.0?) +* should really be per fragment? +*/ yes. this doesn't look right. Should probably be a FIXME too. z0z1z2 = lp_build_clamp(bld, LLVMBuildFAdd(b, z0z1z2, zoffset, ), bld.zero, bld.one); /* insert into args-a0.z, a1.z, a2.z: @@ -810,7 +827,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key-pixel_center_half = lp-rasterizer-half_pixel_center; key-twoside = lp-rasterizer-light_twoside; key-size = Offset(struct lp_setup_variant_key, - inputs[key-num_inputs]); + inputs[key-num_inputs]); key-color_slot = lp-color_slot [0]; key-bcolor_slot = lp-bcolor_slot[0]; @@ -823,6 +840,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key-pgon_offset_units = (float) (lp-rasterizer-offset_units * lp-mrd); key-pgon_offset_scale = lp-rasterizer-offset_scale; + key-pgon_offset_clamp = lp-rasterizer-offset_clamp; key-pad = 0; memcpy(key-inputs, fs-inputs, key-num_inputs * sizeof key-inputs[0]); for (i = 0; i key-num_inputs; i++) { diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.h b/src/gallium/drivers/llvmpipe/lp_state_setup.h index 73d40a5..c2a2c7f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.h @@ -14,7 +14,7 @@ struct lp_setup_variant_list_item }; -struct lp_setup_variant_key { +struct lp_setup_variant_key { unsigned size:16; unsigned num_inputs:8; int color_slot:8; @@ -29,6 +29,7 @@ struct lp_setup_variant_key { float pgon_offset_units; float pgon_offset_scale; + float pgon_offset_clamp; struct lp_shader_input inputs[PIPE_MAX_SHADER_INPUTS]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_state_surface.c b/src/gallium/drivers/llvmpipe/lp_state_surface.c index 375ceb2..e6aac31 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_state_surface.c @@ -65,6 +65,8 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe, } /* Tell draw module how deep the Z/depth buffer is */ + /* FIXME: mrd constant isn't right should use a value derived from + * current primitive
Re: [Mesa-dev] [PATCH] llvmpipe: fix a bug in opaque optimization
- Original Message - From: Roland Scheidegger srol...@vmware.com If there are queries active the opaque optimization reseting the bin needs to be disabled. (Not really tested since the bug was discovered by code inspection not an actual test failure.) --- src/gallium/drivers/llvmpipe/lp_query.c |2 ++ src/gallium/drivers/llvmpipe/lp_scene.h |2 ++ src/gallium/drivers/llvmpipe/lp_setup.c |4 src/gallium/drivers/llvmpipe/lp_setup_tri.c | 28 +-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index ac6d09d..7bd090d 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -134,6 +134,8 @@ llvmpipe_get_query_result(struct pipe_context *pipe, if (pq-end[i] *result) { *result = pq-end[i]; } + /* XXX if this would happen then querying this multiple times + * would return a different result each time... */ if (*result == 0) *result = os_time_get_nano(); } This chunk seems unrelated to the rest of the change and should be in a separate change. Furthermore seems easily fixable -- just store the value on the put the value pq-count[i] itself. It also seems that if-statement should be after the loop. diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 59cce7d..5501d40 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -132,6 +132,8 @@ struct lp_scene { /* The queries still active at end of scene */ struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES]; unsigned num_active_queries; + /* If queries were either active or there were begin/end query commands */ + boolean had_queries; /* Framebuffer mappings - valid only between begin_rasterization() * and end_rasterization(). diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 49aead2..49b61c3 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -237,6 +237,8 @@ begin_binning( struct lp_setup_context *setup ) setup-clear.zsmask = 0; setup-clear.zsvalue = 0; + scene-had_queries = !!setup-active_binned_queries; + LP_DBG(DEBUG_SETUP, %s done\n, __FUNCTION__); return TRUE; } @@ -1237,6 +1239,7 @@ lp_setup_begin_query(struct lp_setup_context *setup, return; } } + setup-scene-had_queries |= TRUE; } } @@ -1272,6 +1275,7 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq) goto fail; } } + setup-scene-had_queries |= TRUE; } } else { diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 6dc136c..dbfad46 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -204,22 +204,22 @@ lp_setup_whole_tile(struct lp_setup_context *setup, LP_COUNT(nr_fully_covered_64); /* if variant is opaque and scissor doesn't effect the tile */ - /* -* Need to disable this optimization for layered rendering and cannot use -* setup-layer_slot here to determine it, because it could incorrectly -* reset the tile if a previous shader used layer_slot but not this one -* (or maybe even undo clears). So determine this from presence of layers -* instead (in which case layer_slot will have no effect). -*/ - if (inputs-opaque scene-fb_max_layer == 0) { - if (!scene-fb.zsbuf) { + if (inputs-opaque) { + /* Several things prevent this optimization from working: Could you please reformat the comment as an itemized list -- it would make it easier to read. + * For layered rendering we can't determine if this covers the same layer + * as previous rendering (or in case of clears those actually always cover + * all layers so optimization is impossible). Need to use fb_max_layer and + * not setup-layer_slot to determine this since even if there's currently + * no slot assigned previous rendering could have used one. + * If there were any Begin/End query commands in the scene then those + * would get removed which would be very wrong. Furthermore, if queries + * were just active we also can't do the optimization since to get + * accurate query results we unfortunately need to execute the rendering + * commands. + */ + if (!scene-fb.zsbuf scene-fb_max_layer == 0 !scene-had_queries) { /* * All previous rendering will be overwritten so reset the bin. - * XXX This is wrong wrt to
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 Ross Burton r...@burtonini.com changed: What|Removed |Added Component|Mesa core |EGL -- 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
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 Ross Burton r...@burtonini.com changed: What|Removed |Added CC||r...@burtonini.com -- 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
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 --- Comment #6 from Ross Burton r...@burtonini.com --- Created attachment 81545 -- https://bugs.freedesktop.org/attachment.cgi?id=81545action=edit Use pointers instead of ints -- 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
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 --- Comment #5 from Ross Burton r...@burtonini.com --- Created attachment 81544 -- https://bugs.freedesktop.org/attachment.cgi?id=81544action=edit Don't include X11 headers if no X11 platform -- 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
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 --- Comment #7 from Quentin Sardem FF7 Glidic sardemff7+freedesk...@sardemff7.net --- (In reply to comment #5) Created attachment 81544 [details] [review] Don't include X11 headers if no X11 platform We should definitely add such a flag in egl.pc file too. Otherwise, programs built against EGL will fail to build too. -- 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
[Mesa-dev] [PATCH 1/2] build: fix EGL build when no X11 headers are present
eglplatform.h defaults to X11 on Unix unless told otherwise, so if we're doing a build without any X11 support tell it so that we don't try including headers that don't exist. Also set GL_PC_FLAGS so that the definition is in egl.pl, so that applications using EGL don't try to pull in X11 headers on systems where EGL was configured without X11 support. Signed-off-by: Ross Burton ross.bur...@intel.com https://bugs.freedesktop.org/show_bug.cgi?id=64959 --- configure.ac |7 +++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 6832b0d..3a0cd77 100644 --- a/configure.ac +++ b/configure.ac @@ -1490,6 +1490,13 @@ AC_SUBST([EGL_NATIVE_PLATFORM]) AC_SUBST([EGL_PLATFORMS]) AC_SUBST([EGL_CFLAGS]) +# If we don't have the X11 platform, set this define so we don't try to include +# the X11 headers. +if ! echo $egl_platforms | grep -q 'x11'; then +DEFINES=$DEFINES -DMESA_EGL_NO_X11_HEADERS +GL_PC_CFLAGS=$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS +fi + AC_ARG_WITH([egl-driver-dir], [AS_HELP_STRING([--with-egl-driver-dir=DIR], [directory for EGL drivers [[default=${libdir}/egl]]])], -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] eglplatform: use unsigned long instead of 32-bit ints in generic platform
In the generic Unix case use the unsigned long type instead of 32-bit integers so that the type sizes are consistant on 64-bit machines between X11 and not-X11. Signed-off-by: Ross Burton ross.bur...@intel.com --- include/EGL/eglplatform.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h index 17fdc61..21b18fe 100644 --- a/include/EGL/eglplatform.h +++ b/include/EGL/eglplatform.h @@ -109,8 +109,8 @@ typedef void*EGLNativeDisplayType; #ifdef MESA_EGL_NO_X11_HEADERS typedef void*EGLNativeDisplayType; -typedef khronos_uint32_t EGLNativePixmapType; -typedef khronos_uint32_t EGLNativeWindowType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; #else -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 Ross Burton r...@burtonini.com changed: What|Removed |Added Attachment #81544|0 |1 is obsolete|| --- Comment #8 from Ross Burton r...@burtonini.com --- Created attachment 81547 -- https://bugs.freedesktop.org/attachment.cgi?id=81547action=edit Don't include X11 headers if no X11 platform -- 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
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 Ross Burton r...@burtonini.com changed: What|Removed |Added Attachment #81545|0 |1 is obsolete|| --- Comment #9 from Ross Burton r...@burtonini.com --- Created attachment 81548 -- https://bugs.freedesktop.org/attachment.cgi?id=81548action=edit Use right size types -- 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] llvmpipe: fix a bug in opaque optimization
Am 27.06.2013 09:48, schrieb Jose Fonseca: - Original Message - From: Roland Scheidegger srol...@vmware.com If there are queries active the opaque optimization reseting the bin needs to be disabled. (Not really tested since the bug was discovered by code inspection not an actual test failure.) --- src/gallium/drivers/llvmpipe/lp_query.c |2 ++ src/gallium/drivers/llvmpipe/lp_scene.h |2 ++ src/gallium/drivers/llvmpipe/lp_setup.c |4 src/gallium/drivers/llvmpipe/lp_setup_tri.c | 28 +-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index ac6d09d..7bd090d 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -134,6 +134,8 @@ llvmpipe_get_query_result(struct pipe_context *pipe, if (pq-end[i] *result) { *result = pq-end[i]; } + /* XXX if this would happen then querying this multiple times + * would return a different result each time... */ if (*result == 0) *result = os_time_get_nano(); } This chunk seems unrelated to the rest of the change and should be in a separate change. Furthermore seems easily fixable -- just store the value on the put the value pq-count[i] itself. It also seems that if-statement should be after the loop. Ok I think I'm just going to nuke it instead. Given how this currently works (scene is set to active, query binned) this looks really impossible. (I am not sure if it actually makes a lot of sense to bin this since the value won't really be more exact than a single os_time_get_nano() value at the end of the scene anyway but as long as the scene is set to active this still couldn't happen.) diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 59cce7d..5501d40 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -132,6 +132,8 @@ struct lp_scene { /* The queries still active at end of scene */ struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES]; unsigned num_active_queries; + /* If queries were either active or there were begin/end query commands */ + boolean had_queries; /* Framebuffer mappings - valid only between begin_rasterization() * and end_rasterization(). diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 49aead2..49b61c3 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -237,6 +237,8 @@ begin_binning( struct lp_setup_context *setup ) setup-clear.zsmask = 0; setup-clear.zsvalue = 0; + scene-had_queries = !!setup-active_binned_queries; + LP_DBG(DEBUG_SETUP, %s done\n, __FUNCTION__); return TRUE; } @@ -1237,6 +1239,7 @@ lp_setup_begin_query(struct lp_setup_context *setup, return; } } + setup-scene-had_queries |= TRUE; } } @@ -1272,6 +1275,7 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq) goto fail; } } + setup-scene-had_queries |= TRUE; } } else { diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 6dc136c..dbfad46 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -204,22 +204,22 @@ lp_setup_whole_tile(struct lp_setup_context *setup, LP_COUNT(nr_fully_covered_64); /* if variant is opaque and scissor doesn't effect the tile */ - /* -* Need to disable this optimization for layered rendering and cannot use -* setup-layer_slot here to determine it, because it could incorrectly -* reset the tile if a previous shader used layer_slot but not this one -* (or maybe even undo clears). So determine this from presence of layers -* instead (in which case layer_slot will have no effect). -*/ - if (inputs-opaque scene-fb_max_layer == 0) { - if (!scene-fb.zsbuf) { + if (inputs-opaque) { + /* Several things prevent this optimization from working: Could you please reformat the comment as an itemized list -- it would make it easier to read. Ok. + * For layered rendering we can't determine if this covers the same layer + * as previous rendering (or in case of clears those actually always cover + * all layers so optimization is impossible). Need to use fb_max_layer and + * not setup-layer_slot to determine this since even if there's currently + * no slot assigned previous rendering could have used one. + * If there were any Begin/End query commands in the scene then those + * would get
Re: [Mesa-dev] [PATCH] llvmpipe: handle offset_clamp
Am 27.06.2013 09:41, schrieb Jose Fonseca: - Original Message - From: Roland Scheidegger srol...@vmware.com This was just ignored (unless for some reason like unfilled polys draw was handling this). Patch looks good. I'm not convinced of that code, putting the float for the clamp in the key isn't really a good idea. Indeed. Then again the other floats for depth bias are already in there too anyway (should probably have a jit_context for the setup function), so this is just a quick fix. Also, the minimum resolvable depth difference used isn't really right as it should be calculated according to the z values of the current primitive and not be a constant (of course, this only makes a difference for float depth buffers), at least for d3d10, so depth biasing is still not quite right. --- src/gallium/drivers/llvmpipe/lp_state_setup.c | 20 +++- src/gallium/drivers/llvmpipe/lp_state_setup.h |3 ++- src/gallium/drivers/llvmpipe/lp_state_surface.c |2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index ed68b98..2988bed 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -244,6 +244,7 @@ lp_do_offset_tri(struct gallivm_state *gallivm, { LLVMBuilderRef b = gallivm-builder; struct lp_build_context bld; + struct lp_build_context flt_scalar_bld; LLVMValueRef zoffset, mult; LLVMValueRef z0_new, z1_new, z2_new; LLVMValueRef dzdxdzdy, dzdx, dzdy, dzxyz20, dyzzx01, dyzzx01_dzxyz20, dzx01_dyz20; @@ -298,6 +299,18 @@ lp_do_offset_tri(struct gallivm_state *gallivm, lp_build_const_float(gallivm, key-pgon_offset_units), mult, zoffset); + lp_build_context_init(flt_scalar_bld, gallivm, lp_type_float_vec(32, 32)); + if (key-pgon_offset_clamp 0) { + zoffset = lp_build_min(flt_scalar_bld, + lp_build_const_float(gallivm, key-pgon_offset_clamp), + zoffset); + } + else if (key-pgon_offset_clamp 0) { + zoffset = lp_build_max(flt_scalar_bld, + lp_build_const_float(gallivm, key-pgon_offset_clamp), + zoffset); + } + /* yuck */ shuffles[0] = twoi; shuffles[1] = lp_build_const_int32(gallivm, 6); @@ -312,6 +325,10 @@ lp_do_offset_tri(struct gallivm_state *gallivm, zoffset = vec4f_from_scalar(gallivm, zoffset, ); /* clamp and do offset */ + /* +* XXX I suspect the clamp (is that even right to always clamp to fixed 0.0/1.0?) +* should really be per fragment? +*/ yes. this doesn't look right. Should probably be a FIXME too. Ok. Draw actually has a similar comment though I believe it is a bit wrong there (because it is saying offset should be per-fragment too which I think isn't true at all, just the clamp though I'm unsure where this comes from in the first place). Roland z0z1z2 = lp_build_clamp(bld, LLVMBuildFAdd(b, z0z1z2, zoffset, ), bld.zero, bld.one); /* insert into args-a0.z, a1.z, a2.z: @@ -810,7 +827,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key-pixel_center_half = lp-rasterizer-half_pixel_center; key-twoside = lp-rasterizer-light_twoside; key-size = Offset(struct lp_setup_variant_key, - inputs[key-num_inputs]); + inputs[key-num_inputs]); key-color_slot = lp-color_slot [0]; key-bcolor_slot = lp-bcolor_slot[0]; @@ -823,6 +840,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key-pgon_offset_units = (float) (lp-rasterizer-offset_units * lp-mrd); key-pgon_offset_scale = lp-rasterizer-offset_scale; + key-pgon_offset_clamp = lp-rasterizer-offset_clamp; key-pad = 0; memcpy(key-inputs, fs-inputs, key-num_inputs * sizeof key-inputs[0]); for (i = 0; i key-num_inputs; i++) { diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.h b/src/gallium/drivers/llvmpipe/lp_state_setup.h index 73d40a5..c2a2c7f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.h @@ -14,7 +14,7 @@ struct lp_setup_variant_list_item }; -struct lp_setup_variant_key { +struct lp_setup_variant_key { unsigned size:16; unsigned num_inputs:8; int color_slot:8; @@ -29,6 +29,7 @@ struct lp_setup_variant_key { float pgon_offset_units; float pgon_offset_scale; + float pgon_offset_clamp; struct lp_shader_input inputs[PIPE_MAX_SHADER_INPUTS]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_state_surface.c b/src/gallium/drivers/llvmpipe/lp_state_surface.c index 375ceb2..e6aac31 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_surface.c +++
Re: [Mesa-dev] [PATCH] llvmpipe: fix a bug in opaque optimization
Am 27.06.2013 14:51, schrieb Roland Scheidegger: Am 27.06.2013 09:48, schrieb Jose Fonseca: - Original Message - From: Roland Scheidegger srol...@vmware.com If there are queries active the opaque optimization reseting the bin needs to be disabled. (Not really tested since the bug was discovered by code inspection not an actual test failure.) --- src/gallium/drivers/llvmpipe/lp_query.c |2 ++ src/gallium/drivers/llvmpipe/lp_scene.h |2 ++ src/gallium/drivers/llvmpipe/lp_setup.c |4 src/gallium/drivers/llvmpipe/lp_setup_tri.c | 28 +-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index ac6d09d..7bd090d 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -134,6 +134,8 @@ llvmpipe_get_query_result(struct pipe_context *pipe, if (pq-end[i] *result) { *result = pq-end[i]; } + /* XXX if this would happen then querying this multiple times + * would return a different result each time... */ if (*result == 0) *result = os_time_get_nano(); } This chunk seems unrelated to the rest of the change and should be in a separate change. Furthermore seems easily fixable -- just store the value on the put the value pq-count[i] itself. It also seems that if-statement should be after the loop. Ok I think I'm just going to nuke it instead. Given how this currently works (scene is set to active, query binned) this looks really impossible. (I am not sure if it actually makes a lot of sense to bin this since the value won't really be more exact than a single os_time_get_nano() value at the end of the scene anyway but as long as the scene is set to active this still couldn't happen.) Hmm actually I guess this isn't true. The value isn't really a lot more accurate but binning it ensures that if multiple ones are in the scene then those later in the scene are really later if only by a tiny bit (certainly not by the amount which would really indicate true time it took for the work to be done between the multiple timestamps but I guess it's better than nothing). For somewhat accurate count it would probably be necessary to sum the result from each bin and then divide by the number of bins when getting the query result. diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 59cce7d..5501d40 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -132,6 +132,8 @@ struct lp_scene { /* The queries still active at end of scene */ struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES]; unsigned num_active_queries; + /* If queries were either active or there were begin/end query commands */ + boolean had_queries; /* Framebuffer mappings - valid only between begin_rasterization() * and end_rasterization(). diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 49aead2..49b61c3 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -237,6 +237,8 @@ begin_binning( struct lp_setup_context *setup ) setup-clear.zsmask = 0; setup-clear.zsvalue = 0; + scene-had_queries = !!setup-active_binned_queries; + LP_DBG(DEBUG_SETUP, %s done\n, __FUNCTION__); return TRUE; } @@ -1237,6 +1239,7 @@ lp_setup_begin_query(struct lp_setup_context *setup, return; } } + setup-scene-had_queries |= TRUE; } } @@ -1272,6 +1275,7 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq) goto fail; } } + setup-scene-had_queries |= TRUE; } } else { diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 6dc136c..dbfad46 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -204,22 +204,22 @@ lp_setup_whole_tile(struct lp_setup_context *setup, LP_COUNT(nr_fully_covered_64); /* if variant is opaque and scissor doesn't effect the tile */ - /* -* Need to disable this optimization for layered rendering and cannot use -* setup-layer_slot here to determine it, because it could incorrectly -* reset the tile if a previous shader used layer_slot but not this one -* (or maybe even undo clears). So determine this from presence of layers -* instead (in which case layer_slot will have no effect). -*/ - if (inputs-opaque scene-fb_max_layer == 0) { - if (!scene-fb.zsbuf) { + if (inputs-opaque) { + /* Several things prevent this optimization from working: Could
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #2 from Brian Paul bri...@vmware.com --- Hi Vinson, what compiler/version are you using? I've got gcc 4.7.2 I see that GLclampf and GLclampd are defined in both places, but I'm not seeing the error here. I'll report the duplicated typedefs to the ARB. -- 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 2/2] eglplatform: use unsigned long instead of 32-bit ints in generic platform
On 06/27/2013 05:35 AM, Ross Burton wrote: In the generic Unix case use the unsigned long type instead of 32-bit integers so that the type sizes are consistant on 64-bit machines between X11 and not-X11. Signed-off-by: Ross Burton ross.bur...@intel.com --- include/EGL/eglplatform.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h index 17fdc61..21b18fe 100644 --- a/include/EGL/eglplatform.h +++ b/include/EGL/eglplatform.h @@ -109,8 +109,8 @@ typedef void*EGLNativeDisplayType; #ifdef MESA_EGL_NO_X11_HEADERS typedef void*EGLNativeDisplayType; -typedef khronos_uint32_t EGLNativePixmapType; -typedef khronos_uint32_t EGLNativeWindowType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; #else These two look OK to me. Reviewed-by: Brian Paul bri...@vmware.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] r300g: add program name check for BSD
On 06/26/2013 10:08 PM, Jonathan Gray wrote: On Wed, Jun 26, 2013 at 09:49:08AM -0600, Brian Paul wrote: On 06/26/2013 01:11 AM, Jonathan Gray wrote: program_invocation_short_name is glibc specific. Provide an alternative using getprogname(), which can be found on *BSD and OS X. Signed-off-by: Jonathan Gray j...@jsg.id.au --- src/gallium/drivers/r300/r300_chipset.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git src/gallium/drivers/r300/r300_chipset.c src/gallium/drivers/r300/r300_chipset.c index 11061ed..7f51ccb 100644 --- src/gallium/drivers/r300/r300_chipset.c +++ src/gallium/drivers/r300/r300_chipset.c @@ -30,6 +30,14 @@ #include stdio.h #include errno.h +#undef GET_PROGRAM_NAME +#ifdef __GLIBC__ +# define GET_PROGRAM_NAME() program_invocation_short_name +#else /* *BSD and OS X */ +# include stdlib.h +# define GET_PROGRAM_NAME() getprogname() +#endif + /* r300_chipset: A file all to itself for deducing the various properties of * Radeons. */ @@ -49,7 +57,7 @@ static void r300_apply_hyperz_blacklist(struct r300_capabilities* caps) int i; for (i = 0; i Elements(list); i++) { -if (strcmp(list[i], program_invocation_short_name) == 0) { +if (strcmp(list[i], GET_PROGRAM_NAME()) == 0) { caps-zmask_ram = 0; caps-hiz_ram = 0; break; I think a new gallium utility function for this would be helpful. In fact I've already implemented something like this for our windows driver. Does the attached code look OK you to guys? looks good to me, a few nitpicks inline -Brian #include pipe/p_config.h #include os/os_process.h #include util/u_memory.h #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) # include windows.h #endif it isn't clear if stdlib.h is included here? /** * Return the name of the current process. * \param procname returns the process name, always 0-terminated * \param size size of the procname buffer * \return TRUE or FALSE for success, failure */ boolean os_get_process_name(char *procname, size_t size) { const char *name; #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) char szProcessPath[MAX_PATH]; char *lpProcessName; char *lpProcessExt; GetModuleFileNameA(NULL, szProcessPath, Elements(szProcessPath)); lpProcessName = strrchr(szProcessPath, '\\'); lpProcessName = lpProcessName ? lpProcessName + 1 : szProcessPath; lpProcessExt = strrchr(lpProcessName, '.'); if (lpProcessExt) { *lpProcessExt = '\0'; } name = lpProcessName; #elif defined(__GLIBC__) name = program_invocation_short_name; #else /* *BSD and OS X */ name = getprogname(); #endif assert(procname); assert(size 0); if (name) { strncpy(procname, name, size); procname[size - 1] = 0; and this should be '\0' not 0, though the end result is the same return TRUE; } else { return FALSE; } } Thanks. I'll fix those issues and post git patches for review. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 66029] More robust way of detecting LLVM major and minor versions
https://bugs.freedesktop.org/show_bug.cgi?id=66029 --- Comment #3 from Tom Stellard tstel...@gmail.com --- Hi, this patch looks good at first glance. Could you generate the patch using git format-patch and send it to the mailing list (mesa-dev@lists.freedesktop.org) -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #3 from Tom Stellard tstel...@gmail.com --- I'm getting the same error as Vinson. I have gcc 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5), and I'm using these configure flags: CFLAGS=-g CC=gcc CXX=g++ \ ./autogen.sh \ --prefix=/usr/local \ --with-dri-drivers= \ --enable-gallium-llvm \ --enable-r600-llvm-compiler \ --with-gallium-drivers=r300 \ --with-llvm-prefix=/usr/local/llvm/3.3/release -- 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
[Mesa-dev] [PATCH] os: add os_get_process_name() function
--- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/os/os_process.c | 86 src/gallium/auxiliary/os/os_process.h | 40 +++ 3 files changed, 127 insertions(+) create mode 100644 src/gallium/auxiliary/os/os_process.c create mode 100644 src/gallium/auxiliary/os/os_process.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 20ff5ba..c06f964 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -44,6 +44,7 @@ C_SOURCES := \ hud/hud_fps.c \ hud/hud_driver_query.c \ os/os_misc.c \ + os/os_process.c \ os/os_time.c \ pipebuffer/pb_buffer_fenced.c \ pipebuffer/pb_buffer_malloc.c \ diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c new file mode 100644 index 000..fd9fc07 --- /dev/null +++ b/src/gallium/auxiliary/os/os_process.c @@ -0,0 +1,86 @@ +/** + * + * Copyright 2013 VMware, Inc. + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS 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 pipe/p_config.h +#include os/os_process.h +#include util/u_memory.h + +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) +# include windows.h +#elif defined(__GLIBC__) +# include errno.h +#else +# include stdlib.h +#endif + + +/** + * Return the name of the current process. + * \param procname returns the process name + * \param size size of the procname buffer + * \return TRUE or FALSE for success, failure + */ +boolean +os_get_process_name(char *procname, size_t size) +{ + const char *name; +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) + char szProcessPath[MAX_PATH]; + char *lpProcessName; + char *lpProcessExt; + + GetModuleFileNameA(NULL, szProcessPath, Elements(szProcessPath)); + + lpProcessName = strrchr(szProcessPath, '\\'); + lpProcessName = lpProcessName ? lpProcessName + 1 : szProcessPath; + + lpProcessExt = strrchr(lpProcessName, '.'); + if (lpProcessExt) { + *lpProcessExt = '\0'; + } + + name = lpProcessName; + +#elif defined(__GLIBC__) + name = program_invocation_short_name; +#else /* *BSD and OS X */ + name = getprogname(); +#endif + + assert(size 0); + assert(procname); + + if (name procname size 0) { + strncpy(procname, name, size); + procname[size - 1] = '\0'; + return TRUE; + } + else { + return FALSE; + } +} diff --git a/src/gallium/auxiliary/os/os_process.h b/src/gallium/auxiliary/os/os_process.h new file mode 100644 index 000..0d50ddc --- /dev/null +++ b/src/gallium/auxiliary/os/os_process.h @@ -0,0 +1,40 @@ +/** + * + * Copyright 2013 VMware, Inc. + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #4 from Brian Paul bri...@vmware.com --- Tom, can you remove the GLclampf/GLclampd typedef lines from your glext.h and verify that clears things up? If so, let's just do that for now. -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #5 from Tom Stellard tstel...@gmail.com --- Created attachment 81568 -- https://bugs.freedesktop.org/attachment.cgi?id=81568action=edit Remove duplicated typedefs Here is the patch I'm using to remove the duplicate typedefs form glext.h This patch does not fix the build as it causes a build error when building the glsl_compiler. I think you might be able to reproduce this glsl_compiler error with this patch no matter what version of gcc you are using. I will attach my build log as well. -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #6 from Tom Stellard tstel...@gmail.com --- Created attachment 81569 -- https://bugs.freedesktop.org/attachment.cgi?id=81569action=edit Log with build error from glsl_compiler -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #7 from Brian Paul bri...@vmware.com --- You removed the typedef for GLfixed from glext.h What if you put that back? -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #8 from Tom Stellard tstel...@gmail.com --- (In reply to comment #7) You removed the typedef for GLfixed from glext.h What if you put that back? I had to remove that too because it was also causing redefinition errors: gmake[4]: Entering directory `/home/steltho/mesa/src/mapi/shared-glapi' CC table.lo In file included from ../../../include/GL/gl.h:2085:0, from ../../../src/mapi/shared-glapi/glapi_mapi_tmp.h:11, from ../../../src/mapi/mapi_tmp.h:47, from ../../../src/mapi/table.c:55: ../../../include/GL/glext.h:4379:15: error: redefinition of typedef 'GLfixed' ../../../src/mapi/shared-glapi/glapi_mapi_tmp.h:5:13: note: previous declaration of 'GLfixed' was here -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #9 from Brian Paul bri...@vmware.com --- OK, let's try removing line 731 from src/map/mapi_abi.py sigh the Mesa dispatch code is such an incredibly convoluted mess /sigh -- 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 1/3] r300g: Fix make check
On Thu, Jun 27, 2013 at 12:57 AM, Tom Stellard t...@stellard.net wrote: From: Tom Stellard thomas.stell...@amd.com For the series: Reviewed-by: Alex Deucher alexander.deuc...@amd.com --- src/gallium/drivers/r300/Makefile.am |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am index 49264c4..f82b8e9 100644 --- a/src/gallium/drivers/r300/Makefile.am +++ b/src/gallium/drivers/r300/Makefile.am @@ -17,7 +17,8 @@ AM_CFLAGS = \ $(LLVM_CFLAGS) \ $(RADEON_CFLAGS) -r300_compiler_tests_LDADD = libr300.la +r300_compiler_tests_LDADD = libr300.la libr300-helper.la \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la r300_compiler_tests_CPPFLAGS = \ -I$(top_srcdir)/src/gallium/drivers/r300/compiler r300_compiler_tests_SOURCES = \ -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 66175] R600/SI: SETCC for v2i32/v4i32 triggers LLVM assertion
https://bugs.freedesktop.org/show_bug.cgi?id=66175 --- Comment #1 from Tom Stellard tstel...@gmail.com --- This patch should fix the crash: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130624/179336.html -- 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] radeonsi/compute: Fix memory leak in radeonsi_launch_grid.
Thanks Vinson, I've pushed this. Sorry for the delay. -Tom On Tue, Jun 25, 2013 at 09:37:07PM -0700, Vinson Lee wrote: Fixes Resource leak defect reported by Coverity. Signed-off-by: Vinson Lee v...@freedesktop.org --- src/gallium/drivers/radeonsi/radeonsi_compute.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/radeonsi/radeonsi_compute.c b/src/gallium/drivers/radeonsi/radeonsi_compute.c index ed51587..5fb298a 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_compute.c +++ b/src/gallium/drivers/radeonsi/radeonsi_compute.c @@ -234,6 +234,7 @@ static void radeonsi_launch_grid( rctx-ws-buffer_wait(shader-bo-buf, 0); FREE(pm4); + FREE(kernel_args); } -- 1.8.1.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 64952] Build failure in egl-static when using llvm-3.3
https://bugs.freedesktop.org/show_bug.cgi?id=64952 --- Comment #2 from Tom Stellard tstel...@gmail.com --- I'm having trouble reproducing this, what configure flags are you using? -- 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] os: add os_get_process_name() function
- Original Message - --- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/os/os_process.c | 86 src/gallium/auxiliary/os/os_process.h | 40 +++ 3 files changed, 127 insertions(+) create mode 100644 src/gallium/auxiliary/os/os_process.c create mode 100644 src/gallium/auxiliary/os/os_process.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 20ff5ba..c06f964 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -44,6 +44,7 @@ C_SOURCES := \ hud/hud_fps.c \ hud/hud_driver_query.c \ os/os_misc.c \ + os/os_process.c \ os/os_time.c \ pipebuffer/pb_buffer_fenced.c \ pipebuffer/pb_buffer_malloc.c \ diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c new file mode 100644 index 000..fd9fc07 --- /dev/null +++ b/src/gallium/auxiliary/os/os_process.c @@ -0,0 +1,86 @@ +/** + * + * Copyright 2013 VMware, Inc. + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS 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 pipe/p_config.h +#include os/os_process.h +#include util/u_memory.h + +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) +# include windows.h +#elif defined(__GLIBC__) +# include errno.h +#else +# include stdlib.h +#endif + + +/** + * Return the name of the current process. + * \param procname returns the process name + * \param size size of the procname buffer + * \return TRUE or FALSE for success, failure + */ +boolean +os_get_process_name(char *procname, size_t size) +{ + const char *name; +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) + char szProcessPath[MAX_PATH]; + char *lpProcessName; + char *lpProcessExt; + + GetModuleFileNameA(NULL, szProcessPath, Elements(szProcessPath)); + + lpProcessName = strrchr(szProcessPath, '\\'); + lpProcessName = lpProcessName ? lpProcessName + 1 : szProcessPath; + + lpProcessExt = strrchr(lpProcessName, '.'); + if (lpProcessExt) { + *lpProcessExt = '\0'; + } + + name = lpProcessName; + This looks good. Do the ones below trim the directory too? FWIW, apitrace also has a cross platform implementation of similar function, but uses slightly different methods for the non-Windows OS. +#elif defined(__GLIBC__) + name = program_invocation_short_name; +#else /* *BSD and OS X */ + name = getprogname(); There should be a #else here with a #warning/#error/ or return FALSE, just in case. Otherwise looks good. +#endif + + assert(size 0); + assert(procname); + + if (name procname size 0) { + strncpy(procname, name, size); + procname[size - 1] = '\0'; + return TRUE; + } + else { + return FALSE; + } +} diff --git a/src/gallium/auxiliary/os/os_process.h b/src/gallium/auxiliary/os/os_process.h new file mode 100644 index 000..0d50ddc --- /dev/null +++ b/src/gallium/auxiliary/os/os_process.h @@ -0,0 +1,40 @@ +/** + * + * Copyright 2013 VMware, Inc. + * 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, sub license, 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
Re: [Mesa-dev] [PATCH 3/3] r300g/compiler: Prevent the regalloc from swizzling texture operands v2
Reviewed-by: Marek Olšák mar...@gmail.com Marek On Thu, Jun 27, 2013 at 6:57 AM, Tom Stellard t...@stellard.net wrote: From: Tom Stellard thomas.stell...@amd.com https://bugs.freedesktop.org/show_bug.cgi?id=63520 NOTE: This is a candidate for the stable branches. --- src/gallium/drivers/r300/Makefile.am |1 + .../drivers/r300/compiler/radeon_pair_regalloc.c |8 ++ .../r300/compiler/tests/r300_compiler_tests.c |1 + .../tests/radeon_compiler_regalloc_tests.c | 99 .../compiler/tests/regalloc_tex_1d_swizzle.test| 15 +++ 5 files changed, 124 insertions(+), 0 deletions(-) create mode 100644 src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c create mode 100644 src/gallium/drivers/r300/compiler/tests/regalloc_tex_1d_swizzle.test diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am index f82b8e9..ab8b4e8 100644 --- a/src/gallium/drivers/r300/Makefile.am +++ b/src/gallium/drivers/r300/Makefile.am @@ -24,6 +24,7 @@ r300_compiler_tests_CPPFLAGS = \ r300_compiler_tests_SOURCES = \ $(testdir)/r300_compiler_tests.c \ $(testdir)/radeon_compiler_optimize_tests.c \ + $(testdir)/radeon_compiler_regalloc_tests.c \ $(testdir)/radeon_compiler_util_tests.c \ $(testdir)/rc_test_helpers.c \ $(testdir)/unit_test.c diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c index 6442e0d..1970a34 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c @@ -383,6 +383,14 @@ static enum rc_reg_class variable_get_class( RC_INSTRUCTION_PAIR ) { old_swizzle = r.U.P.Arg-Swizzle; } else { + /* Source operands of TEX +* instructions can't be +* swizzle on r300/r400 GPUs. +*/ + if (!variable-C-is_r500) { + can_change_writemask = 0; + break; + } old_swizzle = r.U.I.Src-Swizzle; } new_swizzle = rc_adjust_channels( diff --git a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c index cc4725a..0406ae6 100644 --- a/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c +++ b/src/gallium/drivers/r300/compiler/tests/r300_compiler_tests.c @@ -33,6 +33,7 @@ int main(int argc, char ** argv) { unsigned pass = 1; pass = radeon_compiler_optimize_run_tests(); + pass = radeon_compiler_regalloc_run_tests(); pass = radeon_compiler_util_run_tests(); if (pass) { diff --git a/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c new file mode 100644 index 000..eeb6b07 --- /dev/null +++ b/src/gallium/drivers/r300/compiler/tests/radeon_compiler_regalloc_tests.c @@ -0,0 +1,99 @@ +/* + * Copyright 2013 Advanced Micro Devices, Inc. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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. + * + * Author: Tom Stellard thomas.stell...@amd.com + */ + +#include radeon_program_pair.h + +#include r300_compiler_tests.h
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #10 from Vinson Lee v...@freedesktop.org --- (In reply to comment #2) Hi Vinson, what compiler/version are you using? I've got gcc 4.7.2 I see that GLclampf and GLclampd are defined in both places, but I'm not seeing the error here. I'll report the duplicated typedefs to the ARB. $ gcc --version gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I do not see the error with GCC 4.6 and newer. -- 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
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #11 from Tom Stellard tstel...@gmail.com --- Created attachment 81574 -- https://bugs.freedesktop.org/attachment.cgi?id=81574action=edit Build fix I had to remove GLfixed typedefs from a few other places, but Mesa now builds for me with this patch. -- 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
[Mesa-dev] [PATCH] i965: NULL check depth_mt to quiet static analysis.
--- I think (depth_irb == NULL) iff (depth_mt == NULL) and the same for stencil_irb and stencil_mt. I can understand how static analysis tools would miss this, since I haven't been able to prove it to myself either. src/mesa/drivers/dri/i965/brw_misc_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 7e41c84..23faee6 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -586,31 +586,31 @@ brw_emit_depthbuffer(struct brw_context *brw) if (stencil_mt) { separate_stencil = stencil_mt-format == MESA_FORMAT_S8; /* Gen7 supports only separate stencil */ assert(separate_stencil || intel-gen 7); } /* If there's a packed depth/stencil bound to stencil only, we need to * emit the packed depth/stencil buffer packet. */ if (!depth_irb stencil_irb !separate_stencil) { depth_irb = stencil_irb; depth_mt = stencil_mt; } - if (depth_irb) { + if (depth_irb depth_mt) { /* When 3DSTATE_DEPTH_BUFFER.Separate_Stencil_Enable is set, then * 3DSTATE_DEPTH_BUFFER.Surface_Format is not permitted to be a packed * depthstencil format. * * Gens prior to 7 require that HiZ_Enable and Separate_Stencil_Enable be * set to the same value. Gens after 7 implicitly always set * Separate_Stencil_Enable; software cannot disable it. */ if ((intel-gen 7 hiz) || intel-gen = 7) { assert(!_mesa_is_format_packed_depth_stencil(depth_mt-format)); } /* Prior to Gen7, if using separate stencil, hiz must be enabled. */ assert(intel-gen = 7 || !separate_stencil || hiz); -- 1.8.1.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mesa: Remove GL_EXT_clip_volume_hint
From: Ian Romanick ian.d.roman...@intel.com As far as I can tell, no driver has enabled this extension since c6499a7 back in 2007. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/attrib.c | 2 -- src/mesa/main/extensions.c | 1 - src/mesa/main/hint.c | 11 --- src/mesa/main/mtypes.h | 2 -- 4 files changed, 16 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 9358e69..ca617f7 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1045,8 +1045,6 @@ _mesa_PopAttrib(void) _mesa_Hint(GL_LINE_SMOOTH_HINT, hint-LineSmooth); _mesa_Hint(GL_POLYGON_SMOOTH_HINT, hint-PolygonSmooth); _mesa_Hint(GL_FOG_HINT, hint-Fog); - _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, - hint-ClipVolumeClipping); _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, hint-TextureCompression); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fc6fbad..2ba4475 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -174,7 +174,6 @@ static const struct extension extension_table[] = { { GL_EXT_discard_framebuffer, o(EXT_framebuffer_object), ES1 | ES2, 2009 }, { GL_EXT_blend_minmax,o(EXT_blend_minmax), GLL | ES1 | ES2, 1995 }, { GL_EXT_blend_subtract, o(dummy_true), GLL,1995 }, - { GL_EXT_clip_volume_hint,o(EXT_clip_volume_hint), GL, 1996 }, { GL_EXT_compiled_vertex_array, o(dummy_true), GLL,1996 }, { GL_EXT_copy_texture,o(dummy_true), GLL,1995 }, { GL_EXT_depth_bounds_test, o(EXT_depth_bounds_test), GL, 2002 }, diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 6d3e58d..3e056eb 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -90,16 +90,6 @@ _mesa_Hint( GLenum target, GLenum mode ) ctx-Hint.PolygonSmooth = mode; break; - /* GL_EXT_clip_volume_hint */ - case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: - if (ctx-API != API_OPENGL_COMPAT) -goto invalid_target; - if (ctx-Hint.ClipVolumeClipping == mode) - return; -FLUSH_VERTICES(ctx, _NEW_HINT); - ctx-Hint.ClipVolumeClipping = mode; - break; - /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSION_HINT_ARB: if (!_mesa_is_desktop_gl(ctx)) @@ -158,7 +148,6 @@ void _mesa_init_hint( struct gl_context * ctx ) ctx-Hint.LineSmooth = GL_DONT_CARE; ctx-Hint.PolygonSmooth = GL_DONT_CARE; ctx-Hint.Fog = GL_DONT_CARE; - ctx-Hint.ClipVolumeClipping = GL_DONT_CARE; ctx-Hint.TextureCompression = GL_DONT_CARE; ctx-Hint.GenerateMipmap = GL_DONT_CARE; ctx-Hint.FragmentShaderDerivative = GL_DONT_CARE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5d5b534..df2d20b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -794,7 +794,6 @@ struct gl_hint_attrib GLenum LineSmooth; GLenum PolygonSmooth; GLenum Fog; - GLenum ClipVolumeClipping; /** GL_EXT_clip_volume_hint */ GLenum TextureCompression; /** GL_ARB_texture_compression */ GLenum GenerateMipmap; /** GL_SGIS_generate_mipmap */ GLenum FragmentShaderDerivative; /** GL_ARB_fragment_shader */ @@ -3053,7 +3052,6 @@ struct gl_extensions GLboolean EXT_blend_equation_separate; GLboolean EXT_blend_func_separate; GLboolean EXT_blend_minmax; - GLboolean EXT_clip_volume_hint; GLboolean EXT_depth_bounds_test; GLboolean EXT_draw_buffers2; GLboolean EXT_fog_coord; -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Remove GL_EXT_clip_volume_hint
On 06/27/2013 12:53 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com As far as I can tell, no driver has enabled this extension since c6499a7 back in 2007. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/attrib.c | 2 -- src/mesa/main/extensions.c | 1 - src/mesa/main/hint.c | 11 --- src/mesa/main/mtypes.h | 2 -- 4 files changed, 16 deletions(-) Maybe make note of this in the release notes file, in case anyone cares. Reviewed-by: Brian Paul bri...@vmware.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 66213] Certain Mesa Demos Rendering Inverted (vertically)
https://bugs.freedesktop.org/show_bug.cgi?id=66213 --- Comment #7 from Jesus Cortez jesus.corte...@gmail.com --- Here's some more (hopefully helpful) information: If I start the drawpix example, everything looks fine. But the second I hit f to draw to the GL_FRONT buffer, the image becomes vertically inverted, and the keyboard controls are inverted as well. I think the problem is happening in the glDrawPixels function, based on the amount of debugging I've done into the issue so far. -- 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
[Mesa-dev] [Bug 66213] Certain Mesa Demos Rendering Inverted (vertically)
https://bugs.freedesktop.org/show_bug.cgi?id=66213 --- Comment #8 from Jesus Cortez jesus.corte...@gmail.com --- (In reply to comment #4) Also, what driver are you using? The output of glxinfo | grep renderer should provide the necessary information. According to glinfo, GL_RENDERER: Software Rasterizer -- 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
[Mesa-dev] [PATCH 1/2] draw/gallivm: export overflow arithmetic to its own file
We'll be reusing this code so lets put it in a common file and use it in the draw module. Signed-off-by: Zack Rusin za...@vmware.com --- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/draw/draw_llvm.c | 55 ++- .../auxiliary/gallivm/lp_bld_arit_overflow.c | 165 .../auxiliary/gallivm/lp_bld_arit_overflow.h | 57 +++ 4 files changed, 234 insertions(+), 44 deletions(-) create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 20ff5ba..4751762 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -163,6 +163,7 @@ GENERATED_SOURCES := \ GALLIVM_SOURCES := \ gallivm/lp_bld_arit.c \ +gallivm/lp_bld_arit_overflow.c \ gallivm/lp_bld_assert.c \ gallivm/lp_bld_bitarit.c \ gallivm/lp_bld_const.c \ diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 33cccfe..97b463f 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -32,6 +32,7 @@ #include draw_gs.h #include gallivm/lp_bld_arit.h +#include gallivm/lp_bld_arit_overflow.h #include gallivm/lp_bld_logic.h #include gallivm/lp_bld_const.h #include gallivm/lp_bld_swizzle.h @@ -699,13 +700,7 @@ generate_fetch(struct gallivm_state *gallivm, LLVMValueRef temp_ptr = lp_build_alloca(gallivm, lp_build_vec_type(gallivm, lp_float32_vec4_type()), ); - LLVMValueRef ofbit, oresult; - LLVMTypeRef oelems[2] = { - LLVMInt32TypeInContext(gallivm-context), - LLVMInt1TypeInContext(gallivm-context) - }; - LLVMTypeRef otype = LLVMStructTypeInContext(gallivm-context, - oelems, 2, FALSE); + LLVMValueRef ofbit = NULL; struct lp_build_if_state if_ctx; if (velem-instance_divisor) { @@ -715,44 +710,16 @@ generate_fetch(struct gallivm_state *gallivm, instance_divisor); } - oresult = lp_build_intrinsic_binary(builder, - llvm.umul.with.overflow.i32, - otype, vb_stride, index); - ofbit = LLVMBuildExtractValue(builder, oresult, 1, ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - oresult = lp_build_intrinsic_binary(builder, - llvm.uadd.with.overflow.i32, - otype, stride, vb_buffer_offset); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - oresult = lp_build_intrinsic_binary( - builder, - llvm.uadd.with.overflow.i32, - otype, stride, - lp_build_const_int32(gallivm, velem-src_offset)); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - - oresult = lp_build_intrinsic_binary( - builder, - llvm.uadd.with.overflow.i32, - otype, stride, + stride = lp_build_umul_overflow(gallivm, vb_stride, index, ofbit); + stride = lp_build_uadd_overflow(gallivm, stride, vb_buffer_offset, ofbit); + stride = lp_build_uadd_overflow( + gallivm, stride, + lp_build_const_int32(gallivm, velem-src_offset), ofbit); + needed_buffer_size = lp_build_uadd_overflow( + gallivm, stride, lp_build_const_int32(gallivm, - util_format_get_blocksize(velem-src_format))); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - needed_buffer_size = LLVMBuildExtractValue(builder, oresult, 0, ); + util_format_get_blocksize(velem-src_format)), + ofbit); buffer_overflowed = LLVMBuildICmp(builder, LLVMIntUGT, needed_buffer_size, buffer_size, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c b/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c new file mode 100644 index 000..f17e17a --- /dev/null +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c @@ -0,0 +1,165 @@ +/** + * + * Copyright 2013 + * 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, sub license, and/or sell copies of the Software, and to + * permit persons to whom the
[Mesa-dev] [PATCH 2/2] draw: fix incorrect clipper invocation statistics
clipper invocations are computed earlier (of course before the emittion) so this code was adding bogus numbers to already computed clipper invocations. Signed-off-by: Zack Rusin za...@vmware.com --- src/gallium/auxiliary/draw/draw_pt_emit.c |6 -- 1 file changed, 6 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index ea02554..4c96d74 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -253,12 +253,6 @@ draw_pt_emit_linear(struct pt_emit *emit, i prim_info-primitive_count; start += prim_info-primitive_lengths[i], i++) { - if (draw-collect_statistics) { - draw-statistics.c_invocations += -u_decomposed_prims_for_vertices(prim_info-prim, -prim_info-primitive_lengths[i]); - } - render-draw_arrays(render, start, prim_info-primitive_lengths[i]); -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] os: add os_get_process_name() function
On 06/27/2013 11:41 AM, Jose Fonseca wrote: - Original Message - --- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/os/os_process.c | 86 src/gallium/auxiliary/os/os_process.h | 40 +++ 3 files changed, 127 insertions(+) create mode 100644 src/gallium/auxiliary/os/os_process.c create mode 100644 src/gallium/auxiliary/os/os_process.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 20ff5ba..c06f964 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -44,6 +44,7 @@ C_SOURCES := \ hud/hud_fps.c \ hud/hud_driver_query.c \ os/os_misc.c \ + os/os_process.c \ os/os_time.c \ pipebuffer/pb_buffer_fenced.c \ pipebuffer/pb_buffer_malloc.c \ diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c new file mode 100644 index 000..fd9fc07 --- /dev/null +++ b/src/gallium/auxiliary/os/os_process.c @@ -0,0 +1,86 @@ +/** + * + * Copyright 2013 VMware, Inc. + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS 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 pipe/p_config.h +#include os/os_process.h +#include util/u_memory.h + +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) +# include windows.h +#elif defined(__GLIBC__) +# include errno.h +#else +# include stdlib.h +#endif + + +/** + * Return the name of the current process. + * \param procname returns the process name + * \param size size of the procname buffer + * \return TRUE or FALSE for success, failure + */ +boolean +os_get_process_name(char *procname, size_t size) +{ + const char *name; +#if defined(PIPE_SUBSYSTEM_WINDOWS_USER) + char szProcessPath[MAX_PATH]; + char *lpProcessName; + char *lpProcessExt; + + GetModuleFileNameA(NULL, szProcessPath, Elements(szProcessPath)); + + lpProcessName = strrchr(szProcessPath, '\\'); + lpProcessName = lpProcessName ? lpProcessName + 1 : szProcessPath; + + lpProcessExt = strrchr(lpProcessName, '.'); + if (lpProcessExt) { + *lpProcessExt = '\0'; + } + + name = lpProcessName; + This looks good. Do the ones below trim the directory too? I only have info from google and the previously-posted r300 patch to go by, but yes, I think so. FWIW, apitrace also has a cross platform implementation of similar function, but uses slightly different methods for the non-Windows OS. +#elif defined(__GLIBC__) + name = program_invocation_short_name; +#else /* *BSD and OS X */ + name = getprogname(); There should be a #else here with a #warning/#error/ or return FALSE, just in case. I'll add an explicit test for PIPE_OS_BSD || PIPE_OS_APPLE for the later case then an everything-else #warning. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] i965: Add missing state reset at the end of blorp.
These are things that happen to be occurring because of the batch flush at the start of the blorp op (which exists to prevent batch space or aperture space overflow), but the intention was for this sequence of state resets at the end of blorp to be everything necessary for the next draw call. Found when debugging the next commit, by comparing brw_new_batch() and intel_batchbuffer_reset() to brw_blorp_exec(). --- src/mesa/drivers/dri/i965/brw_blorp.cpp | 2 ++ src/mesa/drivers/dri/i965/intel_batchbuffer.c | 9 + src/mesa/drivers/dri/i965/intel_batchbuffer.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index c7e7cd2..92bee3e 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -216,6 +216,8 @@ brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params) brw-state.dirty.cache = ~0; brw-state_batch_count = 0; intel-batch.need_workaround_flush = true; + brw-ib.type = -1; + intel_batchbuffer_clear_cache(intel); /* Flush the sampler cache so any texturing from the destination is * coherent. diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 8c6524e..5d4e4e9 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -41,7 +41,8 @@ struct cached_batch_item { uint16_t size; }; -static void clear_cache( struct intel_context *intel ) +void +intel_batchbuffer_clear_cache(struct intel_context *intel) { struct cached_batch_item *item = intel-batch.cached_items; @@ -84,7 +85,7 @@ intel_batchbuffer_reset(struct intel_context *intel) } intel-batch.last_bo = intel-batch.bo; - clear_cache(intel); + intel_batchbuffer_clear_cache(intel); intel-batch.bo = drm_intel_bo_alloc(intel-bufmgr, batchbuffer, intel-maxBatchSize, 4096); @@ -117,7 +118,7 @@ intel_batchbuffer_reset_to_saved(struct intel_context *intel) /* Cached batch state is dead, since we just cleared some unknown part of the * batchbuffer. Assume that the caller resets any other state necessary. */ - clear_cache(intel); + intel_batchbuffer_clear_cache(intel); } void @@ -127,7 +128,7 @@ intel_batchbuffer_free(struct intel_context *intel) drm_intel_bo_unreference(intel-batch.last_bo); drm_intel_bo_unreference(intel-batch.bo); drm_intel_bo_unreference(intel-batch.workaround_bo); - clear_cache(intel); + intel_batchbuffer_clear_cache(intel); } static void diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h index 1a6d1aa..10fb6b4 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h @@ -28,6 +28,7 @@ void intel_batchbuffer_init(struct intel_context *intel); void intel_batchbuffer_free(struct intel_context *intel); void intel_batchbuffer_save_state(struct intel_context *intel); void intel_batchbuffer_reset_to_saved(struct intel_context *intel); +void intel_batchbuffer_clear_cache(struct intel_context *intel); int _intel_batchbuffer_flush(struct intel_context *intel, const char *file, int line); -- 1.8.3.rc0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] i965: Avoid flushing the batch for every blorp op.
This brings over the batch-wrap-prevention and aperture space checking code from the normal brw_draw.c path, so that we don't need to flush the batch every time. There's a risk here if the intel_emit_post_sync_nonzero_flush() call isn't high enough up in the state emit sequences -- before, we implicitly had one at the batch flush before any state was emitted, so Mesa's workaround emits didn't really matter. Improves cairo-gl performance by 13.7733% +/- 1.74876% (n=30/32) No statistically significant performance difference on unigine tropics (n=10) No statistically significant performance difference on openarena (n=755) No statistically significant performance difference on Lightsmark (n=15, though this may be an issue of test power -- looks like a ~.3% performance hit) Reduces low-resolution GLB 2.7 performance by 0.604517% +/- 0.140544% (n=132/133) --- I've got the test system running more Lightsmark now -- the bimodal distribution of its results was killing the stats, and I'd bumped the power cable and it ran out of battery and died. I'm a little mystified by the small GLB and possibly LM regressions. My theory was the first-post-swap-batch throttling, except that we've got about 5 batches per frame on GLB. src/mesa/drivers/dri/i965/brw_blorp.cpp | 51 +++- src/mesa/drivers/dri/i965/brw_blorp.h| 4 --- src/mesa/drivers/dri/i965/gen6_blorp.cpp | 14 - src/mesa/drivers/dri/i965/gen7_blorp.cpp | 1 - 4 files changed, 50 insertions(+), 20 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index 92bee3e..d02c660 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -21,6 +21,7 @@ * IN THE SOFTWARE. */ +#include errno.h #include intel_batchbuffer.h #include intel_fbo.h @@ -191,7 +192,26 @@ intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt, void brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params) { - struct brw_context *brw = brw_context(intel-ctx); + struct gl_context *ctx = intel-ctx; + struct brw_context *brw = brw_context(ctx); + uint32_t estimated_max_batch_usage = 1500; + bool check_aperture_failed_once = false; + + /* Flush the sampler and render caches. We definitely need to flush the +* sampler cache so that we get updated contents from the render cache for +* the glBlitFramebuffer() source. Also, we are sometimes warned in the +* docs to flush the cache between reinterpretations of the same surface +* data with different formats, which blorp does for stencil and depth +* data. +*/ + intel_batchbuffer_emit_mi_flush(intel); + +retry: + intel_batchbuffer_require_space(intel, estimated_max_batch_usage, false); + intel_batchbuffer_save_state(intel); + drm_intel_bo *saved_bo = intel-batch.bo; + uint32_t saved_used = intel-batch.used; + uint32_t saved_state_batch_offset = intel-batch.state_batch_offset; switch (intel-gen) { case 6: @@ -206,6 +226,35 @@ brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params) break; } + /* Make sure we didn't wrap the batch unintentionally, and make sure we +* reserved enough space that a wrap will never happen. +*/ + assert(intel-batch.bo == saved_bo); + assert((intel-batch.used - saved_used) * 4 + + (saved_state_batch_offset - intel-batch.state_batch_offset) + estimated_max_batch_usage); + /* Shut up compiler warnings on release build */ + (void)saved_bo; + (void)saved_used; + (void)saved_state_batch_offset; + + /* Check if the blorp op we just did would make our batch likely to fail to +* map all the BOs into the GPU at batch exec time later. If so, flush the +* batch and try again with nothing else in the batch. +*/ + if (dri_bufmgr_check_aperture_space(intel-batch.bo, 1)) { + if (!check_aperture_failed_once) { + check_aperture_failed_once = true; + intel_batchbuffer_reset_to_saved(intel); + intel_batchbuffer_flush(intel); + goto retry; + } else { + int ret = intel_batchbuffer_flush(intel); + WARN_ONCE(ret == -ENOSPC, + i965: blorp emit exceeded available aperture space\n); + } + } + if (unlikely(intel-always_flush_batch)) intel_batchbuffer_flush(intel); diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h index ffc27cc..a726201 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.h +++ b/src/mesa/drivers/dri/i965/brw_blorp.h @@ -353,10 +353,6 @@ void gen6_blorp_init(struct brw_context *brw); void -gen6_blorp_emit_batch_head(struct brw_context *brw, - const brw_blorp_params *params); - -void gen6_blorp_emit_state_base_address(struct brw_context *brw, const brw_blorp_params *params); diff --git
Re: [Mesa-dev] [PATCH 1/4] mesa: move declarations before code
Brian Paul bri...@vmware.com writes: On 06/26/2013 04:33 PM, Eric Anholt wrote: Brian Paul bri...@vmware.com writes: On 06/26/2013 03:56 PM, Ian Romanick wrote: Patches 1 and 4 are Reviewed-by: Ian Romanick ian.d.roman...@intel.com For patch 3, I share Jose's concern. I would very much like to see this happen in directories containing code that will be built with MSVC. Yeah, sounds good, but off-hand I have no idea how to do this per-directory. Just add it to AM_CPPFLAGS in the directories you care about. But only if the compiler is gcc, right? Something like: if GCC AM_CPPFLAGS += -Wdeclaration-after-statement endif Just like we do other compiler-dependent stuff -- detect compiler in configure.ac, AC_SUBST a variable conditionally containing the flag, then use it where you want. Actually, this would need to be AM_CFLAGS and AM_CXXFLAGS, since it's a compiler option, not a preprocessor option. VISIBILITY_CFLAGS would be an example. pgpsvIeyUbBCH.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Remove GL_EXT_clip_volume_hint
On 06/27/2013 11:53 AM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com As far as I can tell, no driver has enabled this extension since c6499a7 back in 2007. Signed-off-by: Ian Romanick ian.d.roman...@intel.com Reviewed-by: Kenneth Graunke kenn...@whitecape.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 64959] Cannot build against EGL without X11
https://bugs.freedesktop.org/show_bug.cgi?id=64959 Chad Versace chad.vers...@linux.intel.com changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|mesa-dev@lists.freedesktop. |ross.bur...@intel.com |org | --- Comment #10 from Chad Versace chad.vers...@linux.intel.com --- [Assigning to Ross]. Ross, both these patches look good to me and are Reviewed-by: Chad Versace chad.vers...@linux.intel.com To ensure that the patches get backported to the stable branches 9.0 and 9.1 (because that's where the bug is really biting you), add the following tag above the signed-off line: Note: This patch is a candidate for the 9.0 and 9.1 branches. Please mail them to mesa-dev so they can get reviewed and committed. -- 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] R600 Patches: KCache kernel arguments and 24-bit arithmetic
The whole serie is : reviewed-by:Vincent Lejeune vljn at ovi.com In a future patch we might also remove the ISD::BUILD_VECTOR case in the Select() function and use a tablegen pattern ; I wrote it because we lowered r600.load.input intrinsic to a raw register ; however now we lower it to a copy from a register which should be convertible to a REG_SEQUENCE. Vincent - Mail original - De : Tom Stellard t...@stellard.net À : llvm-comm...@cs.uiuc.edu Cc : mesa-dev@lists.freedesktop.org Envoyé le : Mardi 25 juin 2013 23h37 Objet : [Mesa-dev] R600 Patches: KCache kernel arguments and 24-bit arithmetic Hi, The attached patches clean up kernel argument handling for both R600 and SI and for R600 makes it possible to read arguments through the KCache. There are also patches that add support for the 24-bit arithmetic instructions (MAD_UINT24, MAD_INT24, MUL_UINT24, and MUL_INT24). In order to test these patches with you will also need to apply the corresponding Mesa patches which will be on the mailing list soon. -Tom ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: NULL check depth_mt to quiet static analysis.
On 06/27/2013 11:41 AM, Matt Turner wrote: --- I think (depth_irb == NULL) iff (depth_mt == NULL) and the same for stencil_irb and stencil_mt. I can understand how static analysis tools would miss this, since I haven't been able to prove it to myself either. It sucks that we keep depth_mt and stencil_mt in global state separate from the corresponding renderbuffers. But, each time I tried to remove the global brw-depthstencil.{depth,stencil}_mt vars, I encountered some problems in the disentanglement. Perhaps I didn't try hard enough. Anyway, this makes static analysis happy and adds only epsilon additional cycles. Reviewed-by: Chad Versace chad.vers...@linux.intel.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
On 06/27/2013 02:20 PM, Anuj Phogat wrote: Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) I don't like this. I would just put an abort() below the _mesa_problem in get_src_register_pointer. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] r600g/sb: Fix Android build
From: Chih-Wei Huang cwhu...@android-x86.org Add the sb CXX files to the Android Makefile and also stop using some c++11 features. --- src/gallium/drivers/r600/Android.mk | 5 +++-- src/gallium/drivers/r600/sb/sb_bc.h | 4 ++-- src/gallium/drivers/r600/sb/sb_ra_init.cpp | 2 +- src/gallium/drivers/r600/sb/sb_valtable.cpp | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/r600/Android.mk b/src/gallium/drivers/r600/Android.mk index e5188bb..4d2f69f 100644 --- a/src/gallium/drivers/r600/Android.mk +++ b/src/gallium/drivers/r600/Android.mk @@ -28,11 +28,12 @@ include $(LOCAL_PATH)/Makefile.sources include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(C_SOURCES) +LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES) -LOCAL_C_INCLUDES := +LOCAL_C_INCLUDES := $(DRM_TOP) LOCAL_MODULE := libmesa_pipe_r600 +include external/stlport/libstlport.mk include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h index 25255a7..73c250d 100644 --- a/src/gallium/drivers/r600/sb/sb_bc.h +++ b/src/gallium/drivers/r600/sb/sb_bc.h @@ -846,7 +846,7 @@ public: unsigned ndw() { return bc.size(); } void write_data(uint32_t* dst) { - memcpy(dst, bc.data(), 4 * bc.size()); + std::copy(bc.begin(), bc.end(), dst); } void align(unsigned a) { @@ -870,7 +870,7 @@ public: } unsigned get_pos() { return pos; } - uint32_t *data() { return bc.data(); } + uint32_t *data() { return bc.begin(); } bytecode operator (uint32_t v) { if (pos == ndw()) { diff --git a/src/gallium/drivers/r600/sb/sb_ra_init.cpp b/src/gallium/drivers/r600/sb/sb_ra_init.cpp index bfe5ab9..24b24a0 100644 --- a/src/gallium/drivers/r600/sb/sb_ra_init.cpp +++ b/src/gallium/drivers/r600/sb/sb_ra_init.cpp @@ -680,7 +680,7 @@ void ra_split::split_vec(vvec vv, vvec v1, vvec v2, bool allow_swz) { value *t; vvec::iterator F = - allow_swz ? find(v2.begin(), v2.end(), o) : v2.end(); + allow_swz ? std::find(v2.begin(), v2.end(), o) : v2.end(); if (F != v2.end()) { t = *(v1.begin() + (F - v2.begin())); diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp b/src/gallium/drivers/r600/sb/sb_valtable.cpp index 5e6aca0..00aee66 100644 --- a/src/gallium/drivers/r600/sb/sb_valtable.cpp +++ b/src/gallium/drivers/r600/sb/sb_valtable.cpp @@ -207,7 +207,7 @@ void value_table::get_values(vvec v) { for(vt_table::iterator I = hashtable.begin(), E = hashtable.end(); I != E; ++I) { - T = copy(I-begin(), I-end(), T); + T = std::copy(I-begin(), I-end(), T); } } @@ -368,7 +368,7 @@ inline bool sb_bitset::set_chk(unsigned id, bool bit) { } void sb_bitset::clear() { - memset(data.data(), 0, sizeof(basetype) * data.size()); + std::fill(data.begin(), data.end(), 0); } void sb_bitset::resize(unsigned size) { -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] draw/gallivm: export overflow arithmetic to its own file
Series looks great. Thanks. Jose - Original Message - We'll be reusing this code so lets put it in a common file and use it in the draw module. Signed-off-by: Zack Rusin za...@vmware.com --- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/draw/draw_llvm.c | 55 ++- .../auxiliary/gallivm/lp_bld_arit_overflow.c | 165 .../auxiliary/gallivm/lp_bld_arit_overflow.h | 57 +++ 4 files changed, 234 insertions(+), 44 deletions(-) create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 20ff5ba..4751762 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -163,6 +163,7 @@ GENERATED_SOURCES := \ GALLIVM_SOURCES := \ gallivm/lp_bld_arit.c \ +gallivm/lp_bld_arit_overflow.c \ gallivm/lp_bld_assert.c \ gallivm/lp_bld_bitarit.c \ gallivm/lp_bld_const.c \ diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 33cccfe..97b463f 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -32,6 +32,7 @@ #include draw_gs.h #include gallivm/lp_bld_arit.h +#include gallivm/lp_bld_arit_overflow.h #include gallivm/lp_bld_logic.h #include gallivm/lp_bld_const.h #include gallivm/lp_bld_swizzle.h @@ -699,13 +700,7 @@ generate_fetch(struct gallivm_state *gallivm, LLVMValueRef temp_ptr = lp_build_alloca(gallivm, lp_build_vec_type(gallivm, lp_float32_vec4_type()), ); - LLVMValueRef ofbit, oresult; - LLVMTypeRef oelems[2] = { - LLVMInt32TypeInContext(gallivm-context), - LLVMInt1TypeInContext(gallivm-context) - }; - LLVMTypeRef otype = LLVMStructTypeInContext(gallivm-context, - oelems, 2, FALSE); + LLVMValueRef ofbit = NULL; struct lp_build_if_state if_ctx; if (velem-instance_divisor) { @@ -715,44 +710,16 @@ generate_fetch(struct gallivm_state *gallivm, instance_divisor); } - oresult = lp_build_intrinsic_binary(builder, - llvm.umul.with.overflow.i32, - otype, vb_stride, index); - ofbit = LLVMBuildExtractValue(builder, oresult, 1, ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - oresult = lp_build_intrinsic_binary(builder, - llvm.uadd.with.overflow.i32, - otype, stride, vb_buffer_offset); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - oresult = lp_build_intrinsic_binary( - builder, - llvm.uadd.with.overflow.i32, - otype, stride, - lp_build_const_int32(gallivm, velem-src_offset)); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - stride = LLVMBuildExtractValue(builder, oresult, 0, ); - - - oresult = lp_build_intrinsic_binary( - builder, - llvm.uadd.with.overflow.i32, - otype, stride, + stride = lp_build_umul_overflow(gallivm, vb_stride, index, ofbit); + stride = lp_build_uadd_overflow(gallivm, stride, vb_buffer_offset, ofbit); + stride = lp_build_uadd_overflow( + gallivm, stride, + lp_build_const_int32(gallivm, velem-src_offset), ofbit); + needed_buffer_size = lp_build_uadd_overflow( + gallivm, stride, lp_build_const_int32(gallivm, - util_format_get_blocksize(velem-src_format))); - ofbit = LLVMBuildOr( - builder, ofbit, - LLVMBuildExtractValue(builder, oresult, 1, ), - ); - needed_buffer_size = LLVMBuildExtractValue(builder, oresult, 0, ); + util_format_get_blocksize(velem-src_format)), + ofbit); buffer_overflowed = LLVMBuildICmp(builder, LLVMIntUGT, needed_buffer_size, buffer_size, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c b/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c new file mode 100644 index 000..f17e17a --- /dev/null +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit_overflow.c @@ -0,0 +1,165 @@ +/** + * + * Copyright 2013 + * 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
[Mesa-dev] [PATCH] configure.ac: better detection of LLVM version
--- configure.ac | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 6832b0d..3cabfe8 100644 --- a/configure.ac +++ b/configure.ac @@ -1577,8 +1577,26 @@ if test x$enable_gallium_llvm = xyes; then fi if test x$LLVM_CONFIG != xno; then - LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'` - LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` +LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'` +LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` +LLVM_BINDIR=`$LLVM_CONFIG --bindir` +LLVM_CPPFLAGS=`strip_unwanted_llvm_flags $LLVM_CONFIG --cppflags` +LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient +LLVM_CXXFLAGS=`strip_unwanted_llvm_flags $LLVM_CONFIG --cxxflags` +LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` +LLVM_LIBDIR=`$LLVM_CONFIG --libdir` + +AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR], +[#include ${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h]) +AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR], +[#include ${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h]) + +if test x${LLVM_VERSION_MAJOR} != x; then +LLVM_VERSION_INT=${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR} +else +LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` +fi + LLVM_COMPONENTS=engine bitwriter if $LLVM_CONFIG --components | grep -q '\mcjit\'; then LLVM_COMPONENTS=${LLVM_COMPONENTS} mcjit @@ -1591,17 +1609,10 @@ if test x$enable_gallium_llvm = xyes; then LLVM_COMPONENTS=${LLVM_COMPONENTS} irreader fi fi - LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` - LLVM_BINDIR=`$LLVM_CONFIG --bindir` - LLVM_CPPFLAGS=`strip_unwanted_llvm_flags $LLVM_CONFIG --cppflags` - LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient - LLVM_CXXFLAGS=`strip_unwanted_llvm_flags $LLVM_CONFIG --cxxflags` - LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` - LLVM_LIBDIR=`$LLVM_CONFIG --libdir` - DEFINES=${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT - MESA_LLVM=1 - - dnl Check for Clang interanl headers +DEFINES=${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT +MESA_LLVM=1 + +dnl Check for Clang internal headers if test x$enable_opencl = xyes; then if test x$CLANG_LIBDIR = x; then CLANG_LIBDIR=${LLVM_LIBDIR} @@ -1611,8 +1622,8 @@ if test x$enable_gallium_llvm = xyes; then AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])) fi else - MESA_LLVM=0 - LLVM_VERSION_INT=0 +MESA_LLVM=0 +LLVM_VERSION_INT=0 fi else MESA_LLVM=0 -- 1.8.1.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
On 06/27/2013 03:31 PM, Kenneth Graunke wrote: On 06/27/2013 02:20 PM, Anuj Phogat wrote: Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) I don't like this. I would just put an abort() below the _mesa_problem in get_src_register_pointer. For release builds I don't think that we ever want to abort/exit. I think the only time get_src_register_pointer() can return NULL is for the case of an invalid register file. And we could instead return the ZeroVec there. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
On 06/27/2013 02:31 PM, Kenneth Graunke wrote: On 06/27/2013 02:20 PM, Anuj Phogat wrote: Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) I don't like this. I would just put an abort() below the _mesa_problem in get_src_register_pointer. Or return ZeroVec instead of NULL. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
On Thu, Jun 27, 2013 at 2:59 PM, Brian Paul bri...@vmware.com wrote: On 06/27/2013 03:31 PM, Kenneth Graunke wrote: On 06/27/2013 02:20 PM, Anuj Phogat wrote: Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) I don't like this. I would just put an abort() below the _mesa_problem in get_src_register_pointer. For release builds I don't think that we ever want to abort/exit. I think the only time get_src_register_pointer() can return NULL is for the case of an invalid register file. And we could instead return the ZeroVec there. Yes. This is a better option for get_src_register_pointer(). But I think we can't return ZeroVec (a const float*) instead of NULL in get_dst_register_pointer(). Should we return dummyReg instead? -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: Add null pointer checks before dereferencing
On 06/27/2013 04:51 PM, Anuj Phogat wrote: On Thu, Jun 27, 2013 at 2:59 PM, Brian Paul bri...@vmware.com wrote: On 06/27/2013 03:31 PM, Kenneth Graunke wrote: On 06/27/2013 02:20 PM, Anuj Phogat wrote: Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, add explicit null pointer checks in the code. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..1bcbf6b 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -200,6 +200,8 @@ fetch_vector4(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -303,6 +305,8 @@ fetch_vector1(const struct prog_src_register *source, { const GLfloat *src = get_src_register_pointer(source, machine); ASSERT(src); + if (src == NULL) + return; result[0] = src[GET_SWZ(source-Swizzle, 0)]; @@ -320,6 +324,9 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + ASSERT(src); + if (src == NULL) + return 0; return src[GET_SWZ(source-Swizzle, 0)]; } @@ -1439,8 +1446,11 @@ _mesa_execute_program(struct gl_context * ctx, { const struct prog_src_register *source = inst-SrcReg[0]; const GLfloat *src = get_src_register_pointer(source, machine); +ASSERT(src); GLfloat result[4]; GLuint i; +if (src == NULL) + return GL_FALSE; for (i = 0; i 4; i++) { const GLuint swz = GET_SWZ(source-Swizzle, i); if (swz == SWIZZLE_ZERO) I don't like this. I would just put an abort() below the _mesa_problem in get_src_register_pointer. For release builds I don't think that we ever want to abort/exit. I think the only time get_src_register_pointer() can return NULL is for the case of an invalid register file. And we could instead return the ZeroVec there. Yes. This is a better option for get_src_register_pointer(). But I think we can't return ZeroVec (a const float*) instead of NULL in get_dst_register_pointer(). Should we return dummyReg instead? Probably. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 66236] glext.h:4609: error: redefinition of typedef 'GLclampf'
https://bugs.freedesktop.org/show_bug.cgi?id=66236 --- Comment #12 from Brian Paul bri...@vmware.com --- Your patch works for me and looks good, Tom. But the comment in glheader.h about GL_FIXED should be updated/removed too. Feel free to commit/push. Reviewed-by: Brian Paul bri...@vmware.com Thanks. -- 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
[Mesa-dev] [PATCH] mesa: Return ZeroVec/dummyReg instead of NULL pointer
Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, return ZeroVec/dummyReg instead of NULL pointer in get_{src,dst}_register_pointer(). This should calm down static analysis tool. Signed-off-by: Anuj Phogat anuj.pho...@gmail.com --- src/mesa/program/prog_execute.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b902006..560332a 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -145,7 +145,7 @@ get_src_register_pointer(const struct prog_src_register *source, _mesa_problem(NULL, Invalid src register file %d in get_src_register_pointer(), source-File); - return NULL; + return ZeroVec; } } @@ -184,7 +184,7 @@ get_dst_register_pointer(const struct prog_dst_register *dest, _mesa_problem(NULL, Invalid dest register file %d in get_dst_register_pointer(), dest-File); - return NULL; + return dummyReg; } } @@ -199,7 +199,6 @@ fetch_vector4(const struct prog_src_register *source, const struct gl_program_machine *machine, GLfloat result[4]) { const GLfloat *src = get_src_register_pointer(source, machine); - ASSERT(src); if (source-Swizzle == SWIZZLE_NOOP) { /* no swizzling */ @@ -302,7 +301,6 @@ fetch_vector1(const struct prog_src_register *source, const struct gl_program_machine *machine, GLfloat result[4]) { const GLfloat *src = get_src_register_pointer(source, machine); - ASSERT(src); result[0] = src[GET_SWZ(source-Swizzle, 0)]; -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] gallivm: do per-pixel lod calculations for explicit lod
From: Roland Scheidegger srol...@vmware.com d3d10 requires per-pixel lod calculations for explicit lod, lod bias and explicit derivatives, and we should probably do it for OpenGL too - at least if they are used from vertex or geometry shaders (so doesn't apply to lod bias) this doesn't just affect neighboring pixels. Some code was already there to handle this so fix it up and enable it. There will no doubt be a performance hit unfortunately, we could do better if we'd knew we had a real vector shift instruction (with variable shift count) but this requires AVX2 on x86 (or a AMD Bulldozer family cpu). Don't do anything for lod bias and explicit derivatives yet, though no special magic should be needed for them neither. Likewise, the size query is still broken just the same. --- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 110 +- src/gallium/auxiliary/gallivm/lp_bld_sample.h | 12 +- src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c | 26 ++--- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 128 + 4 files changed, 155 insertions(+), 121 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index d689c7b..c2efec9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -215,7 +215,7 @@ lp_build_rho(struct lp_build_sample_context *bld, struct lp_build_context *float_size_bld = bld-float_size_in_bld; struct lp_build_context *float_bld = bld-float_bld; struct lp_build_context *coord_bld = bld-coord_bld; - struct lp_build_context *perquadf_bld = bld-perquadf_bld; + struct lp_build_context *levelf_bld = bld-levelf_bld; const unsigned dims = bld-dims; LLVMValueRef ddx_ddy[2]; LLVMBuilderRef builder = bld-gallivm-builder; @@ -235,6 +235,8 @@ lp_build_rho(struct lp_build_sample_context *bld, /* Note that all simplified calculations will only work for isotropic filtering */ + assert(bld-num_lods != length); + first_level = bld-dynamic_state-first_level(bld-dynamic_state, bld-gallivm, texture_unit); first_level_vec = lp_build_broadcast_scalar(int_size_bld, first_level); @@ -248,14 +250,14 @@ lp_build_rho(struct lp_build_sample_context *bld, * Cube map code did already everything except size mul and per-quad extraction. */ rho = lp_build_pack_aos_scalars(bld-gallivm, coord_bld-type, - perquadf_bld-type, cube_rho, 0); + levelf_bld-type, cube_rho, 0); if (gallivm_debug GALLIVM_DEBUG_NO_RHO_APPROX) { - rho = lp_build_sqrt(perquadf_bld, rho); + rho = lp_build_sqrt(levelf_bld, rho); } /* Could optimize this for single quad just skip the broadcast */ cubesize = lp_build_extract_broadcast(gallivm, bld-float_size_in_type, -perquadf_bld-type, float_size, index0); - rho = lp_build_mul(perquadf_bld, cubesize, rho); +levelf_bld-type, float_size, index0); + rho = lp_build_mul(levelf_bld, cubesize, rho); } else if (derivs !(bld-static_texture_state-target == PIPE_TEXTURE_CUBE)) { LLVMValueRef ddmax[3], ddx[3], ddy[3]; @@ -289,12 +291,12 @@ lp_build_rho(struct lp_build_sample_context *bld, } rho_vec = lp_build_max(coord_bld, rho_xvec, rho_yvec); rho = lp_build_pack_aos_scalars(bld-gallivm, coord_bld-type, - perquadf_bld-type, rho_vec, 0); + levelf_bld-type, rho_vec, 0); /* * note that as long as we don't care about per-pixel lod could reduce math * more (at some shuffle cost), but for now only do sqrt after packing. */ - rho = lp_build_sqrt(perquadf_bld, rho); + rho = lp_build_sqrt(levelf_bld, rho); } else { rho_vec = ddmax[0]; @@ -309,7 +311,7 @@ lp_build_rho(struct lp_build_sample_context *bld, * since we can't handle per-pixel rho/lod from now on (TODO). */ rho = lp_build_pack_aos_scalars(bld-gallivm, coord_bld-type, - perquadf_bld-type, rho_vec, 0); + levelf_bld-type, rho_vec, 0); } } else { @@ -381,8 +383,8 @@ lp_build_rho(struct lp_build_sample_context *bld, rho_vec = lp_build_max(coord_bld, rho_xvec, rho_yvec); rho = lp_build_pack_aos_scalars(bld-gallivm, coord_bld-type, - perquadf_bld-type, rho_vec, 0); - rho = lp_build_sqrt(perquadf_bld, rho); + levelf_bld-type, rho_vec, 0); + rho = lp_build_sqrt(levelf_bld, rho); } else { ddx_ddy[0] =
[Mesa-dev] [PATCH 00/21] Extension clean up
This is my annual extension clean up blob. I don't expect much here to be controversial (or even interesting to read) except patches 12, 17, 18, and 21. docs/relnotes/9.2.html | 3 + src/mapi/glapi/gen/gl_API.xml | 2 +- src/mapi/glapi/gen/mesadef.py | 1 - src/mesa/drivers/common/meta.c | 28 ++-- src/mesa/drivers/dri/i915/intel_extensions.c | 87 + src/mesa/drivers/dri/i965/intel_extensions.c | 129 -- src/mesa/drivers/dri/nouveau/nouveau_context.c | 4 - src/mesa/drivers/dri/r200/r200_context.c | 4 - src/mesa/drivers/dri/radeon/radeon_context.c | 4 - src/mesa/drivers/dri/swrast/swrast.c | 56 src/mesa/drivers/osmesa/osmesa.c | 5 - src/mesa/drivers/windows/gdi/mesa.def | 1 - src/mesa/drivers/windows/gdi/wmesa.c | 5 - src/mesa/drivers/x11/xm_api.c | 11 +- src/mesa/main/blend.c | 2 - src/mesa/main/buffers.c| 1 - src/mesa/main/enable.c | 6 +- src/mesa/main/extensions.c | 173 +++-- src/mesa/main/extensions.h | 16 --- src/mesa/main/fbobject.c | 7 - src/mesa/main/fog.c| 2 +- src/mesa/main/framebuffer.c| 10 -- src/mesa/main/framebuffer.h| 4 - src/mesa/main/get.c| 17 --- src/mesa/main/get_hash_params.py | 36 ++--- src/mesa/main/getstring.c | 5 - src/mesa/main/mtypes.h | 10 -- src/mesa/main/samplerobj.c | 12 +- src/mesa/main/tests/dispatch_sanity.cpp| 3 - src/mesa/main/teximage.c | 9 +- src/mesa/main/texparam.c | 26 +--- src/mesa/main/version.c| 9 +- src/mesa/program/program_parse.y | 10 -- src/mesa/state_tracker/st_extensions.c | 8 -- 34 files changed, 127 insertions(+), 579 deletions(-) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/21] i965: Move GEN = 3 extensions into the always on list
From: Ian Romanick ian.d.roman...@intel.com This copy of the source file is only used for GEN = 4, so extensions that are enabled for GEN = 3 are always enabled. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 33 ++-- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 5cb2fa3..1c80bf7 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -42,21 +42,30 @@ intelInitExtensions(struct gl_context *ctx) { struct intel_context *intel = intel_context(ctx); + assert(intel-gen = 4); + + ctx-Extensions.ARB_depth_texture = true; ctx-Extensions.ARB_draw_elements_base_vertex = true; + ctx-Extensions.ARB_ES2_compatibility = true; ctx-Extensions.ARB_explicit_attrib_location = true; + ctx-Extensions.ARB_fragment_program = true; + ctx-Extensions.ARB_fragment_shader = true; ctx-Extensions.ARB_framebuffer_object = true; ctx-Extensions.ARB_half_float_pixel = true; ctx-Extensions.ARB_internalformat_query = true; ctx-Extensions.ARB_map_buffer_range = true; + ctx-Extensions.ARB_occlusion_query = true; ctx-Extensions.ARB_point_sprite = true; ctx-Extensions.ARB_shader_objects = true; ctx-Extensions.ARB_shading_language_100 = true; + ctx-Extensions.ARB_shadow = true; ctx-Extensions.ARB_sync = true; ctx-Extensions.ARB_texture_border_clamp = true; ctx-Extensions.ARB_texture_cube_map = true; ctx-Extensions.ARB_texture_env_combine = true; ctx-Extensions.ARB_texture_env_crossbar = true; ctx-Extensions.ARB_texture_env_dot3 = true; + ctx-Extensions.ARB_texture_non_power_of_two = true; ctx-Extensions.ARB_texture_storage = true; ctx-Extensions.ARB_vertex_program = true; ctx-Extensions.ARB_vertex_shader = true; @@ -76,10 +85,17 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_separate_shader_objects = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; + ctx-Extensions.EXT_texture_sRGB = true; + ctx-Extensions.EXT_texture_sRGB_decode = true; + ctx-Extensions.EXT_shadow_funcs = true; + ctx-Extensions.EXT_stencil_two_side = true; ctx-Extensions.APPLE_object_purgeable = true; + ctx-Extensions.ATI_separate_stencil = true; + ctx-Extensions.ATI_texture_env_combine3 = true; ctx-Extensions.MESA_pack_invert = true; ctx-Extensions.MESA_ycbcr_texture = true; ctx-Extensions.NV_blend_square = true; + ctx-Extensions.NV_texture_env_combine4 = true; ctx-Extensions.NV_texture_rectangle = true; ctx-Extensions.TDFX_texture_compression_FXT1 = true; ctx-Extensions.OES_EGL_image = true; @@ -159,23 +175,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.OES_standard_derivatives = true; } - if (intel-gen = 3) { - ctx-Extensions.ARB_ES2_compatibility = true; - ctx-Extensions.ARB_depth_texture = true; - ctx-Extensions.ARB_fragment_program = true; - ctx-Extensions.ARB_shadow = true; - ctx-Extensions.ARB_texture_non_power_of_two = true; - ctx-Extensions.EXT_texture_sRGB = true; - ctx-Extensions.EXT_texture_sRGB_decode = true; - ctx-Extensions.EXT_shadow_funcs = true; - ctx-Extensions.EXT_stencil_two_side = true; - ctx-Extensions.ATI_separate_stencil = true; - ctx-Extensions.ATI_texture_env_combine3 = true; - ctx-Extensions.NV_texture_env_combine4 = true; - ctx-Extensions.ARB_fragment_shader = true; - ctx-Extensions.ARB_occlusion_query = true; - } - if (intel-ctx.Mesa_DXTn || driQueryOptionb(intel-optionCache, force_s3tc_enable)) ctx-Extensions.EXT_texture_compression_s3tc = true; -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 01/21] i915: Remove GEN = 4 extension support
From: Ian Romanick ian.d.roman...@intel.com This copy of the source file is only used for GEN = 3, so remove the dead code. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 79 ++-- 1 file changed, 3 insertions(+), 76 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 5cb2fa3..ac6aefa 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -42,6 +42,8 @@ intelInitExtensions(struct gl_context *ctx) { struct intel_context *intel = intel_context(ctx); + assert(intel-gen == 2 || intel-gen == 3); + ctx-Extensions.ARB_draw_elements_base_vertex = true; ctx-Extensions.ARB_explicit_attrib_location = true; ctx-Extensions.ARB_framebuffer_object = true; @@ -85,80 +87,9 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.OES_EGL_image = true; ctx-Extensions.OES_draw_texture = true; - if (intel-gen = 6) - ctx-Const.GLSLVersion = 140; - else - ctx-Const.GLSLVersion = 120; + ctx-Const.GLSLVersion = 120; _mesa_override_glsl_version(ctx); - if (intel-gen = 6) { - ctx-Extensions.EXT_framebuffer_multisample = true; - ctx-Extensions.EXT_transform_feedback = true; - ctx-Extensions.ARB_blend_func_extended = !driQueryOptionb(intel-optionCache, disable_blend_func_extended); - ctx-Extensions.ARB_draw_buffers_blend = true; - ctx-Extensions.ARB_ES3_compatibility = true; - ctx-Extensions.ARB_uniform_buffer_object = true; - ctx-Extensions.ARB_texture_buffer_object = true; - ctx-Extensions.ARB_texture_buffer_object_rgb32 = true; - ctx-Extensions.ARB_texture_cube_map_array = true; - ctx-Extensions.OES_depth_texture_cube_map = true; - ctx-Extensions.ARB_shading_language_packing = true; - ctx-Extensions.ARB_texture_multisample = true; - ctx-Extensions.ARB_texture_storage_multisample = true; - } - - if (intel-gen = 5) { - ctx-Extensions.ARB_texture_query_lod = true; - ctx-Extensions.EXT_timer_query = true; - } - - if (intel-gen = 6) { - uint64_t dummy; - /* Test if the kernel has the ioctl. */ - if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) - ctx-Extensions.ARB_timer_query = true; - } - - if (intel-gen = 4) { - if (ctx-API == API_OPENGL_CORE) - ctx-Extensions.ARB_base_instance = true; - if (ctx-API != API_OPENGL_CORE) - ctx-Extensions.ARB_color_buffer_float = true; - ctx-Extensions.ARB_depth_buffer_float = true; - ctx-Extensions.ARB_depth_clamp = true; - ctx-Extensions.ARB_draw_instanced = true; - ctx-Extensions.ARB_instanced_arrays = true; - ctx-Extensions.ARB_fragment_coord_conventions = true; - ctx-Extensions.ARB_fragment_program_shadow = true; - ctx-Extensions.ARB_fragment_shader = true; - ctx-Extensions.ARB_half_float_vertex = true; - ctx-Extensions.ARB_occlusion_query = true; - ctx-Extensions.ARB_occlusion_query2 = true; - ctx-Extensions.ARB_point_sprite = true; - ctx-Extensions.ARB_seamless_cube_map = true; - ctx-Extensions.ARB_shader_bit_encoding = true; - ctx-Extensions.ARB_shader_texture_lod = true; - ctx-Extensions.ARB_texture_float = true; - ctx-Extensions.EXT_texture_shared_exponent = true; - ctx-Extensions.EXT_packed_float = true; - ctx-Extensions.ARB_texture_compression_rgtc = true; - ctx-Extensions.ARB_texture_rg = true; - ctx-Extensions.ARB_texture_rgb10_a2ui = true; - ctx-Extensions.ARB_vertex_type_2_10_10_10_rev = true; - ctx-Extensions.EXT_draw_buffers2 = true; - ctx-Extensions.EXT_framebuffer_sRGB = true; - ctx-Extensions.EXT_texture_array = true; - ctx-Extensions.EXT_texture_integer = true; - ctx-Extensions.EXT_texture_snorm = true; - ctx-Extensions.EXT_texture_swizzle = true; - ctx-Extensions.EXT_vertex_array_bgra = true; - ctx-Extensions.ATI_envmap_bumpmap = true; - ctx-Extensions.MESA_texture_array = true; - ctx-Extensions.NV_conditional_render = true; - ctx-Extensions.OES_compressed_ETC1_RGB8_texture = true; - ctx-Extensions.OES_standard_derivatives = true; - } - if (intel-gen = 3) { ctx-Extensions.ARB_ES2_compatibility = true; ctx-Extensions.ARB_depth_texture = true; @@ -181,8 +112,4 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_texture_compression_s3tc = true; ctx-Extensions.ANGLE_texture_compression_dxt = true; - - if (intel-gen = 4) { - ctx-Extensions.NV_primitive_restart = true; - } } -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/21] i965: Move GEN = 4 extensions into the always on list
From: Ian Romanick ian.d.roman...@intel.com This copy of the source file is only used for GEN = 4, so extensions that are enabled for GEN = 4 are always enabled. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 78 +--- 1 file changed, 35 insertions(+), 43 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 1c80bf7..f9f4ad9 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -44,62 +44,93 @@ intelInitExtensions(struct gl_context *ctx) assert(intel-gen = 4); + ctx-Extensions.ARB_depth_buffer_float = true; + ctx-Extensions.ARB_depth_clamp = true; ctx-Extensions.ARB_depth_texture = true; ctx-Extensions.ARB_draw_elements_base_vertex = true; + ctx-Extensions.ARB_draw_instanced = true; ctx-Extensions.ARB_ES2_compatibility = true; ctx-Extensions.ARB_explicit_attrib_location = true; + ctx-Extensions.ARB_fragment_coord_conventions = true; ctx-Extensions.ARB_fragment_program = true; + ctx-Extensions.ARB_fragment_program_shadow = true; ctx-Extensions.ARB_fragment_shader = true; ctx-Extensions.ARB_framebuffer_object = true; ctx-Extensions.ARB_half_float_pixel = true; + ctx-Extensions.ARB_half_float_vertex = true; + ctx-Extensions.ARB_instanced_arrays = true; ctx-Extensions.ARB_internalformat_query = true; ctx-Extensions.ARB_map_buffer_range = true; ctx-Extensions.ARB_occlusion_query = true; + ctx-Extensions.ARB_occlusion_query2 = true; ctx-Extensions.ARB_point_sprite = true; + ctx-Extensions.ARB_seamless_cube_map = true; + ctx-Extensions.ARB_shader_bit_encoding = true; ctx-Extensions.ARB_shader_objects = true; + ctx-Extensions.ARB_shader_texture_lod = true; ctx-Extensions.ARB_shading_language_100 = true; ctx-Extensions.ARB_shadow = true; ctx-Extensions.ARB_sync = true; ctx-Extensions.ARB_texture_border_clamp = true; + ctx-Extensions.ARB_texture_compression_rgtc = true; ctx-Extensions.ARB_texture_cube_map = true; ctx-Extensions.ARB_texture_env_combine = true; ctx-Extensions.ARB_texture_env_crossbar = true; ctx-Extensions.ARB_texture_env_dot3 = true; + ctx-Extensions.ARB_texture_float = true; ctx-Extensions.ARB_texture_non_power_of_two = true; + ctx-Extensions.ARB_texture_rg = true; + ctx-Extensions.ARB_texture_rgb10_a2ui = true; ctx-Extensions.ARB_texture_storage = true; ctx-Extensions.ARB_vertex_program = true; ctx-Extensions.ARB_vertex_shader = true; + ctx-Extensions.ARB_vertex_type_2_10_10_10_rev = true; ctx-Extensions.EXT_blend_color = true; ctx-Extensions.EXT_blend_equation_separate = true; ctx-Extensions.EXT_blend_func_separate = true; ctx-Extensions.EXT_blend_minmax = true; + ctx-Extensions.EXT_draw_buffers2 = true; ctx-Extensions.EXT_framebuffer_blit = true; ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.EXT_fog_coord = true; + ctx-Extensions.EXT_framebuffer_sRGB = true; ctx-Extensions.EXT_gpu_program_parameters = true; ctx-Extensions.EXT_packed_depth_stencil = true; + ctx-Extensions.EXT_packed_float = true; ctx-Extensions.EXT_pixel_buffer_object = true; ctx-Extensions.EXT_point_parameters = true; ctx-Extensions.EXT_provoking_vertex = true; ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_separate_shader_objects = true; + ctx-Extensions.EXT_texture_array = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; + ctx-Extensions.EXT_texture_integer = true; + ctx-Extensions.EXT_texture_shared_exponent = true; + ctx-Extensions.EXT_texture_snorm = true; ctx-Extensions.EXT_texture_sRGB = true; ctx-Extensions.EXT_texture_sRGB_decode = true; + ctx-Extensions.EXT_texture_swizzle = true; ctx-Extensions.EXT_shadow_funcs = true; ctx-Extensions.EXT_stencil_two_side = true; + ctx-Extensions.EXT_vertex_array_bgra = true; ctx-Extensions.APPLE_object_purgeable = true; + ctx-Extensions.ATI_envmap_bumpmap = true; ctx-Extensions.ATI_separate_stencil = true; ctx-Extensions.ATI_texture_env_combine3 = true; ctx-Extensions.MESA_pack_invert = true; + ctx-Extensions.MESA_texture_array = true; ctx-Extensions.MESA_ycbcr_texture = true; ctx-Extensions.NV_blend_square = true; + ctx-Extensions.NV_conditional_render = true; + ctx-Extensions.NV_primitive_restart = true; ctx-Extensions.NV_texture_env_combine4 = true; ctx-Extensions.NV_texture_rectangle = true; ctx-Extensions.TDFX_texture_compression_FXT1 = true; + ctx-Extensions.OES_compressed_ETC1_RGB8_texture = true; ctx-Extensions.OES_EGL_image = true; ctx-Extensions.OES_draw_texture = true; + ctx-Extensions.OES_standard_derivatives = true; if (intel-gen = 6) ctx-Const.GLSLVersion = 140; @@ -135,53
[Mesa-dev] [PATCH 04/21] i965: Merge the two GEN = 6 extension enable blocks
From: Ian Romanick ian.d.roman...@intel.com There's no reason for these blocks to be separate. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index f9f4ad9..d70655b 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -139,6 +139,8 @@ intelInitExtensions(struct gl_context *ctx) _mesa_override_glsl_version(ctx); if (intel-gen = 6) { + uint64_t dummy; + ctx-Extensions.EXT_framebuffer_multisample = true; ctx-Extensions.EXT_transform_feedback = true; ctx-Extensions.ARB_blend_func_extended = !driQueryOptionb(intel-optionCache, disable_blend_func_extended); @@ -152,6 +154,10 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_shading_language_packing = true; ctx-Extensions.ARB_texture_multisample = true; ctx-Extensions.ARB_texture_storage_multisample = true; + + /* Test if the kernel has the ioctl. */ + if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) + ctx-Extensions.ARB_timer_query = true; } if (intel-gen = 5) { @@ -159,13 +165,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_timer_query = true; } - if (intel-gen = 6) { - uint64_t dummy; - /* Test if the kernel has the ioctl. */ - if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) - ctx-Extensions.ARB_timer_query = true; - } - if (ctx-API == API_OPENGL_CORE) ctx-Extensions.ARB_base_instance = true; if (ctx-API != API_OPENGL_CORE) -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 05/21] x11: Don't call _mesa_enable_._._extensions and _mesa_enable_sw_extensions
From: Ian Romanick ian.d.roman...@intel.com _mesa_enable_sw_extensions enables all the extensions (and more) that the others enable. Also, don't duplicate the DXTn checks. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/x11/xm_api.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index b7c94aa..ac290a5 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -922,16 +922,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) } _mesa_enable_sw_extensions(mesaCtx); - _mesa_enable_1_3_extensions(mesaCtx); - _mesa_enable_1_4_extensions(mesaCtx); - _mesa_enable_1_5_extensions(mesaCtx); - _mesa_enable_2_0_extensions(mesaCtx); - _mesa_enable_2_1_extensions(mesaCtx); -if (mesaCtx-Mesa_DXTn) { - mesaCtx-Extensions.EXT_texture_compression_s3tc = GL_TRUE; - mesaCtx-Extensions.ANGLE_texture_compression_dxt = GL_TRUE; -} -mesaCtx-Extensions.TDFX_texture_compression_FXT1 = GL_TRUE; + #if ENABLE_EXT_timer_query mesaCtx-Extensions.EXT_timer_query = GL_TRUE; #endif -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 06/21] wmesa: Don't call _mesa_enable_._._extensions and _mesa_enable_sw_extensions
From: Ian Romanick ian.d.roman...@intel.com _mesa_enable_sw_extensions enables all the extensions (and more) that the others enable. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/windows/gdi/wmesa.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index ef791ab..d6eb823 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -619,11 +619,6 @@ WMesaContext WMesaCreateContext(HDC hDC, _mesa_destroy_visual(visual); _mesa_enable_sw_extensions(ctx); -_mesa_enable_1_3_extensions(ctx); -_mesa_enable_1_4_extensions(ctx); -_mesa_enable_1_5_extensions(ctx); -_mesa_enable_2_0_extensions(ctx); -_mesa_enable_2_1_extensions(ctx); _mesa_meta_init(ctx); -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 07/21] osmesa: Don't call _mesa_enable_._._extensions and _mesa_enable_sw_extensions
From: Ian Romanick ian.d.roman...@intel.com _mesa_enable_sw_extensions enables all the extensions (and more) that the others enable. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/osmesa/osmesa.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index deb0b93..102001e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -723,11 +723,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, } _mesa_enable_sw_extensions((osmesa-mesa)); - _mesa_enable_1_3_extensions((osmesa-mesa)); - _mesa_enable_1_4_extensions((osmesa-mesa)); - _mesa_enable_1_5_extensions((osmesa-mesa)); - _mesa_enable_2_0_extensions((osmesa-mesa)); - _mesa_enable_2_1_extensions((osmesa-mesa)); osmesa-gl_buffer = _mesa_create_framebuffer(osmesa-gl_visual); if (!osmesa-gl_buffer) { -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/21] swrast: Don't call _mesa_enable_._._extensions and _mesa_enable_sw_extensions
From: Ian Romanick ian.d.roman...@intel.com _mesa_enable_sw_extensions enables all the extensions (and more) that the others enable. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/swrast/swrast.c | 56 1 file changed, 56 deletions(-) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index ee80c1f..332c7b7 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -648,41 +648,6 @@ swrast_init_driver_functions(struct dd_function_table *driver) driver-UnmapRenderbuffer = swrast_unmap_renderbuffer; } -static const char *es2_extensions[] = { - /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */ - GL_EXT_blend_func_separate, - GL_EXT_framebuffer_blit, - GL_MESA_window_pos, - - /* Required by GLES2 */ - GL_ARB_fragment_program, - GL_ARB_fragment_shader, - GL_ARB_shader_objects, - GL_ARB_texture_cube_map, - GL_ARB_texture_non_power_of_two, - GL_ARB_vertex_shader, - GL_EXT_blend_color, - GL_EXT_blend_equation_separate, - GL_EXT_blend_minmax, - - /* Optional GLES2 */ - GL_ARB_framebuffer_object, - GL_EXT_texture_filter_anisotropic, - GL_ARB_depth_texture, - GL_EXT_packed_depth_stencil, - GL_EXT_framebuffer_object, - NULL, -}; - -static void -InitExtensionsES2(struct gl_context *ctx) -{ - int i; - - for (i = 0; es2_extensions[i]; i++) - _mesa_enable_extension(ctx, es2_extensions[i]); -} - /** * Context-related functions. */ @@ -769,27 +734,6 @@ dri_create_context(gl_api api, _mesa_meta_init(mesaCtx); _mesa_enable_sw_extensions(mesaCtx); -switch (api) { -case API_OPENGL_CORE: -/* XXX fix me, fall-through for now */ -case API_OPENGL_COMPAT: -_mesa_enable_1_3_extensions(mesaCtx); -_mesa_enable_1_4_extensions(mesaCtx); -_mesa_enable_1_5_extensions(mesaCtx); -_mesa_enable_2_0_extensions(mesaCtx); -_mesa_enable_2_1_extensions(mesaCtx); -break; -case API_OPENGLES: -_mesa_enable_1_3_extensions(mesaCtx); -_mesa_enable_1_4_extensions(mesaCtx); -_mesa_enable_1_5_extensions(mesaCtx); - -break; -case API_OPENGLES2: -InitExtensionsES2( mesaCtx); -break; -} - _mesa_compute_version(mesaCtx); _mesa_initialize_dispatch_tables(mesaCtx); -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 09/21] mesa: Remove _mesa_enable_._._extensions functions
From: Ian Romanick ian.d.roman...@intel.com After the preceeding commits, they are not used. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/extensions.c | 77 -- src/mesa/main/extensions.h | 10 -- 2 files changed, 87 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2ba4475..b8b69d0 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -464,83 +464,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) } } - -/** - * Enable all OpenGL 1.3 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_3_extensions(struct gl_context *ctx) -{ - ctx-Extensions.ARB_texture_border_clamp = GL_TRUE; - ctx-Extensions.ARB_texture_cube_map = GL_TRUE; - ctx-Extensions.ARB_texture_env_combine = GL_TRUE; - ctx-Extensions.ARB_texture_env_dot3 = GL_TRUE; -} - - - -/** - * Enable all OpenGL 1.4 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_4_extensions(struct gl_context *ctx) -{ - ctx-Extensions.ARB_depth_texture = GL_TRUE; - ctx-Extensions.ARB_shadow = GL_TRUE; - ctx-Extensions.ARB_texture_env_crossbar = GL_TRUE; - ctx-Extensions.EXT_blend_color = GL_TRUE; - ctx-Extensions.EXT_blend_func_separate = GL_TRUE; - ctx-Extensions.EXT_blend_minmax = GL_TRUE; - ctx-Extensions.EXT_fog_coord = GL_TRUE; - ctx-Extensions.EXT_point_parameters = GL_TRUE; - ctx-Extensions.EXT_secondary_color = GL_TRUE; -} - - -/** - * Enable all OpenGL 1.5 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_1_5_extensions(struct gl_context *ctx) -{ - ctx-Extensions.ARB_occlusion_query = GL_TRUE; - ctx-Extensions.EXT_shadow_funcs = GL_TRUE; -} - - -/** - * Enable all OpenGL 2.0 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_2_0_extensions(struct gl_context *ctx) -{ - ctx-Extensions.ARB_fragment_shader = GL_TRUE; - ctx-Extensions.ARB_point_sprite = GL_TRUE; - ctx-Extensions.EXT_blend_equation_separate = GL_TRUE; - ctx-Extensions.ARB_texture_non_power_of_two = GL_TRUE; - ctx-Extensions.ARB_shader_objects = GL_TRUE; - ctx-Extensions.ARB_shading_language_100 = GL_TRUE; - ctx-Extensions.EXT_stencil_two_side = GL_TRUE; - ctx-Extensions.ARB_vertex_shader = GL_TRUE; -} - - -/** - * Enable all OpenGL 2.1 features and extensions. - * A convenience function to be called by drivers. - */ -void -_mesa_enable_2_1_extensions(struct gl_context *ctx) -{ - ctx-Extensions.EXT_pixel_buffer_object = GL_TRUE; - ctx-Extensions.EXT_texture_sRGB = GL_TRUE; -} - - /** * Either enable or disable the named extension. * \return GL_TRUE for success, GL_FALSE if invalid extension name diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index 7a3791d..f421e20 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -42,16 +42,6 @@ struct gl_context; extern void _mesa_enable_sw_extensions(struct gl_context *ctx); -extern void _mesa_enable_1_3_extensions(struct gl_context *ctx); - -extern void _mesa_enable_1_4_extensions(struct gl_context *ctx); - -extern void _mesa_enable_1_5_extensions(struct gl_context *ctx); - -extern void _mesa_enable_2_0_extensions(struct gl_context *ctx); - -extern void _mesa_enable_2_1_extensions(struct gl_context *ctx); - extern void _mesa_enable_extension(struct gl_context *ctx, const char *name); extern void _mesa_disable_extension(struct gl_context *ctx, const char *name); -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 10/21] mesa: Just set extension flags instead of calling _mesa_enable_extension
From: Ian Romanick ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/extensions.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index b8b69d0..a39c3e1 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -456,11 +456,10 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx-Extensions.NV_fragment_program_option = GL_TRUE; ctx-Extensions.EXT_gpu_program_parameters = GL_TRUE; ctx-Extensions.OES_standard_derivatives = GL_TRUE; - _mesa_enable_extension(ctx, GL_3DFX_texture_compression_FXT1); + ctx-Extensions.TDFX_texture_compression_FXT1 = GL_TRUE; if (ctx-Mesa_DXTn) { ctx-Extensions.ANGLE_texture_compression_dxt = GL_TRUE; - _mesa_enable_extension(ctx, GL_EXT_texture_compression_s3tc); - _mesa_enable_extension(ctx, GL_S3_s3tc); + ctx-Extensions.EXT_texture_compression_s3tc = GL_TRUE; } } -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 11/21] mesa: Remove _mesa_{enable, disable}_extension and _mesa_extension_is_enabled
From: Ian Romanick ian.d.roman...@intel.com They're not used anywhere. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/main/extensions.c | 45 - src/mesa/main/extensions.h | 6 -- 2 files changed, 51 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a39c3e1..8f96a77 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -494,51 +494,6 @@ set_extension( struct gl_context *ctx, const char *name, GLboolean state ) } } - -/** - * Enable the named extension. - * Typically called by drivers. - */ -void -_mesa_enable_extension( struct gl_context *ctx, const char *name ) -{ - if (!set_extension(ctx, name, GL_TRUE)) - _mesa_problem(ctx, Trying to enable unknown extension: %s, name); -} - - -/** - * Disable the named extension. - * XXX is this really needed??? - */ -void -_mesa_disable_extension( struct gl_context *ctx, const char *name ) -{ - if (!set_extension(ctx, name, GL_FALSE)) - _mesa_problem(ctx, Trying to disable unknown extension: %s, name); -} - - -/** - * Test if the named extension is enabled in this context. - */ -GLboolean -_mesa_extension_is_enabled( struct gl_context *ctx, const char *name ) -{ - size_t offset; - GLboolean *base; - - if (name == 0) - return GL_FALSE; - - offset = name_to_offset(name); - if (offset == 0) - return GL_FALSE; - base = (GLboolean *) ctx-Extensions; - return base[offset]; -} - - /** * \brief Apply the \c MESA_EXTENSION_OVERRIDE environment variable. * diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index f421e20..a8cc2a4 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -42,12 +42,6 @@ struct gl_context; extern void _mesa_enable_sw_extensions(struct gl_context *ctx); -extern void _mesa_enable_extension(struct gl_context *ctx, const char *name); - -extern void _mesa_disable_extension(struct gl_context *ctx, const char *name); - -extern GLboolean _mesa_extension_is_enabled(struct gl_context *ctx, const char *name); - extern void _mesa_init_extensions(struct gl_context *ctx); extern GLubyte *_mesa_make_extension_string(struct gl_context *ctx); -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 12/21] mesa: Remove GL_MESA_resize_buffers
From: Ian Romanick ian.d.roman...@intel.com Commit bab755a made the implementation a no-op, and it was only ever enabled by software rasterizers. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- docs/relnotes/9.2.html | 2 ++ src/mapi/glapi/gen/gl_API.xml | 2 +- src/mapi/glapi/gen/mesadef.py | 1 - src/mesa/drivers/windows/gdi/mesa.def | 1 - src/mesa/main/extensions.c | 2 -- src/mesa/main/framebuffer.c | 10 -- src/mesa/main/framebuffer.h | 4 src/mesa/main/mtypes.h | 1 - src/mesa/main/tests/dispatch_sanity.cpp | 3 --- 9 files changed, 3 insertions(+), 23 deletions(-) diff --git a/docs/relnotes/9.2.html b/docs/relnotes/9.2.html index 08e82d0..2f2c394 100644 --- a/docs/relnotes/9.2.html +++ b/docs/relnotes/9.2.html @@ -65,6 +65,8 @@ Note: some of the new features are only available with certain drivers. liRemoved d3d1x state tracker (unused, unmaintained and broken)/li liRemoved GL_EXT_clip_volume_hint because no driver had enabled it since 2007./li +liRemoved GL_MESA_resize_buffers because it was only really implemented by +the (unsupported) GDI driver./li /ul /div diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index a066fe2..82b908f 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -11032,7 +11032,7 @@ /category category name=GL_MESA_resize_buffers number=196 -function name=ResizeBuffersMESA offset=assign +function name=ResizeBuffersMESA offset=assign exec=skip glx ignore=true/ /function /category diff --git a/src/mapi/glapi/gen/mesadef.py b/src/mapi/glapi/gen/mesadef.py index f6d33cb..77cc4a3 100644 --- a/src/mapi/glapi/gen/mesadef.py +++ b/src/mapi/glapi/gen/mesadef.py @@ -134,7 +134,6 @@ def PrintTail(): print '\t_mesa_new_buffer_object' print '\t_mesa_new_texture_object' print '\t_mesa_problem' -print '\t_mesa_ResizeBuffersMESA' print '\t_mesa_store_compressed_teximage1d' print '\t_mesa_store_compressed_teximage2d' print '\t_mesa_store_compressed_teximage3d' diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index fec7bba..92736b3 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -556,7 +556,6 @@ EXPORTS glFogCoorddvEXT glFogCoordPointerEXT glBlendFuncSeparateEXT - glResizeBuffersMESA glWindowPos2dMESA glWindowPos2dvMESA glWindowPos2fMESA diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 8f96a77..9c90bbe 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -307,7 +307,6 @@ static const struct extension extension_table[] = { { GL_IBM_texture_mirrored_repeat, o(dummy_true), GLL,1998 }, { GL_INGR_blend_func_separate,o(EXT_blend_func_separate), GLL,1999 }, { GL_MESA_pack_invert,o(MESA_pack_invert), GL, 2002 }, - { GL_MESA_resize_buffers, o(MESA_resize_buffers), GL, 1999 }, { GL_MESA_texture_array, o(MESA_texture_array), GLL,2007 }, { GL_MESA_texture_signed_rgba,o(EXT_texture_snorm), GL, 2009 }, { GL_MESA_window_pos, o(dummy_true), GLL,2000 }, @@ -445,7 +444,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) /*ctx-Extensions.EXT_transform_feedback = GL_TRUE;*/ ctx-Extensions.EXT_vertex_array_bgra = GL_TRUE; ctx-Extensions.MESA_pack_invert = GL_TRUE; - ctx-Extensions.MESA_resize_buffers = GL_TRUE; ctx-Extensions.MESA_texture_array = GL_TRUE; ctx-Extensions.MESA_ycbcr_texture = GL_TRUE; ctx-Extensions.NV_blend_square = GL_TRUE; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index d28882a..4ec4118 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -319,16 +319,6 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb, } } -/* - * XXX THIS IS OBSOLETE - */ -void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ) -{ -} - - - /** * Examine all the framebuffer's renderbuffers to update the Width/Height * fields of the framebuffer. If we have renderbuffers with different diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 1b1caab..2645664 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -71,10 +71,6 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb, extern void _mesa_resizebuffers( struct gl_context *ctx ); -extern void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ); - -
[Mesa-dev] [PATCH 13/21] mesa: GL_EXT_framebuffer_object is not optional
From: Ian Romanick ian.d.roman...@intel.com Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/common/meta.c | 6 -- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/main/buffers.c| 1 - src/mesa/main/extensions.c | 17 - src/mesa/main/fbobject.c | 7 --- src/mesa/main/get.c| 1 - src/mesa/main/get_hash_params.py | 8 src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_extensions.c | 1 - 13 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index f7dd06a..d9bffd7 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3049,12 +3049,6 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target, GLenum status; /* check for fallbacks */ - if (!ctx-Extensions.EXT_framebuffer_object) { - _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH, - glGenerateMipmap() without FBOs\n); - return GL_TRUE; - } - if (target == GL_TEXTURE_3D || target == GL_TEXTURE_1D_ARRAY || target == GL_TEXTURE_2D_ARRAY) { diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index ac6aefa..eecb291 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -67,7 +67,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_blend_func_separate = true; ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_framebuffer_blit = true; - ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_gpu_program_parameters = true; ctx-Extensions.EXT_packed_depth_stencil = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index d70655b..fdd0508 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -91,7 +91,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_draw_buffers2 = true; ctx-Extensions.EXT_framebuffer_blit = true; - ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_framebuffer_sRGB = true; ctx-Extensions.EXT_gpu_program_parameters = true; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index b216c60..7f22ae2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -200,7 +200,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_framebuffer_blit = true; - ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 3484478..5d2f79b 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -397,7 +397,6 @@ GLboolean r200CreateContext( gl_api api, ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_texture_rectangle = true; ctx-Extensions.OES_EGL_image = true; - ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.ARB_occlusion_query = true; if (!(rmesa-radeon.radeonScreen-chip_flags R200_CHIPSET_YCBCR_BROKEN)) { diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index cac4b12..fbcac67 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -355,7 +355,6 @@ r100CreateContext( gl_api api, ctx-Extensions.MESA_ycbcr_texture = true; ctx-Extensions.NV_blend_square = true; ctx-Extensions.OES_EGL_image = true; - ctx-Extensions.EXT_framebuffer_object = true; ctx-Extensions.ARB_texture_cube_map = true; if (rmesa-radeon.glCtx.Mesa_DXTn) { diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index e80f040..2bdbf41 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -60,7 +60,6 @@ supported_buffer_bitmask(const
[Mesa-dev] [PATCH 14/21] mesa: GL_EXT_secondary_color is not optional
From: Ian Romanick ian.d.roman...@intel.com Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/main/enable.c | 5 ++--- src/mesa/main/extensions.c | 3 +-- src/mesa/main/get.c| 8 src/mesa/main/get_hash_params.py | 12 ++-- src/mesa/main/mtypes.h | 1 - src/mesa/main/version.c| 3 +-- src/mesa/program/program_parse.y | 5 - src/mesa/state_tracker/st_extensions.c | 1 - 13 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index eecb291..511e499 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -73,7 +73,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_pixel_buffer_object = true; ctx-Extensions.EXT_point_parameters = true; ctx-Extensions.EXT_provoking_vertex = true; - ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_separate_shader_objects = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index fdd0508..0ec077e 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -99,7 +99,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_pixel_buffer_object = true; ctx-Extensions.EXT_point_parameters = true; ctx-Extensions.EXT_provoking_vertex = true; - ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_separate_shader_objects = true; ctx-Extensions.EXT_texture_array = true; ctx-Extensions.EXT_texture_env_dot3 = true; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 7f22ae2..a403c24 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -201,7 +201,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_framebuffer_blit = true; ctx-Extensions.EXT_packed_depth_stencil = true; - ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_texture_env_combine4 = true; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5d2f79b..1722e04 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -387,7 +387,6 @@ GLboolean r200CreateContext( gl_api api, ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_packed_depth_stencil = true; - ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; ctx-Extensions.EXT_texture_mirror_clamp = true; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index fbcac67..6738576 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -346,7 +346,6 @@ r100CreateContext( gl_api api, ctx-Extensions.ARB_texture_env_dot3 = true; ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_packed_depth_stencil = true; - ctx-Extensions.EXT_secondary_color = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; ctx-Extensions.EXT_texture_mirror_clamp = true; diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index fdde24e..7ede02c 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -755,7 +755,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_COLOR_SUM_EXT: if (ctx-API != API_OPENGL_COMPAT) goto invalid_enum_error; - CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap); + CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx-Fog.ColorSumEnabled == state) return; FLUSH_VERTICES(ctx, _NEW_FOG); @@ -1425,7 +1425,6 @@ _mesa_IsEnabled( GLenum cap ) case GL_SECONDARY_COLOR_ARRAY_EXT: if (ctx-API !=
[Mesa-dev] [PATCH 15/21] mesa: GL_EXT_fog_coord is not optional
From: Ian Romanick ian.d.roman...@intel.com Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/main/enable.c | 1 - src/mesa/main/extensions.c | 3 +-- src/mesa/main/fog.c| 2 +- src/mesa/main/get.c| 7 --- src/mesa/main/get_hash_params.py | 10 +- src/mesa/main/mtypes.h | 1 - src/mesa/main/version.c| 1 - src/mesa/program/program_parse.y | 5 - src/mesa/state_tracker/st_extensions.c | 1 - 14 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 511e499..ec557a7 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -67,7 +67,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_blend_func_separate = true; ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_framebuffer_blit = true; - ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_gpu_program_parameters = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_pixel_buffer_object = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 0ec077e..7188358 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -91,7 +91,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_blend_minmax = true; ctx-Extensions.EXT_draw_buffers2 = true; ctx-Extensions.EXT_framebuffer_blit = true; - ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_framebuffer_sRGB = true; ctx-Extensions.EXT_gpu_program_parameters = true; ctx-Extensions.EXT_packed_depth_stencil = true; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index a403c24..8002d4f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -198,7 +198,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, /* Enable any supported extensions. */ ctx-Extensions.EXT_blend_color = true; ctx-Extensions.EXT_blend_minmax = true; - ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_framebuffer_blit = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 1722e04..529ffd0 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -385,7 +385,6 @@ GLboolean r200CreateContext( gl_api api, ctx-Extensions.ARB_texture_env_crossbar = true; ctx-Extensions.EXT_blend_color = true; ctx-Extensions.EXT_blend_minmax = true; - ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 6738576..077674c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -344,7 +344,6 @@ r100CreateContext( gl_api api, ctx-Extensions.ARB_texture_env_combine = true; ctx-Extensions.ARB_texture_env_crossbar = true; ctx-Extensions.ARB_texture_env_dot3 = true; - ctx-Extensions.EXT_fog_coord = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_texture_env_dot3 = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 7ede02c..5c72b3c 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1420,7 +1420,6 @@ _mesa_IsEnabled( GLenum cap ) case GL_FOG_COORDINATE_ARRAY_EXT: if (ctx-API != API_OPENGL_COMPAT) goto invalid_enum_error; - CHECK_EXTENSION(EXT_fog_coord); return (ctx-Array.ArrayObj-VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0); case GL_SECONDARY_COLOR_ARRAY_EXT: if (ctx-API != API_OPENGL_COMPAT) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 276af33..20f3a76 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -180,7
[Mesa-dev] [PATCH 17/21] mesa: GL_ARB_shader_objects is not optional
From: Ian Romanick ian.d.roman...@intel.com This extension just provides some of the most basic software framework for GLSL. Without GL_ARB_vertex_shader or GL_ARB_fragment_shader, applications still cannot use GLSL. There's no value in conditionalizing support for this extension. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/common/meta.c | 22 ++ src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 7 +++ src/mesa/main/get.c | 1 - src/mesa/main/get_hash_params.py | 6 +++--- src/mesa/main/getstring.c| 5 - src/mesa/main/mtypes.h | 1 - src/mesa/main/version.c | 2 -- src/mesa/state_tracker/st_extensions.c | 1 - 10 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index d9bffd7..e848429 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -615,18 +615,16 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI, GL_FALSE); } - if (ctx-Extensions.ARB_shader_objects) { -_mesa_reference_shader_program(ctx, save-VertexShader, - ctx-Shader.CurrentVertexProgram); -_mesa_reference_shader_program(ctx, save-GeometryShader, - ctx-Shader.CurrentGeometryProgram); -_mesa_reference_shader_program(ctx, save-FragmentShader, - ctx-Shader.CurrentFragmentProgram); -_mesa_reference_shader_program(ctx, save-ActiveShader, - ctx-Shader.ActiveProgram); - - _mesa_UseProgram(0); - } + _mesa_reference_shader_program(ctx, save-VertexShader, + ctx-Shader.CurrentVertexProgram); + _mesa_reference_shader_program(ctx, save-GeometryShader, + ctx-Shader.CurrentGeometryProgram); + _mesa_reference_shader_program(ctx, save-FragmentShader, + ctx-Shader.CurrentFragmentProgram); + _mesa_reference_shader_program(ctx, save-ActiveShader, + ctx-Shader.ActiveProgram); + + _mesa_UseProgram(0); } if (state MESA_META_STENCIL_TEST) { diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index e6241b5..53a9ea4 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -51,7 +51,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_internalformat_query = true; ctx-Extensions.ARB_map_buffer_range = true; ctx-Extensions.ARB_point_sprite = true; - ctx-Extensions.ARB_shader_objects = true; ctx-Extensions.ARB_shading_language_100 = true; ctx-Extensions.ARB_sync = true; ctx-Extensions.ARB_texture_border_clamp = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 8c61867..97fb781 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -66,7 +66,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_point_sprite = true; ctx-Extensions.ARB_seamless_cube_map = true; ctx-Extensions.ARB_shader_bit_encoding = true; - ctx-Extensions.ARB_shader_objects = true; ctx-Extensions.ARB_shader_texture_lod = true; ctx-Extensions.ARB_shading_language_100 = true; ctx-Extensions.ARB_shadow = true; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 100d437..fdaef7f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -100,7 +100,7 @@ static const struct extension extension_table[] = { { GL_ARB_fragment_shader, o(ARB_fragment_shader), GL, 2002 }, { GL_ARB_framebuffer_object, o(ARB_framebuffer_object), GL, 2005 }, { GL_ARB_framebuffer_sRGB,o(EXT_framebuffer_sRGB), GL, 1998 }, - { GL_ARB_get_program_binary, o(ARB_shader_objects), GL, 2010 }, + { GL_ARB_get_program_binary, o(dummy_true), GL, 2010 }, { GL_ARB_gpu_shader5, o(ARB_gpu_shader5), GL, 2010 }, { GL_ARB_half_float_pixel,o(ARB_half_float_pixel), GL, 2003 }, {
[Mesa-dev] [PATCH 16/21] mesa: GL_NV_blend_square is not optional
From: Ian Romanick ian.d.roman...@intel.com Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 1 - src/mesa/main/blend.c | 2 -- src/mesa/main/extensions.c | 3 +-- src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_extensions.c | 1 - 9 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index ec557a7..e6241b5 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -78,7 +78,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.APPLE_object_purgeable = true; ctx-Extensions.MESA_pack_invert = true; ctx-Extensions.MESA_ycbcr_texture = true; - ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_texture_rectangle = true; ctx-Extensions.TDFX_texture_compression_FXT1 = true; ctx-Extensions.OES_EGL_image = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 7188358..8c61867 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -118,7 +118,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.MESA_pack_invert = true; ctx-Extensions.MESA_texture_array = true; ctx-Extensions.MESA_ycbcr_texture = true; - ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_conditional_render = true; ctx-Extensions.NV_primitive_restart = true; ctx-Extensions.NV_texture_env_combine4 = true; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 8002d4f..eab1aa2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -201,7 +201,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, ctx-Extensions.EXT_framebuffer_blit = true; ctx-Extensions.EXT_packed_depth_stencil = true; ctx-Extensions.EXT_texture_filter_anisotropic = true; - ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_texture_env_combine4 = true; return GL_TRUE; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 529ffd0..7730566 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -392,7 +392,6 @@ GLboolean r200CreateContext( gl_api api, ctx-Extensions.ATI_texture_env_combine3 = true; ctx-Extensions.ATI_texture_mirror_once = true; ctx-Extensions.MESA_pack_invert = true; - ctx-Extensions.NV_blend_square = true; ctx-Extensions.NV_texture_rectangle = true; ctx-Extensions.OES_EGL_image = true; ctx-Extensions.ARB_occlusion_query = true; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 077674c..d9f4841 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -351,7 +351,6 @@ r100CreateContext( gl_api api, ctx-Extensions.ATI_texture_env_combine3 = true; ctx-Extensions.ATI_texture_mirror_once = true; ctx-Extensions.MESA_ycbcr_texture = true; - ctx-Extensions.NV_blend_square = true; ctx-Extensions.OES_EGL_image = true; ctx-Extensions.ARB_texture_cube_map = true; diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index c97c207..9e11ca7 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -48,7 +48,6 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor) switch (factor) { case GL_SRC_COLOR: case GL_ONE_MINUS_SRC_COLOR: - return ctx-Extensions.NV_blend_square; case GL_ZERO: case GL_ONE: case GL_DST_COLOR: @@ -86,7 +85,6 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor) switch (factor) { case GL_DST_COLOR: case GL_ONE_MINUS_DST_COLOR: - return ctx-Extensions.NV_blend_square; case GL_ZERO: case GL_ONE: case GL_SRC_COLOR: diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 20f3a76..100d437 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -311,7 +311,7 @@ static const struct extension extension_table[] = { { GL_MESA_texture_signed_rgba,o(EXT_texture_snorm), GL, 2009 }, { GL_MESA_window_pos, o(dummy_true), GLL,2000 }, {
[Mesa-dev] [PATCH 18/21] mesa: GL_ARB_shading_language_100 is not optional
From: Ian Romanick ian.d.roman...@intel.com This extension just provides some of the most basic software framework for GLSL. Without GL_ARB_vertex_shader or GL_ARB_fragment_shader, applications still cannot use GLSL. There's no value in conditionalizing support for this extension. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 3 +-- src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_extensions.c | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 53a9ea4..74b304a 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -51,7 +51,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_internalformat_query = true; ctx-Extensions.ARB_map_buffer_range = true; ctx-Extensions.ARB_point_sprite = true; - ctx-Extensions.ARB_shading_language_100 = true; ctx-Extensions.ARB_sync = true; ctx-Extensions.ARB_texture_border_clamp = true; ctx-Extensions.ARB_texture_cube_map = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 97fb781..23b74a5 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -67,7 +67,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_seamless_cube_map = true; ctx-Extensions.ARB_shader_bit_encoding = true; ctx-Extensions.ARB_shader_texture_lod = true; - ctx-Extensions.ARB_shading_language_100 = true; ctx-Extensions.ARB_shadow = true; ctx-Extensions.ARB_sync = true; ctx-Extensions.ARB_texture_border_clamp = true; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fdaef7f..73282e1 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -124,7 +124,7 @@ static const struct extension extension_table[] = { { GL_ARB_shader_objects, o(dummy_true), GL, 2002 }, { GL_ARB_shader_stencil_export, o(ARB_shader_stencil_export), GL, 2009 }, { GL_ARB_shader_texture_lod, o(ARB_shader_texture_lod), GL, 2009 }, - { GL_ARB_shading_language_100, o(ARB_shading_language_100),GLL,2003 }, + { GL_ARB_shading_language_100,o(dummy_true), GLL,2003 }, { GL_ARB_shading_language_packing, o(ARB_shading_language_packing),GL, 2011 }, { GL_ARB_shading_language_420pack, o(ARB_shading_language_420pack),GL, 2011 }, { GL_ARB_shadow, o(ARB_shadow), GLL,2001 }, @@ -391,7 +391,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx-Extensions.ARB_occlusion_query2 = GL_TRUE; ctx-Extensions.ARB_point_sprite = GL_TRUE; ctx-Extensions.EXT_separate_shader_objects = GL_TRUE; - ctx-Extensions.ARB_shading_language_100 = GL_TRUE; ctx-Extensions.ARB_shadow = GL_TRUE; ctx-Extensions.ARB_texture_border_clamp = GL_TRUE; ctx-Extensions.ARB_texture_cube_map = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 553b0ec..2879341 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3016,7 +3016,6 @@ struct gl_extensions GLboolean ARB_shader_bit_encoding; GLboolean ARB_shader_stencil_export; GLboolean ARB_shader_texture_lod; - GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_packing; GLboolean ARB_shading_language_420pack; GLboolean ARB_shadow; diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 1ae4729..cd24ed3 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -537,7 +537,6 @@ void st_init_extensions(struct st_context *st) ctx-Extensions.ARB_half_float_vertex = GL_TRUE; ctx-Extensions.ARB_internalformat_query = GL_TRUE; ctx-Extensions.ARB_map_buffer_range = GL_TRUE; - ctx-Extensions.ARB_shading_language_100 = GL_TRUE; ctx-Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */ ctx-Extensions.ARB_texture_cube_map = GL_TRUE; ctx-Extensions.ARB_texture_env_combine = GL_TRUE; -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 21/21] mesa: GL_EXT_shadow_funcs is not optional with GL_ARB_shadow
From: Ian Romanick ian.d.roman...@intel.com Every driver left in Mesa that enables one also enables the other. There's no reason to let it be optional. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 3 +-- src/mesa/main/mtypes.h | 1 - src/mesa/main/samplerobj.c | 12 +++- src/mesa/main/texparam.c | 12 +++- src/mesa/main/version.c | 3 +-- src/mesa/state_tracker/st_extensions.c | 1 - 8 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 479217b..1e48231 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -91,7 +91,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_texture_non_power_of_two = true; ctx-Extensions.EXT_texture_sRGB = true; ctx-Extensions.EXT_texture_sRGB_decode = true; - ctx-Extensions.EXT_shadow_funcs = true; ctx-Extensions.EXT_stencil_two_side = true; ctx-Extensions.ATI_separate_stencil = true; ctx-Extensions.ATI_texture_env_combine3 = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 980fd72..820c185 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -105,7 +105,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_texture_sRGB = true; ctx-Extensions.EXT_texture_sRGB_decode = true; ctx-Extensions.EXT_texture_swizzle = true; - ctx-Extensions.EXT_shadow_funcs = true; ctx-Extensions.EXT_stencil_two_side = true; ctx-Extensions.EXT_vertex_array_bgra = true; ctx-Extensions.APPLE_object_purgeable = true; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3fbdf3f..e0428c6 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -201,7 +201,7 @@ static const struct extension extension_table[] = { { GL_EXT_secondary_color, o(dummy_true), GLL,1999 }, { GL_EXT_separate_shader_objects, o(EXT_separate_shader_objects), GLL,2008 }, { GL_EXT_separate_specular_color, o(dummy_true), GLL,1997 }, - { GL_EXT_shadow_funcs,o(EXT_shadow_funcs), GLL,2002 }, + { GL_EXT_shadow_funcs,o(ARB_shadow), GLL,2002 }, { GL_EXT_stencil_two_side,o(EXT_stencil_two_side), GLL,2001 }, { GL_EXT_stencil_wrap,o(dummy_true), GLL,2002 }, { GL_EXT_subtexture, o(dummy_true), GLL,1995 }, @@ -424,7 +424,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx-Extensions.EXT_pixel_buffer_object = GL_TRUE; ctx-Extensions.EXT_point_parameters = GL_TRUE; ctx-Extensions.EXT_provoking_vertex = GL_TRUE; - ctx-Extensions.EXT_shadow_funcs = GL_TRUE; ctx-Extensions.EXT_stencil_two_side = GL_TRUE; ctx-Extensions.EXT_texture_array = GL_TRUE; ctx-Extensions.EXT_texture_compression_latc = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d405ac8..1f62e2c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3061,7 +3061,6 @@ struct gl_extensions GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; GLboolean EXT_provoking_vertex; - GLboolean EXT_shadow_funcs; GLboolean EXT_separate_shader_objects; GLboolean EXT_stencil_two_side; GLboolean EXT_texture3D; diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index 91b17ab..3857eda 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -529,21 +529,15 @@ set_sampler_compare_func(struct gl_context *ctx, switch (param) { case GL_LEQUAL: case GL_GEQUAL: - flush(ctx); - samp-CompareFunc = param; - return GL_TRUE; case GL_EQUAL: case GL_NOTEQUAL: case GL_LESS: case GL_GREATER: case GL_ALWAYS: case GL_NEVER: - if (ctx-Extensions.EXT_shadow_funcs) { - flush(ctx); - samp-CompareFunc = param; - return GL_TRUE; - } - /* fall-through */ + flush(ctx); + samp-CompareFunc = param; + return GL_TRUE; default: return INVALID_PARAM; } diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 1b76fba..355f716 100644 --- a/src/mesa/main/texparam.c +++
[Mesa-dev] [PATCH 19/21] mesa: GL_ARB_texture_storage is not optional
From: Ian Romanick ian.d.roman...@intel.com In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- docs/relnotes/9.2.html | 1 + src/mesa/drivers/dri/i915/intel_extensions.c | 1 - src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 3 +-- src/mesa/main/mtypes.h | 1 - src/mesa/main/teximage.c | 9 +++-- src/mesa/main/texparam.c | 4 src/mesa/state_tracker/st_extensions.c | 1 - 8 files changed, 5 insertions(+), 16 deletions(-) diff --git a/docs/relnotes/9.2.html b/docs/relnotes/9.2.html index 2f2c394..1f49191 100644 --- a/docs/relnotes/9.2.html +++ b/docs/relnotes/9.2.html @@ -48,6 +48,7 @@ Note: some of the new features are only available with certain drivers. liGL_ARB_texture_multisample/li liGL_ARB_texture_storage_multisample/li liGL_ARB_texture_query_lod/li +liEnable GL_ARB_texture_storage on radeon, r200, and nouveau/li liAdded new freedreno gallium driver/li liOSMesa interface for gallium llvmpipe/softpipe drivers/li liGallium Heads-Up Display (HUD) feature for performance monitoring/li diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index 74b304a..479217b 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -57,7 +57,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_texture_env_combine = true; ctx-Extensions.ARB_texture_env_crossbar = true; ctx-Extensions.ARB_texture_env_dot3 = true; - ctx-Extensions.ARB_texture_storage = true; ctx-Extensions.ARB_vertex_program = true; ctx-Extensions.ARB_vertex_shader = true; ctx-Extensions.EXT_blend_color = true; diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 23b74a5..5064018 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -79,7 +79,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_texture_non_power_of_two = true; ctx-Extensions.ARB_texture_rg = true; ctx-Extensions.ARB_texture_rgb10_a2ui = true; - ctx-Extensions.ARB_texture_storage = true; ctx-Extensions.ARB_vertex_program = true; ctx-Extensions.ARB_vertex_shader = true; ctx-Extensions.ARB_vertex_type_2_10_10_10_rev = true; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 73282e1..f914981 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -149,7 +149,7 @@ static const struct extension extension_table[] = { { GL_ARB_texture_rectangle, o(NV_texture_rectangle), GL, 2004 }, { GL_ARB_texture_rgb10_a2ui, o(ARB_texture_rgb10_a2ui), GL, 2009 }, { GL_ARB_texture_rg, o(ARB_texture_rg), GL, 2008 }, - { GL_ARB_texture_storage, o(ARB_texture_storage), GL, 2011 }, + { GL_ARB_texture_storage, o(dummy_true), GL, 2011 }, { GL_ARB_texture_storage_multisample, o(ARB_texture_storage_multisample), GL, 2012 }, { GL_ARB_texture_swizzle, o(EXT_texture_swizzle), GL, 2008 }, { GL_ARB_timer_query, o(ARB_timer_query), GL, 2010 }, @@ -403,7 +403,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx-Extensions.ARB_texture_non_power_of_two = GL_TRUE; ctx-Extensions.ARB_texture_rg = GL_TRUE; ctx-Extensions.ARB_texture_compression_rgtc = GL_TRUE; - ctx-Extensions.ARB_texture_storage = GL_TRUE; ctx-Extensions.ARB_vertex_program = GL_TRUE; ctx-Extensions.ARB_vertex_shader = GL_TRUE; ctx-Extensions.ARB_sync = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 2879341..a19ecd6 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3036,7 +3036,6 @@ struct gl_extensions GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_texture_storage; GLboolean ARB_texture_storage_multisample; GLboolean ARB_timer_query; GLboolean ARB_transform_feedback2; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 5226687..be03a60 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1852,12 +1852,9 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) static GLboolean
[Mesa-dev] [PATCH 20/21] mesa: GL_ARB_texture_storage_multisample is not optional with GL_ARB_texture_multisample
From: Ian Romanick ian.d.roman...@intel.com In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. If a driver enables, GL_ARB_texture_multisample, it gets GL_ARB_texture_storage_multisample for free. NOTE: This has the side effect of enabling the extension in Gallium drivers that enable GL_ARB_texture_multisample. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 2 +- src/mesa/main/mtypes.h | 1 - src/mesa/main/texparam.c | 10 ++ 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 5064018..980fd72 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -146,7 +146,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.OES_depth_texture_cube_map = true; ctx-Extensions.ARB_shading_language_packing = true; ctx-Extensions.ARB_texture_multisample = true; - ctx-Extensions.ARB_texture_storage_multisample = true; /* Test if the kernel has the ioctl. */ if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f914981..3fbdf3f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -150,7 +150,7 @@ static const struct extension extension_table[] = { { GL_ARB_texture_rgb10_a2ui, o(ARB_texture_rgb10_a2ui), GL, 2009 }, { GL_ARB_texture_rg, o(ARB_texture_rg), GL, 2008 }, { GL_ARB_texture_storage, o(dummy_true), GL, 2011 }, - { GL_ARB_texture_storage_multisample, o(ARB_texture_storage_multisample), GL, 2012 }, + { GL_ARB_texture_storage_multisample, o(ARB_texture_multisample), GL, 2012 }, { GL_ARB_texture_swizzle, o(EXT_texture_swizzle), GL, 2008 }, { GL_ARB_timer_query, o(ARB_timer_query), GL, 2010 }, { GL_ARB_transform_feedback2, o(ARB_transform_feedback2), GL, 2010 }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index a19ecd6..d405ac8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3036,7 +3036,6 @@ struct gl_extensions GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_texture_storage_multisample; GLboolean ARB_timer_query; GLboolean ARB_transform_feedback2; GLboolean ARB_transform_feedback3; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 8ed8fe0..1b76fba 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -176,15 +176,9 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) } break; case GL_TEXTURE_2D_MULTISAMPLE: - if (ctx-Extensions.ARB_texture_storage_multisample) { - return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX]; - } - break; + return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX]; case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - if (ctx-Extensions.ARB_texture_storage_multisample) { - return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX]; - } - break; + return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX]; default: ; } -- 1.8.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 04/21] i965: Merge the two GEN = 6 extension enable blocks
On 06/27/2013 06:20 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com There's no reason for these blocks to be separate. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index f9f4ad9..d70655b 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -139,6 +139,8 @@ intelInitExtensions(struct gl_context *ctx) _mesa_override_glsl_version(ctx); if (intel-gen = 6) { + uint64_t dummy; + ctx-Extensions.EXT_framebuffer_multisample = true; ctx-Extensions.EXT_transform_feedback = true; ctx-Extensions.ARB_blend_func_extended = !driQueryOptionb(intel-optionCache, disable_blend_func_extended); @@ -152,6 +154,10 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.ARB_shading_language_packing = true; ctx-Extensions.ARB_texture_multisample = true; ctx-Extensions.ARB_texture_storage_multisample = true; + + /* Test if the kernel has the ioctl. */ + if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) + ctx-Extensions.ARB_timer_query = true; } if (intel-gen = 5) { @@ -159,13 +165,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.EXT_timer_query = true; } - if (intel-gen = 6) { - uint64_t dummy; - /* Test if the kernel has the ioctl. */ - if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) - ctx-Extensions.ARB_timer_query = true; - } I'm ambivalent about this change. It'd be nice if the ioctl test wasn't necessary, but I just checked and it was introduced in v3.7. We currently require v3.6, so...technically, it's necessary. Reviewed-by: Kenneth Graunke kenn...@whitecape.org - if (ctx-API == API_OPENGL_CORE) ctx-Extensions.ARB_base_instance = true; if (ctx-API != API_OPENGL_CORE) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 20/21] mesa: GL_ARB_texture_storage_multisample is not optional with GL_ARB_texture_multisample
On 06/27/2013 06:20 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. If a driver enables, GL_ARB_texture_multisample, it gets GL_ARB_texture_storage_multisample for free. NOTE: This has the side effect of enabling the extension in Gallium drivers that enable GL_ARB_texture_multisample. Signed-off-by: Ian Romanick ian.d.roman...@intel.com --- src/mesa/drivers/dri/i965/intel_extensions.c | 1 - src/mesa/main/extensions.c | 2 +- src/mesa/main/mtypes.h | 1 - src/mesa/main/texparam.c | 10 ++ 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 5064018..980fd72 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -146,7 +146,6 @@ intelInitExtensions(struct gl_context *ctx) ctx-Extensions.OES_depth_texture_cube_map = true; ctx-Extensions.ARB_shading_language_packing = true; ctx-Extensions.ARB_texture_multisample = true; - ctx-Extensions.ARB_texture_storage_multisample = true; /* Test if the kernel has the ioctl. */ if (drm_intel_reg_read(intel-bufmgr, TIMESTAMP, dummy) == 0) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f914981..3fbdf3f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -150,7 +150,7 @@ static const struct extension extension_table[] = { { GL_ARB_texture_rgb10_a2ui, o(ARB_texture_rgb10_a2ui), GL, 2009 }, { GL_ARB_texture_rg, o(ARB_texture_rg), GL, 2008 }, { GL_ARB_texture_storage, o(dummy_true), GL, 2011 }, - { GL_ARB_texture_storage_multisample, o(ARB_texture_storage_multisample), GL, 2012 }, + { GL_ARB_texture_storage_multisample, o(ARB_texture_multisample), GL, 2012 }, { GL_ARB_texture_swizzle, o(EXT_texture_swizzle), GL, 2008 }, { GL_ARB_timer_query, o(ARB_timer_query), GL, 2010 }, { GL_ARB_transform_feedback2, o(ARB_transform_feedback2), GL, 2010 }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index a19ecd6..d405ac8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3036,7 +3036,6 @@ struct gl_extensions GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_texture_storage_multisample; GLboolean ARB_timer_query; GLboolean ARB_transform_feedback2; GLboolean ARB_transform_feedback3; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 8ed8fe0..1b76fba 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -176,15 +176,9 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) } break; case GL_TEXTURE_2D_MULTISAMPLE: - if (ctx-Extensions.ARB_texture_storage_multisample) { - return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX]; - } - break; + return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX]; case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - if (ctx-Extensions.ARB_texture_storage_multisample) { - return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX]; - } - break; + return texUnit-CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX]; default: ; } This looks like it'll make TexParameter accept GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY even on drivers that don't support multisampling at all, which seems wrong. I believe you simply want to change these to: if (ctx-Extensions.ARB_texture_multisample) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i915, i965: Fix memory leak in intel_miptree_create_for_bo.
Fixes Resource leak defect reported by Coverity. Signed-off-by: Vinson Lee v...@freedesktop.org --- src/mesa/drivers/dri/i915/intel_mipmap_tree.c | 4 +++- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c index 058cfbe..f2c2092 100644 --- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c @@ -654,8 +654,10 @@ intel_miptree_create_for_bo(struct intel_context *intel, 0, 0, width, height, 1, true, 0 /* num_samples */); - if (!mt) + if (!mt) { + free(region); return mt; + } region-cpp = mt-cpp; region-width = width; diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 058cfbe..f2c2092 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -654,8 +654,10 @@ intel_miptree_create_for_bo(struct intel_context *intel, 0, 0, width, height, 1, true, 0 /* num_samples */); - if (!mt) + if (!mt) { + free(region); return mt; + } region-cpp = mt-cpp; region-width = width; -- 1.8.3.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i965: Initialize brw_blorp_const_color_program member variables.
Fixes Uninitialized scalar field defect reported by Coverity. Signed-off-by: Vinson Lee v...@freedesktop.org --- src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp index f925ab3..bf11135 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp @@ -121,7 +121,11 @@ brw_blorp_const_color_program::brw_blorp_const_color_program( const brw_blorp_const_color_prog_key *key) : mem_ctx(ralloc_context(NULL)), brw(brw), - key(key) + key(key), + R0(), + R1(), + clear_rgba(), + base_mrf(0) { brw_init_compile(brw, func, mem_ctx); } -- 1.8.3.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev