Re: [Mesa-dev] [PATCH] i965: Validate (and resolve) all the bound textures.
Will land this + the sampler key width change since they fix real bugs, and then follow up with a new series to improve performance. On Sun, Feb 23, 2014 at 9:25 AM, Kenneth Graunke wrote: > On 02/21/2014 09:09 PM, Chris Forbes wrote: >> BRW_MAX_TEX_UNIT is the static limit on the number of textures we >> support per-stage, not in total. >> >> Core's `Unit` array is sized by MAX_COMBINED_TEXTURE_IMAGE_UNITS, which >> is significantly larger, and across the various shader stages, up to >> ctx->Const.MaxCombinedTextureImageUnits elements of it may be actually >> used. >> >> Fixes invisible bad behavior in piglit's max-samplers test (although >> this escalated to an assertion failure on HSW with texture_view, since >> non-immutable textures only have _Format set by validation.) >> >> Signed-off-by: Chris Forbes >> Cc: "9.2 10.0 10.1" >> Cc: Kenneth Graunke >> --- >> src/mesa/drivers/dri/i965/brw_draw.c | 2 +- >> src/mesa/drivers/dri/i965/brw_tex.c | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c >> b/src/mesa/drivers/dri/i965/brw_draw.c >> index 540834c..bc887fe 100644 >> --- a/src/mesa/drivers/dri/i965/brw_draw.c >> +++ b/src/mesa/drivers/dri/i965/brw_draw.c >> @@ -317,7 +317,7 @@ brw_predraw_resolve_buffers(struct brw_context *brw) >> /* Resolve depth buffer of each enabled depth texture, and color buffer >> of >> * each fast-clear-enabled color texture. >> */ >> - for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) { >> + for (int i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) { >>if (!ctx->Texture.Unit[i]._ReallyEnabled) >>continue; >>tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current); >> diff --git a/src/mesa/drivers/dri/i965/brw_tex.c >> b/src/mesa/drivers/dri/i965/brw_tex.c >> index 9234e3a..b1f4de0 100644 >> --- a/src/mesa/drivers/dri/i965/brw_tex.c >> +++ b/src/mesa/drivers/dri/i965/brw_tex.c >> @@ -47,7 +47,7 @@ void brw_validate_textures( struct brw_context *brw ) >> struct gl_context *ctx = &brw->ctx; >> int i; >> >> - for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { >> + for (i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) { >>struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; >> >>if (texUnit->_ReallyEnabled) { >> > > Reviewed-by: Kenneth Graunke > > I am concerned, though, that looping through all 96 texture units on > every draw call may be bad for performance on CPU-bound workloads. > > I wonder if we couldn't use an approach similar to > update_stage_texture_surfaces, i.e.: > > struct gl_program *progs = { >&brw->vertex_program, &brw->geometry_program, &brw->fragment_program > }; > > for (int p = 0; p < 3; p++) { >const gl_program *prog = progs[p]; >unsigned num_samplers = _mesa_fls(prog->SamplersUsed); >for (int i = 0; i < num_samplers; i++) { > if (prog->SamplersUsed & (1 << i)) { > if (prog->SamplerUnits[i]) > intel_finalize_mipmap_tree(brw, i); >} > } > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] clover: Fix building with latest llvm
On Sat, Mar 1, 2014 at 7:35 PM, Francisco Jerez wrote: > Bruno Jiménez writes: > >> Recently, llvm has changed to use c++11, so we also should use it >> --- >> src/gallium/state_trackers/clover/Makefile.am | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/gallium/state_trackers/clover/Makefile.am >> b/src/gallium/state_trackers/clover/Makefile.am >> index ece2b38..cc9311c 100644 >> --- a/src/gallium/state_trackers/clover/Makefile.am >> +++ b/src/gallium/state_trackers/clover/Makefile.am >> @@ -37,7 +37,7 @@ libcltgsi_la_SOURCES = \ >> tgsi/compiler.cpp >> >> libclllvm_la_CXXFLAGS = \ >> - -std=c++98 \ >> + -std=c++11 \ > > I think this will break earlier versions of LLVM in subtle ways -- > mainly because the C++98 and C++11 standard libraries are not guaranteed > to be binary compatible with each other. We should probably use > LLVM_CXXFLAGS to detect which -std flag LLVM was built with and make > sure we use the same. > >> $(VISIBILITY_CXXFLAGS) \ >> $(LLVM_CPPFLAGS) \ >> $(DEFINES) \ >> @@ -49,7 +49,7 @@ libclllvm_la_SOURCES = \ >> llvm/invocation.cpp >> >> libclover_la_CXXFLAGS = \ >> - -std=c++0x \ >> + -std=c++11 \ > > This looks good to me (though it's not strictly related to fixing LLVM). Not sure if it's a concern, but I think gcc only supports std=c++11 starting with 4.7. (Not a huge deal for me -- gentoo marked 4.7 as stable a while back, but it might be for others.) -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] clover: Fix building with latest llvm
On Sun, 2014-03-02 at 04:26 -0500, Ilia Mirkin wrote: > On Sat, Mar 1, 2014 at 7:35 PM, Francisco Jerez wrote: > > Bruno Jiménez writes: > > > >> Recently, llvm has changed to use c++11, so we also should use it > >> --- > >> src/gallium/state_trackers/clover/Makefile.am | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/src/gallium/state_trackers/clover/Makefile.am > >> b/src/gallium/state_trackers/clover/Makefile.am > >> index ece2b38..cc9311c 100644 > >> --- a/src/gallium/state_trackers/clover/Makefile.am > >> +++ b/src/gallium/state_trackers/clover/Makefile.am > >> @@ -37,7 +37,7 @@ libcltgsi_la_SOURCES = \ > >> tgsi/compiler.cpp > >> > >> libclllvm_la_CXXFLAGS = \ > >> - -std=c++98 \ > >> + -std=c++11 \ > > > > I think this will break earlier versions of LLVM in subtle ways -- > > mainly because the C++98 and C++11 standard libraries are not guaranteed > > to be binary compatible with each other. We should probably use > > LLVM_CXXFLAGS to detect which -std flag LLVM was built with and make > > sure we use the same. > > > >> $(VISIBILITY_CXXFLAGS) \ > >> $(LLVM_CPPFLAGS) \ > >> $(DEFINES) \ > >> @@ -49,7 +49,7 @@ libclllvm_la_SOURCES = \ > >> llvm/invocation.cpp > >> > >> libclover_la_CXXFLAGS = \ > >> - -std=c++0x \ > >> + -std=c++11 \ > > > > This looks good to me (though it's not strictly related to fixing LLVM). > > Not sure if it's a concern, but I think gcc only supports std=c++11 > starting with 4.7. (Not a huge deal for me -- gentoo marked 4.7 as > stable a while back, but it might be for others.) > > -ilia I don't know if there's going to be a lot of people trying to build clover with a recent version of llvm and a compiler that doesn't support c++11. But maybe in that case, the option should be disabled. Francisco, I'm afraid that my knowledge of autotools is NULL but I will try. Thanks! Bruno ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] st/vdpau: fix possible NULL dereference
--- src/gallium/state_trackers/vdpau/mixer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index 996fd8e..e6bfb8c 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -242,16 +242,16 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, compositor = &vmixer->device->compositor; surf = vlGetDataHTAB(video_surface_current); - video_buffer = surf->video_buffer; if (!surf) return VDP_STATUS_INVALID_HANDLE; + video_buffer = surf->video_buffer; if (surf->device != vmixer->device) return VDP_STATUS_HANDLE_DEVICE_MISMATCH; - if (vmixer->video_width > surf->video_buffer->width || - vmixer->video_height > surf->video_buffer->height || - vmixer->chroma_format != surf->video_buffer->chroma_format) + if (vmixer->video_width > video_buffer->width || + vmixer->video_height > video_buffer->height || + vmixer->chroma_format != video_buffer->chroma_format) return VDP_STATUS_INVALID_SIZE; if (layer_count > vmixer->max_layers) -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] NV_vdpau_interop: fix IsSurfaceNV return type
The spec incorrectly used void as return type, when it should have been GLboolean. This has now been fixed. According to Nvidia, their implementation always used GLboolean. --- include/GL/glext.h | 2 +- src/mapi/glapi/gen/NV_vdpau_interop.xml | 1 + src/mesa/main/vdpau.c | 9 + src/mesa/main/vdpau.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/GL/glext.h b/include/GL/glext.h index 7d6033e..62bae4c 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -9658,7 +9658,7 @@ GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAdd GLAPI void APIENTRY glVDPAUFiniNV (void); GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); diff --git a/src/mapi/glapi/gen/NV_vdpau_interop.xml b/src/mapi/glapi/gen/NV_vdpau_interop.xml index cf5f0ed..0b19e1a 100644 --- a/src/mapi/glapi/gen/NV_vdpau_interop.xml +++ b/src/mapi/glapi/gen/NV_vdpau_interop.xml @@ -29,6 +29,7 @@ + diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c index 3597576..c2cf206 100644 --- a/src/mesa/main/vdpau.c +++ b/src/mesa/main/vdpau.c @@ -205,7 +205,7 @@ _mesa_VDPAURegisterOutputSurfaceNV(const GLvoid *vdpSurface, GLenum target, numTextureNames, textureNames); } -void GLAPIENTRY +GLboolean GLAPIENTRY _mesa_VDPAUIsSurfaceNV(GLintptr surface) { struct vdp_surface *surf = (struct vdp_surface *)surface; @@ -213,13 +213,14 @@ _mesa_VDPAUIsSurfaceNV(GLintptr surface) if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) { _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUIsSurfaceNV"); - return; + return false; } if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) { - _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUIsSurfaceNV"); - return; + return false; } + + return true; } void GLAPIENTRY diff --git a/src/mesa/main/vdpau.h b/src/mesa/main/vdpau.h index f32d6da..627609c 100644 --- a/src/mesa/main/vdpau.h +++ b/src/mesa/main/vdpau.h @@ -50,7 +50,7 @@ _mesa_VDPAURegisterOutputSurfaceNV(const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -extern void GLAPIENTRY +extern GLboolean GLAPIENTRY _mesa_VDPAUIsSurfaceNV(GLintptr surface); extern void GLAPIENTRY -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] clover: Fix building with latest llvm
Ilia Mirkin writes: > On Sat, Mar 1, 2014 at 7:35 PM, Francisco Jerez wrote: >> Bruno Jiménez writes: >> >>> Recently, llvm has changed to use c++11, so we also should use it >>> --- >>> src/gallium/state_trackers/clover/Makefile.am | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/src/gallium/state_trackers/clover/Makefile.am >>> b/src/gallium/state_trackers/clover/Makefile.am >>> index ece2b38..cc9311c 100644 >>> --- a/src/gallium/state_trackers/clover/Makefile.am >>> +++ b/src/gallium/state_trackers/clover/Makefile.am >>> @@ -37,7 +37,7 @@ libcltgsi_la_SOURCES = \ >>> tgsi/compiler.cpp >>> >>> libclllvm_la_CXXFLAGS = \ >>> - -std=c++98 \ >>> + -std=c++11 \ >> >> I think this will break earlier versions of LLVM in subtle ways -- >> mainly because the C++98 and C++11 standard libraries are not guaranteed >> to be binary compatible with each other. We should probably use >> LLVM_CXXFLAGS to detect which -std flag LLVM was built with and make >> sure we use the same. >> >>> $(VISIBILITY_CXXFLAGS) \ >>> $(LLVM_CPPFLAGS) \ >>> $(DEFINES) \ >>> @@ -49,7 +49,7 @@ libclllvm_la_SOURCES = \ >>> llvm/invocation.cpp >>> >>> libclover_la_CXXFLAGS = \ >>> - -std=c++0x \ >>> + -std=c++11 \ >> >> This looks good to me (though it's not strictly related to fixing LLVM). > > Not sure if it's a concern, but I think gcc only supports std=c++11 > starting with 4.7. (Not a huge deal for me -- gentoo marked 4.7 as > stable a while back, but it might be for others.) > Yes, that's fine. Clover requires GCC >= 4.7 to build anyway. > -ilia pgpK3TpJ4_nnJ.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 75226] Dark rendering of War for the Overworld
https://bugs.freedesktop.org/show_bug.cgi?id=75226 Vladimir Ysikov changed: What|Removed |Added CC||granti...@gmail.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] [PATCH] gallium: fix build failure on powerpcspe
From: Roland Stigge In the case of powerpc, mesa activates some altivec instructions that are unknown on the powerpcspe architecture (see https://wiki.debian.org/PowerPCSPEPort), causing a build failure as the 'vand' opcode is not recognized by the assembler. This patch fixes this by preventing the PPC-specialcasing in case of powerpcspe (__NO_FPRS__ is only defined there). https://bugs.debian.org/695746 --- src/gallium/include/pipe/p_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index d603681..8189a73 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -107,12 +107,14 @@ #endif #endif +#ifndef __NO_FPRS__ #if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) #define PIPE_ARCH_PPC #if defined(__ppc64__) || defined(__PPC64__) #define PIPE_ARCH_PPC_64 #endif #endif +#endif #if defined(__s390x__) #define PIPE_ARCH_S390 -- 1.9.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] configure: Remove more flags from llvm-config
This way, we are left with only the preprocessor flags and '-std=X' --- configure.ac | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5b86141..2378d00 100644 --- a/configure.ac +++ b/configure.ac @@ -1542,8 +1542,15 @@ strip_unwanted_llvm_flags() { -e 's/-O.\>//g' \ -e 's/-g\>//g' \ -e 's/-Wall\>//g' \ + -e 's/-Wcast-qual\>//g' \ + -e 's/-Woverloaded-virtual\>//g' \ -e 's/-fcolor-diagnostics\>//g' \ - -e 's/-fomit-frame-pointer\>//g' + -e 's/-fdata-sections\>//g' \ + -e 's/-ffunction-sections\>//g' \ + -e 's/-fno-exceptions\>//g' \ + -e 's/-fomit-frame-pointer\>//g' \ + -e 's/-fvisibility-inlines-hidden\>//g' \ + -e 's/-fPIC\>//g' } -- 1.9.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] clover: Fix building with latest llvm
--- src/gallium/state_trackers/clover/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am index ece2b38..75eae86 100644 --- a/src/gallium/state_trackers/clover/Makefile.am +++ b/src/gallium/state_trackers/clover/Makefile.am @@ -37,9 +37,8 @@ libcltgsi_la_SOURCES = \ tgsi/compiler.cpp libclllvm_la_CXXFLAGS = \ - -std=c++98 \ $(VISIBILITY_CXXFLAGS) \ - $(LLVM_CPPFLAGS) \ + $(LLVM_CXXFLAGS) \ $(DEFINES) \ -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \ -DLIBCLC_LIBEXECDIR=\"$(LIBCLC_LIBEXECDIR)/\" \ @@ -49,7 +48,7 @@ libclllvm_la_SOURCES = \ llvm/invocation.cpp libclover_la_CXXFLAGS = \ - -std=c++0x \ + -std=c++11 \ $(VISIBILITY_CXXFLAGS) libclover_la_LIBADD = \ -- 1.9.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] clover: Fix building with latest llvm
Bruno Jiménez writes: > --- > src/gallium/state_trackers/clover/Makefile.am | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > Reviewed-by: Francisco Jerez > diff --git a/src/gallium/state_trackers/clover/Makefile.am > b/src/gallium/state_trackers/clover/Makefile.am > index ece2b38..75eae86 100644 > --- a/src/gallium/state_trackers/clover/Makefile.am > +++ b/src/gallium/state_trackers/clover/Makefile.am > @@ -37,9 +37,8 @@ libcltgsi_la_SOURCES = \ > tgsi/compiler.cpp > > libclllvm_la_CXXFLAGS = \ > - -std=c++98 \ > $(VISIBILITY_CXXFLAGS) \ > - $(LLVM_CPPFLAGS) \ > + $(LLVM_CXXFLAGS) \ > $(DEFINES) \ > -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \ > -DLIBCLC_LIBEXECDIR=\"$(LIBCLC_LIBEXECDIR)/\" \ > @@ -49,7 +48,7 @@ libclllvm_la_SOURCES = \ > llvm/invocation.cpp > > libclover_la_CXXFLAGS = \ > - -std=c++0x \ > + -std=c++11 \ > $(VISIBILITY_CXXFLAGS) > > libclover_la_LIBADD = \ > -- > 1.9.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev pgpRsAAlJMEWc.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 1/2] configure: Remove more flags from llvm-config
Bruno Jiménez writes: > This way, we are left with only the preprocessor flags and '-std=X' > --- > configure.ac | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > Reviewed-by: Francisco Jerez > diff --git a/configure.ac b/configure.ac > index 5b86141..2378d00 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1542,8 +1542,15 @@ strip_unwanted_llvm_flags() { > -e 's/-O.\>//g' \ > -e 's/-g\>//g' \ > -e 's/-Wall\>//g' \ > + -e 's/-Wcast-qual\>//g' \ > + -e 's/-Woverloaded-virtual\>//g' \ > -e 's/-fcolor-diagnostics\>//g' \ > - -e 's/-fomit-frame-pointer\>//g' > + -e 's/-fdata-sections\>//g' \ > + -e 's/-ffunction-sections\>//g' \ > + -e 's/-fno-exceptions\>//g' \ > + -e 's/-fomit-frame-pointer\>//g' \ > + -e 's/-fvisibility-inlines-hidden\>//g' \ > + -e 's/-fPIC\>//g' > } > > > -- > 1.9.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev pgpdLOjlMC9ey.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] mesa: fix the format of glEdgeFlagPointer
From: Marek Olšák Softpipe expects a float in the vertex shader, which is what glEdgeFlag generates. This fixes piglit/gl-2.0-edgeflag. Cc: mesa-sta...@lists.freedesktop.org --- src/mesa/main/varray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 44db2cb..b4b6fa9 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -569,8 +569,8 @@ void GLAPIENTRY _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) { const GLbitfield legalTypes = UNSIGNED_BYTE_BIT; - /* see table 2.4 edits in GL_EXT_gpu_shader4 spec: */ - const GLboolean integer = GL_TRUE; + /* this is the same type that glEdgeFlag uses */ + const GLboolean integer = GL_FALSE; GET_CURRENT_CONTEXT(ctx); FLUSH_VERTICES(ctx, 0); -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] r600g: port color buffer format conversion from radeonsi
From: Marek Olšák r600_translate_colorformat is rewritten to look like radeonsi. r600_translate_colorswap is shared with radeonsi. r600_colorformat_endian_swap is consolidated. This adds some formats which were missing. Future "plain" formats will automatically be supported. --- src/gallium/drivers/r600/evergreen_state.c | 464 +-- src/gallium/drivers/r600/r600_pipe.h | 2 + src/gallium/drivers/r600/r600_state.c| 459 +- src/gallium/drivers/r600/r600_state_common.c | 149 + 4 files changed, 161 insertions(+), 913 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index e03b676..22a4d49 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -211,467 +211,14 @@ static uint32_t r600_translate_dbformat(enum pipe_format format) } } -static uint32_t r600_translate_colorswap(enum pipe_format format) -{ - switch (format) { - /* 8-bit buffers. */ - case PIPE_FORMAT_L4A4_UNORM: - case PIPE_FORMAT_A4R4_UNORM: - return V_028C70_SWAP_ALT; - - case PIPE_FORMAT_A8_UNORM: - case PIPE_FORMAT_A8_SNORM: - case PIPE_FORMAT_A8_UINT: - case PIPE_FORMAT_A8_SINT: - case PIPE_FORMAT_A16_UNORM: - case PIPE_FORMAT_A16_SNORM: - case PIPE_FORMAT_A16_UINT: - case PIPE_FORMAT_A16_SINT: - case PIPE_FORMAT_A16_FLOAT: - case PIPE_FORMAT_A32_UINT: - case PIPE_FORMAT_A32_SINT: - case PIPE_FORMAT_A32_FLOAT: - case PIPE_FORMAT_R4A4_UNORM: - return V_028C70_SWAP_ALT_REV; - case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_I8_SNORM: - case PIPE_FORMAT_I8_UINT: - case PIPE_FORMAT_I8_SINT: - case PIPE_FORMAT_I16_UNORM: - case PIPE_FORMAT_I16_SNORM: - case PIPE_FORMAT_I16_UINT: - case PIPE_FORMAT_I16_SINT: - case PIPE_FORMAT_I16_FLOAT: - case PIPE_FORMAT_I32_UINT: - case PIPE_FORMAT_I32_SINT: - case PIPE_FORMAT_I32_FLOAT: - case PIPE_FORMAT_L8_UNORM: - case PIPE_FORMAT_L8_SNORM: - case PIPE_FORMAT_L8_UINT: - case PIPE_FORMAT_L8_SINT: - case PIPE_FORMAT_L8_SRGB: - case PIPE_FORMAT_L16_UNORM: - case PIPE_FORMAT_L16_SNORM: - case PIPE_FORMAT_L16_UINT: - case PIPE_FORMAT_L16_SINT: - case PIPE_FORMAT_L16_FLOAT: - case PIPE_FORMAT_L32_UINT: - case PIPE_FORMAT_L32_SINT: - case PIPE_FORMAT_L32_FLOAT: - case PIPE_FORMAT_R8_UNORM: - case PIPE_FORMAT_R8_SNORM: - case PIPE_FORMAT_R8_UINT: - case PIPE_FORMAT_R8_SINT: - return V_028C70_SWAP_STD; - - /* 16-bit buffers. */ - case PIPE_FORMAT_B5G6R5_UNORM: - return V_028C70_SWAP_STD_REV; - - case PIPE_FORMAT_B5G5R5A1_UNORM: - case PIPE_FORMAT_B5G5R5X1_UNORM: - return V_028C70_SWAP_ALT; - - case PIPE_FORMAT_B4G4R4A4_UNORM: - case PIPE_FORMAT_B4G4R4X4_UNORM: - return V_028C70_SWAP_ALT; - - case PIPE_FORMAT_Z16_UNORM: - return V_028C70_SWAP_STD; - - case PIPE_FORMAT_L8A8_UNORM: - case PIPE_FORMAT_L8A8_SNORM: - case PIPE_FORMAT_L8A8_UINT: - case PIPE_FORMAT_L8A8_SINT: - case PIPE_FORMAT_L8A8_SRGB: - case PIPE_FORMAT_L16A16_UNORM: - case PIPE_FORMAT_L16A16_SNORM: - case PIPE_FORMAT_L16A16_UINT: - case PIPE_FORMAT_L16A16_SINT: - case PIPE_FORMAT_L16A16_FLOAT: - case PIPE_FORMAT_L32A32_UINT: - case PIPE_FORMAT_L32A32_SINT: - case PIPE_FORMAT_L32A32_FLOAT: -case PIPE_FORMAT_R8A8_UNORM: - case PIPE_FORMAT_R8A8_SNORM: - case PIPE_FORMAT_R8A8_UINT: - case PIPE_FORMAT_R8A8_SINT: - case PIPE_FORMAT_R16A16_UNORM: - case PIPE_FORMAT_R16A16_SNORM: - case PIPE_FORMAT_R16A16_UINT: - case PIPE_FORMAT_R16A16_SINT: - case PIPE_FORMAT_R16A16_FLOAT: - case PIPE_FORMAT_R32A32_UINT: - case PIPE_FORMAT_R32A32_SINT: - case PIPE_FORMAT_R32A32_FLOAT: - return V_028C70_SWAP_ALT; - case PIPE_FORMAT_R8G8_UNORM: - case PIPE_FORMAT_R8G8_SNORM: - case PIPE_FORMAT_R8G8_UINT: - case PIPE_FORMAT_R8G8_SINT: - return V_028C70_SWAP_STD; - - case PIPE_FORMAT_R16_UNORM: - case PIPE_FORMAT_R16_SNORM: - case PIPE_FORMAT_R16_UINT: - case PIPE_FORMAT_R16_SINT: - case PIPE_FORMAT_R16_FLOAT: - return V_028C70_SWAP_STD; - - /* 32-bit buffers. */ - case PIPE_FORMAT_A8B8G8R8_SRGB: - return V_028C70_SWAP_STD_REV; - case PIPE_FORMAT_B8G8R8A8_SRGB: - return V_028C70_SWAP_ALT; - - case PIPE_FORMAT_B8G8R8A8_UNORM: - case PIPE_FORMAT_B8G8R8X8_UNORM: - return V_028C70_SWAP_ALT; - - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8
[Mesa-dev] [PATCH 3/3] r600g: implement edge flags
From: Marek Olšák --- src/gallium/drivers/r600/evergreen_state.c | 1 + src/gallium/drivers/r600/r600_shader.c | 55 +++--- src/gallium/drivers/r600/r600_shader.h | 1 + 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 22a4d49..1cabf19 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -3303,6 +3303,7 @@ void evergreen_update_vs_state(struct pipe_context *ctx, struct r600_pipe_shader S_02881C_VS_OUT_CCDIST1_VEC_ENA((rshader->clip_dist_write & 0xF0) != 0) | S_02881C_VS_OUT_MISC_VEC_ENA(rshader->vs_out_misc_write) | S_02881C_USE_VTX_POINT_SIZE(rshader->vs_out_point_size) | + S_02881C_USE_VTX_EDGE_FLAG(rshader->vs_out_edgeflag) | S_02881C_USE_VTX_VIEWPORT_INDX(rshader->vs_out_viewport) | S_02881C_USE_VTX_RENDER_TARGET_INDX(rshader->vs_out_layer); } diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 38c68e4..fabadd8 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -286,6 +286,7 @@ struct r600_shader_ctx { int colors_used; boolean clip_vertex_write; unsignedcv_output; + unsignededgeflag_output; int fragcoord_input; int native_integers; int next_ring_offset; @@ -490,10 +491,11 @@ static int r600_spi_sid(struct r600_shader_io * io) * semantic indices, so we'll use 0 for them. */ if (name == TGSI_SEMANTIC_POSITION || - name == TGSI_SEMANTIC_PSIZE || - name == TGSI_SEMANTIC_LAYER || - name == TGSI_SEMANTIC_VIEWPORT_INDEX || - name == TGSI_SEMANTIC_FACE) + name == TGSI_SEMANTIC_PSIZE || + name == TGSI_SEMANTIC_EDGEFLAG || + name == TGSI_SEMANTIC_LAYER || + name == TGSI_SEMANTIC_VIEWPORT_INDEX || + name == TGSI_SEMANTIC_FACE) index = 0; else { if (name == TGSI_SEMANTIC_GENERIC) { @@ -624,6 +626,11 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx) ctx->shader->vs_out_misc_write = 1; ctx->shader->vs_out_point_size = 1; break; + case TGSI_SEMANTIC_EDGEFLAG: + ctx->shader->vs_out_misc_write = 1; + ctx->shader->vs_out_edgeflag = 1; + ctx->edgeflag_output = i; + break; case TGSI_SEMANTIC_VIEWPORT_INDEX: ctx->shader->vs_out_misc_write = 1; ctx->shader->vs_out_viewport = 1; @@ -1162,6 +1169,35 @@ out_err: return r; } +static void convert_edgeflag_to_int(struct r600_shader_ctx *ctx) +{ + struct r600_bytecode_alu alu; + unsigned reg; + + if (!ctx->shader->vs_out_edgeflag) + return; + + reg = ctx->shader->output[ctx->edgeflag_output].gpr; + + /* clamp(x, 0, 1) */ + memset(&alu, 0, sizeof(alu)); + alu.op = ALU_OP1_MOV; + alu.src[0].sel = reg; + alu.dst.sel = reg; + alu.dst.write = 1; + alu.dst.clamp = 1; + alu.last = 1; + r600_bytecode_add_alu(ctx->bc, &alu); + + memset(&alu, 0, sizeof(alu)); + alu.op = ALU_OP1_FLT_TO_INT; + alu.src[0].sel = reg; + alu.dst.sel = reg; + alu.dst.write = 1; + alu.last = 1; + r600_bytecode_add_alu(ctx->bc, &alu); +} + static int generate_gs_copy_shader(struct r600_context *rctx, struct r600_pipe_shader *gs, struct pipe_stream_output_info *so) @@ -1918,6 +1954,8 @@ static int r600_shader_from_tgsi(struct r600_context *rctx, so.num_outputs && !use_llvm) emit_streamout(&ctx, &so); + convert_edgeflag_to_int(&ctx); + if (ring_outputs) { if (key.vs_as_es) emit_gs_ring_writes(&ctx, FALSE); @@ -1953,6 +1991,15 @@ static int r600_shader_from_tgsi(struct r600_context *rctx, output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS; pos_emitted = true; break; + case TGSI_SEMANTIC_EDGEFLAG: + output[j].array_base = 61; + output[j].swizzle_x = 7; +
[Mesa-dev] [PATCH 2/2] st/mesa: fix edge flags for GLSL
From: Marek Olšák This fixes piglit/gl-2.0-edgeflag. Cc: mesa-sta...@lists.freedesktop.org --- src/mesa/state_tracker/st_atom.c| 3 +-- src/mesa/state_tracker/st_program.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 32ce1ea..0df1cd5 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -137,8 +137,7 @@ static void check_attrib_edgeflag(struct st_context *st) if (!arrays) return; - vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj && - arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name; + vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->Enabled; if (vertDataEdgeFlags != st->vertdata_edgeflags) { st->vertdata_edgeflags = vertDataEdgeFlags; st->dirty.st |= ST_NEW_EDGEFLAGS_DATA; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index e9074ac..692a570 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -342,14 +342,14 @@ st_translate_vertex_program(struct st_context *st, stvp->glsl_to_tgsi, &stvp->Base.Base, /* inputs */ - stvp->num_inputs, + vpv->num_inputs, stvp->input_to_index, NULL, /* input semantic name */ NULL, /* input semantic index */ NULL, /* interp mode */ NULL, /* is centroid */ /* outputs */ - stvp->num_outputs, + num_outputs, stvp->result_to_output, stvp->output_semantic_name, stvp->output_semantic_index, -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] radeonsi: move translate_colorswap to common code
From: Marek Olšák Also translate the Y__X swizzle. --- src/gallium/drivers/radeon/r600_pipe_common.h | 1 + src/gallium/drivers/radeon/r600_texture.c | 54 ++ src/gallium/drivers/radeon/r600d_common.h | 5 +++ src/gallium/drivers/radeonsi/si_state.c | 56 +-- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 41af92d..2e545fc 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -424,6 +424,7 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, struct pipe_resource *texture, const struct pipe_surface *templ, unsigned width, unsigned height); +unsigned r600_translate_colorswap(enum pipe_format format); void r600_init_screen_texture_functions(struct r600_common_screen *rscreen); void r600_init_context_texture_functions(struct r600_common_context *rctx); diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index b70b9f1..edb51a7 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -1120,6 +1120,60 @@ static void r600_surface_destroy(struct pipe_context *pipe, FREE(surface); } +unsigned r600_translate_colorswap(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + +#define HAS_SWIZZLE(chan,swz) (desc->swizzle[chan] == UTIL_FORMAT_SWIZZLE_##swz) + + if (format == PIPE_FORMAT_R11G11B10_FLOAT) /* isn't plain */ + return V_0280A0_SWAP_STD; + + if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) + return ~0U; + + switch (desc->nr_channels) { + case 1: + if (HAS_SWIZZLE(0,X)) + return V_0280A0_SWAP_STD; /* X___ */ + else if (HAS_SWIZZLE(3,X)) + return V_0280A0_SWAP_ALT_REV; /* ___X */ + break; + case 2: + if ((HAS_SWIZZLE(0,X) && HAS_SWIZZLE(1,Y)) || + (HAS_SWIZZLE(0,X) && HAS_SWIZZLE(1,NONE)) || + (HAS_SWIZZLE(0,NONE) && HAS_SWIZZLE(1,Y))) + return V_0280A0_SWAP_STD; /* XY__ */ + else if ((HAS_SWIZZLE(0,Y) && HAS_SWIZZLE(1,X)) || +(HAS_SWIZZLE(0,Y) && HAS_SWIZZLE(1,NONE)) || +(HAS_SWIZZLE(0,NONE) && HAS_SWIZZLE(1,X))) + return V_0280A0_SWAP_STD_REV; /* YX__ */ + else if (HAS_SWIZZLE(0,X) && HAS_SWIZZLE(3,Y)) + return V_0280A0_SWAP_ALT; /* X__Y */ + else if (HAS_SWIZZLE(0,Y) && HAS_SWIZZLE(3,X)) + return V_0280A0_SWAP_ALT_REV; /* Y__X */ + break; + case 3: + if (HAS_SWIZZLE(0,X)) + return V_0280A0_SWAP_STD; /* XYZ */ + else if (HAS_SWIZZLE(0,Z)) + return V_0280A0_SWAP_STD_REV; /* ZYX */ + break; + case 4: + /* check the middle channels, the 1st and 4th channel can be NONE */ + if (HAS_SWIZZLE(1,Y) && HAS_SWIZZLE(2,Z)) + return V_0280A0_SWAP_STD; /* XYZW */ + else if (HAS_SWIZZLE(1,Z) && HAS_SWIZZLE(2,Y)) + return V_0280A0_SWAP_STD_REV; /* WZYX */ + else if (HAS_SWIZZLE(1,Y) && HAS_SWIZZLE(2,X)) + return V_0280A0_SWAP_ALT; /* ZYXW */ + else if (HAS_SWIZZLE(1,X) && HAS_SWIZZLE(2,Y)) + return V_0280A0_SWAP_ALT_REV; /* WXYZ */ + break; + } + return ~0U; +} + void r600_init_screen_texture_functions(struct r600_common_screen *rscreen) { rscreen->b.resource_from_handle = r600_texture_from_handle; diff --git a/src/gallium/drivers/radeon/r600d_common.h b/src/gallium/drivers/radeon/r600d_common.h index 357d26f..0b97d32 100644 --- a/src/gallium/drivers/radeon/r600d_common.h +++ b/src/gallium/drivers/radeon/r600d_common.h @@ -116,6 +116,11 @@ #define C_028B20_BUFFER_3_EN 0xFFF7 #define R_028AD0_VGT_STRMOUT_BUFFER_SIZE_0 0x028AD0 +#define V_0280A0_SWAP_STD 0x +#define V_0280A0_SWAP_ALT 0x0001 +#define V_0280A0_SWAP_STD_REV 0x0002 +#define V_0280A0_SWAP_ALT_REV 0x0003 + /* EG+ */ #define R_0084FC_CP_STRMOUT_CNTL0x0084FC #define S_0084FC_OFFSET_UPDATE_DONE(x) (((x) & 0x1) << 0) diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi
[Mesa-dev] intel, dma-buf import and egl image external
There is a comment and two checks in the i965 dma-buf importer, * Images originating via EGL_EXT_image_dma_buf_import can be used only * with GL_OES_EGL_image_external only. however I can't find any reference to this in the spec txt, and removing the checks make my test app run fine using TEXTURE_2D. Dave. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallium: fix build failure on powerpcspe
On Son, 2014-03-02 at 19:58 +0100, Julien Cristau wrote: > From: Roland Stigge > > In the case of powerpc, mesa activates some altivec instructions > that are unknown on the powerpcspe architecture (see > https://wiki.debian.org/PowerPCSPEPort), causing a build failure as the > 'vand' opcode is not recognized by the assembler. > > This patch fixes this by preventing the PPC-specialcasing in case of > powerpcspe (__NO_FPRS__ is only defined there). > > https://bugs.debian.org/695746 > --- > src/gallium/include/pipe/p_config.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/gallium/include/pipe/p_config.h > b/src/gallium/include/pipe/p_config.h > index d603681..8189a73 100644 > --- a/src/gallium/include/pipe/p_config.h > +++ b/src/gallium/include/pipe/p_config.h > @@ -107,12 +107,14 @@ > #endif > #endif > > +#ifndef __NO_FPRS__ > #if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) > #define PIPE_ARCH_PPC > #if defined(__ppc64__) || defined(__PPC64__) > #define PIPE_ARCH_PPC_64 > #endif > #endif > +#endif > > #if defined(__s390x__) > #define PIPE_ARCH_S390 PIPE_ARCH_PPC* are also used for setting PIPE_ARCH_BIG_ENDIAN in src/gallium/include/pipe/p_config.h, so I'm afraid this needs more work. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] [RFC] mesa: propose simple EGL_MESA_image_dma_buf_export
From: Dave Airlie At the moment to get an EGL image to a dma-buf file descriptor, you have to use EGL_MESA_drm_image, and then use libdrm to convert this to a file descriptor. This extension just provides an API modelled on EGL_MESA_drm_image, to return a dma-buf file descriptor. Signed-off-by: Dave Airlie --- docs/specs/MESA_image_dma_buf_export.txt | 74 include/EGL/eglmesaext.h | 4 ++ src/egl/drivers/dri2/egl_dri2.c | 22 ++ src/egl/main/eglapi.c| 25 +++ src/egl/main/eglapi.h| 8 src/egl/main/egldisplay.h| 2 + src/egl/main/eglfallbacks.c | 4 ++ src/egl/main/eglmisc.c | 2 + 8 files changed, 141 insertions(+) create mode 100644 docs/specs/MESA_image_dma_buf_export.txt diff --git a/docs/specs/MESA_image_dma_buf_export.txt b/docs/specs/MESA_image_dma_buf_export.txt new file mode 100644 index 000..ca21ff9 --- /dev/null +++ b/docs/specs/MESA_image_dma_buf_export.txt @@ -0,0 +1,74 @@ +Name + +MESA_image_dma_buf_export + +Name Strings + +EGL_MESA_image_dma_buf_export + +Contact + +Dave Airlie + +Status + +Proposal + +Version + +Version 1 + +Number + + + +Dependencies + +Reguires EGL 1.4 or later. This extension is written against the +wording of the EGL 1.4 specification. + +EGL_KHR_base_image is required. + +Overview + +This extension provides entry points for integrating EGLImage with the +dma-buf infrastructure. The extension lets the application get a file descriptor +corresponding to an EGL image. + +It is designed to provide the opposing functionality to EGL_EXT_image_dma_buf_import. + +IP Status + +Open-source; freely implementable. + +New Procedures and Functions + +EGLBoolean eglExportDMABUFImageMESA(EGLDisplay dpy, +EGLImageKHR image, +int *fd, + EGLint *stride); + +New Tokens + + +Additions to the EGL 1.4 Specification: + +To create a global passable file descriptior for a buffer, call + +EGLBoolean eglExportDMABUFImageMESA(EGLDisplay dpy, + EGLImageKHR image, +int *fd, + EGLint *stride); + +If is non-NULL, a global file descriptor is assigned to the image and +written to , and the stride (in bytes) is written to , if +non-NULL. + +Issues + + +Revision History + +Version 1, June 3, 201 +Initial draft (Dave Airlie) + diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h index b3229e3..2614e18 100644 --- a/include/EGL/eglmesaext.h +++ b/include/EGL/eglmesaext.h @@ -165,6 +165,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fd, EGLint *stride); +#endif #ifdef __cplusplus } #endif diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 892f1f4..bc5ae3f 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -518,6 +518,7 @@ dri2_setup_screen(_EGLDisplay *disp) if (dri2_dpy->image) { disp->Extensions.MESA_drm_image = EGL_TRUE; + disp->Extensions.MESA_image_dma_buf_export = EGL_TRUE; disp->Extensions.KHR_image_base = EGL_TRUE; disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE; if (dri2_dpy->image->base.version >= 5 && @@ -1802,6 +1803,26 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, return EGL_TRUE; } + +static EGLBoolean +dri2_export_dma_buf_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, + int *fd, EGLint *stride) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + struct dri2_egl_image *dri2_img = dri2_egl_image(img); + + (void) drv; + + if (fd) + dri2_dpy->image->queryImage(dri2_img->dri_image, + __DRI_IMAGE_ATTRIB_FD, fd); + + if (stride) + dri2_dpy->image->queryImage(dri2_img->dri_image, + __DRI_IMAGE_ATTRIB_STRIDE, stride); + + return EGL_TRUE; +} #endif #ifdef HAVE_WAYLAND_PLATFORM @@ -2040,6 +2061,7 @@ _eglBuiltInDriverDRI2(const char *args) #ifdef HAVE_DRM_PLATFORM dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa; dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa; + dri2_drv->base.API.ExportDMABUFImageMESA = dri2_export_dma_buf_image_mesa; #endif #ifdef HAVE_WAYLAND_PLATFORM dri2_drv->base.API.BindWaylandDisplayWL = dri2_b
[Mesa-dev] [Bug 75226] Dark rendering of War for the Overworld
https://bugs.freedesktop.org/show_bug.cgi?id=75226 Stepan Bakshaev changed: What|Removed |Added CC||step2back+freedesktop@gmail ||.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