summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix compiler warnings in link_uniforms.cppBrian Paul2014-03-061-1/+2
| | | | | | | | | With a non-debug build, gcc has two complaints: 1. 'found' var not used. Silence with '(void) found;' 2. 'id' not initialized. It's assigned by the UniformHash->get() call, actually. But init it to zero to silence gcc. Reviewed-by: Matt Turner <[email protected]>
* mesa/st: only compare the one scissorIlia Mirkin2014-03-051-1/+1
| | | | | | | | | sizeof(scissor) returns the size of the full array rather than a single element. Fix it to consider just the one element. Fixes: 0705fa35 ("st/mesa: add support for GL_ARB_viewport_array (v0.2)") Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: make winsys fbo sRGB-capable when supportedChia-I Wu2014-03-063-12/+66
| | | | | | | | | | | | | | | | | | | | | | The texture formats of winsys fbo are always linear becase the st manager (st/dri for example) could not know the colorspace used. But it does not mean that we cannot make the fbo sRGB-capable. By - setting rb->Visual.sRGBCapable to GL_TRUE when the pipe driver supports the format in sRGB colorspace, - giving rb an sRGB internal format, and - updating code to check rb->Format instead of strb->texture->format, we should be good. Fixed bug 75226 for at least llvmpipe and ilo, with no piglit regression. v2: do not set rb->Visual.sRGBCapable for GLES contexts to avoid surprises Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75226 Reviewed-by: Brian Paul <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* st/mesa: add mappings for MESA_FORMAT_B8G8R8X8_SRGBChia-I Wu2014-03-061-2/+9
| | | | | | The format is mapped to PIPE_FORMAT_B8G8R8X8_SRGB. Reviewed-by: Brian Paul <[email protected]>
* mesa: add MESA_FORMAT_B8G8R8X8_SRGBChia-I Wu2014-03-066-4/+76
| | | | | | | The format is needed to represent an RGB-only winsys framebuffer that is sRGB-capable. Reviewed-by: Brian Paul <[email protected]>
* mesa: fix packing/unpacking for MESA_FORMAT_A4R4G4B4_UNORMBrian Paul2014-03-053-13/+13
| | | | | | | | | Spotted by Chia-I Wu. v2: also fix unpack_ubyte_ARGB4444_REV() Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Fix predicated-send-based discards with MRT.Eric Anholt2014-03-051-2/+2
| | | | | | | | | | | | | | | | | | | We need the header setup to not be predicated on which pixels are undiscarded. I'm not sure originally if I had thought that the mask disable implied predicate disable, or if I had just misread the mask disable as predicate disable. Either way, I know I had spent more time thinking about this in the gen8 generator than the gen7 generator. Plus, it turns out that I had mis-implemented the "the GPU will use the predicate unless this header is present" comment, by skipping setting up the pixel mask when the header was present. Fixes GPU hangs in piglit glsl-fs-discard-mrt, Trine, Trine 2 and preusmably MLL. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75207 Tested-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove remaining uses of _glthread_GetID()Brian Paul2014-03-056-30/+3
| | | | | | | | | | | | | | | It was really only used in the radeon driver for a debug printf. And evidently, libGL.so referenced it just to work around some sort of linker issue. This patch removes the two calls to the function and the function itself. Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'. Though, the missing symbol doesn't cause any issues on my system but it does cause glxinfo to fail on one of our test systems. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: new init_teximage_fields_ms() function to init MS texture imagesBrian Paul2014-03-051-15/+29
| | | | | | | Before, it was kind of ugly to set the multisample fields with assignments after we called _mesa_init_teximage_fields(). Reviewed-by: Anuj Phogat <[email protected]>
* WIP: freedreno/a3xx: incorrect scissor for binning passRob Clark2014-03-053-8/+35
| | | | | | | | | | | | | If scissor optimization is used (to avoid bringing scissored portions of the render target into GMEM and then back out to system memory) in combination with hw binning pass, the result would be a scissor mismatch between binning pass and rendering pass. This would cause rendering bugs in some scenarios with (for example) gnome-shell. I would have expected that simply using the correct screen-scissor during the binning pass would be enough, but seems like there is something else missing. So for now disable binning pass if scissor optimization is used.
* i965: Mark invariants in backend_visitor as constantsTopi Pohjolainen2014-03-051-6/+6
| | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: Merge resolving of shader program sourceTopi Pohjolainen2014-03-0511-26/+23
| | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: Merge initialisation of backend_visitorTopi Pohjolainen2014-03-054-14/+23
| | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/wm: Use resolved miptree consistently in surface setupTopi Pohjolainen2014-03-052-13/+13
| | | | | | | | | | | | Most of the logic refers to the local variable 'mt' directly but a few cases use 'intelObj->mt' instead. These are the same for now but will be different once stencil miptree gets used. v2 (Ian): fixed also indentation in surrounding lines Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/vec4: Mark invariant members as constants in vec4_visitorTopi Pohjolainen2014-03-052-7/+7
| | | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: Mark sources for offset getters as constantsTopi Pohjolainen2014-03-054-9/+9
| | | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* nv50,nvc0: add 11f_11f_10f vertex supportIlia Mirkin2014-03-043-1/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* i965: Implement ARB_stencil_texturing on Gen8+.Kenneth Graunke2014-03-044-4/+20
| | | | | | | | | | | | | | | | | | | | On earlier hardware, we had to implement math in the shader to translate Y-tiled or untiled coordinates to W-tiled coordinates (which is what BLORP does today in order to texture from stencil buffers). On Broadwell, we can simply state that it's W-tiled in SURFACE_STATE, and adjust the pitch. This is much easier. In the surface state code, I chose to handle the "should we sample depth or stencil?" question separately from the setup for sampling from stencil. This should make it work with the BindRenderbufferTexImage hook as well, and hopefully be reusable for GL_ARB_texture_stencil8 someday. v2: Update docs/GL3.txt (caught by Matt). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).Kenneth Graunke2014-03-046-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While the GL_ARB_stencil_texturing extension does not allow the creation of stencil textures, it does allow shaders to sample stencil values stored in packed depth/stencil textures. Specifically, applications can call glTexParameter* with a pname of GL_DEPTH_STENCIL_TEXTURE_MODE and value of either GL_DEPTH_COMPONENT or GL_STENCIL_INDEX to select which component they wish to sample. The default value is GL_DEPTH_COMPONENT (for traditional depth sampling). Shaders should use an unsigned integer sampler (presumably usampler2D) to access stencil data. Otherwise, results are undefined. Using shadow samplers with GL_STENCIL_INDEX selected also is undefined behavior. This patch creates a new gl_texture_object field, StencilSampling, to indicate that stencil should be sampled rather than depth. (I chose to use a boolean since I figured it would be more convenient for drivers.) It also introduces the [Get]TexParameter code to get and set the value, and of course the extension plumbing. v2: Also consider textures incomplete when sampling stencil with non-NEAREST min/mag filters (caught by Eric Anholt). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* radeon/uvd: fix typo in documentationDieter Nützel2014-03-041-1/+1
| | | | | | s/grap/grab/ Signed-off-by: Alex Deucher <[email protected]>
* clover: Use correct LLVM version in #if for DataLayout constructionTom Stellard2014-03-041-1/+1
| | | | Spotted by Michel Dänzer.
* translate: fix buffer overflowsZack Rusin2014-03-044-6/+18
| | | | | | | | | | | | | | Because in draw we always inject position at slot 0 whenever fragment shader would take the maximum number of inputs (32) it meant that we had PIPE_MAX_ATTRIBS + 1 slots to translate, which meant that we were crashing with fragment shaders that took the maximum number of attributes as inputs. The actual max number of attributes we need to translate thus is PIPE_MAX_ATTRIBS + 1. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Matthew McClure <[email protected]>
* draw/llvm: fix generation of the VS with GS presentZack Rusin2014-03-041-7/+7
| | | | | | | | | | | | | | | | | draw_current_shader_* functions return a final output when considering both the geometry shader and the vertex shader. But when code generating vertex shader we can not be using output slots from the geometry shader because, obviously, those can be completely different. This fixes a number of very non-obvious crashes. A side-effect of this bug was that sometimes the vertex shading code could save some random outputs as position/clip when the geometry shader was writing them and vertex shader had different outputs at those slots (sometimes writing garbage and sometimes something correct). Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Matthew McClure <[email protected]>
* mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in ↵Anuj Phogat2014-03-041-2/+11
| | | | | | | | | | | | | | | | | | glTexImage{123}D() From OpenGL 3.3 spec, page 141: "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL require either depth component data or depth/stencil component data. Textures with other base internal formats require RGBA component data. The error INVALID_OPERATION is generated if one of the base internal format and format is DEPTH_COMPONENT or DEPTH_STENCIL, and the other is neither of these values." Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use clear_teximage_fields() in place of _mesa_init_teximage_fields()Anuj Phogat2014-03-041-2/+1
| | | | | | | This patch makes no functional changes to the code. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Set initial internal format of a texture to GL_RGBAAnuj Phogat2014-03-041-3/+10
| | | | | | | | | | | | | From OpenGL 4.0 spec, page 398: "The initial internal format of a texel array is RGBA instead of 1. TEXTURE_COMPONENTS is deprecated; always use TEXTURE_INTERNAL_FORMAT." Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/osmesa: check buffer size when searching for buffersBrian Paul2014-03-041-4/+7
| | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75543 Cc: "10.1" <[email protected]>
* mapi/u_thread: Use GetCurrentThreadIdJosé Fonseca2014-03-041-0/+18
| | | | | | | | u_thread_self() expects thrd_current() to return a unique numeric ID for the current thread, but this is not feasible on Windows. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r600g: implement edge flagsMarek Olšák2014-03-043-4/+53
| | | | | Cc: [email protected] Reviewed-by: Alex Deucher <[email protected]>
* r600g: port color buffer format conversion from radeonsiMarek Olšák2014-03-044-913/+161
| | | | | | | | | | | | 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. Cc: [email protected] Reviewed-by: Alex Deucher <[email protected]>
* radeonsi: move translate_colorswap to common codeMarek Olšák2014-03-044-54/+62
| | | | | | | Also translate the Y__X swizzle. Cc: [email protected] Reviewed-by: Alex Deucher <[email protected]>
* mesa: remove unneeded glthread.c fileBrian Paul2014-03-033-9/+0
| | | | | | The _glthread_GetID() function is also defined in mapi_glapi.c Reviewed-by: José Fonseca <[email protected]>
* mesa: remove empty glthread.h fileBrian Paul2014-03-0311-24/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: remove unused glthread/TSD macrosBrian Paul2014-03-031-7/+0
| | | | Reviewed-by: José Fonseca <[email protected]>
* xlib: remove unneeded context tracking codeBrian Paul2014-03-031-43/+4
| | | | | | This removes the only use of _glthread_Get/SetTSD(), etc. Reviewed-by: José Fonseca <[email protected]>
* xlib: simplify context handlingBrian Paul2014-03-033-109/+28
| | | | | | | Get rid of the fake_glx_context struct. Now, an XMesaContext is the same as a GLXContext. Reviewed-by: José Fonseca <[email protected]>
* xlib: remove unused realglx.[ch] filesBrian Paul2014-03-033-517/+4
| | | | | | | At one point in time, the xlib driver could call the real GLX functions. But that's long dead. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove unused _glthread_*MUTEX() macrosBrian Paul2014-03-031-7/+0
| | | | Reviewed-by: José Fonseca <[email protected]>
* glsl: switch to c11 mutex functionsBrian Paul2014-03-031-7/+7
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: switch to c11 mutex functionsBrian Paul2014-03-0320-140/+140
| | | | Reviewed-by: José Fonseca <[email protected]>
* xlib: switch to c11 mutex functionsBrian Paul2014-03-033-14/+14
| | | | | | | The _glthread_LOCK/UNLOCK_MUTEX() macros are just wrappers around the c11 mutex functions. Let's start getting rid of those wrappers. Reviewed-by: José Fonseca <[email protected]>
* mesa: update packed format layout commentsBrian Paul2014-03-031-50/+50
| | | | | | | | | Update the comments for the packed formats to accurately reflect the layout of the bits in the pixel. For example, for the packed format MESA_FORMAT_R8G8B8A8, R is in the least significant position while A is in the most-significant position of the 32-bit word. v2: also fix MESA_FORMAT_A1B5G5R5_UNORM, per Roland.
* mesa: don't define c99 math functions for MSVC >= 1800Hans2014-03-031-1/+1
| | | | | Signed-off-by: Brian Paul <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* util: don't define isfinite(), isnan() for MSVC >= 1800Hans2014-03-031-0/+4
| | | | | Signed-off-by: Brian Paul <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* mesa: don't call ctx->Driver.ClearBufferSubData() if size==0Brian Paul2014-03-031-4/+8
| | | | | | | | Fixes failed assertion when trying to map zero-length region. https://bugs.freedesktop.org/show_bug.cgi?id=75660 Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* softpipe: use 64-bit arithmetic in softpipe_resource_layout()Brian Paul2014-03-031-3/+3
| | | | | | | | To avoid 32-bit integer overflow for large textures. Note: we're already doing this in llvmpipe. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* NV_vdpau_interop: fix IsSurfaceNV return typeGrigori Goronzy2014-03-033-5/+7
| | | | | | | | 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. Reviewed-by: Christian König <[email protected]>
* st/vdpau: fix possible NULL dereferenceGrigori Goronzy2014-03-031-4/+4
| | | | Reviewed-by: Christian König <[email protected]>
* st/omx: always advertise all componentsChristian König2014-03-032-33/+23
| | | | | | | | | | omx_component_library_Setup should return all entrypoints the library implements, independent of what is available on the current hardware. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74944 Signed-off-by: Christian König <[email protected]> Reviewed-by: Leo Liu <[email protected]>
* clover: Fix building with latest llvmBruno Jiménez2014-03-031-3/+2
| | | | | Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Tom Stellard <[email protected]>