aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* i965: Add and use brw_bo_map()Matt Turner2017-06-0616-54/+52
| | | | | | | | | | | | We can encapsulate the logic for choosing the mapping type. This will also help when we add WC mappings. A few functional changes are made in this patch. On non-LLC, what were previously WB mappings are now GTT mappings (in the prefilling debug code in brw_performance_query.c; the shader_time code in brw_program.c; and in the case of an RW mapping in intel_buffer_objects.c). Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Drop MAP_READ from some write-only mappingsMatt Turner2017-06-064-4/+4
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Pass flags to brw_bo_map_*Matt Turner2017-06-0616-33/+49
| | | | | | | | | | | | | brw_bo_map_cpu() took a write_enable arg, but it wasn't always clear whether we were also planning to read from the buffer. I kept everything semantically identical by passing only MAP_READ or MAP_READ | MAP_WRITE depending on the write_enable argument. The other flags are not used yet, but MAP_ASYNC for instance, will be used in a later patch to remove the need for a separate brw_bo_map_unsynchronized() function. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename brw_bo_map() -> brw_bo_map_cpu()Matt Turner2017-06-0616-29/+30
| | | | | | | | I'm going to make a new function named brw_bo_map() in a later patch that is responsible for choosing the mapping type, so this patch clears the way. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename *_virtual -> map_*Matt Turner2017-06-062-31/+31
| | | | | | | I think these are better names, and it reduces the delta between upstream and Chris Wilson's brw-batch branch. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Pass the map-mode along to intel_mipmap_tree_map_raw()Chris Wilson2017-06-061-13/+16
| | | | | | | | Since we can distinguish when mapping between READ and WRITE, we can pass along the map mode to avoid stalls and flushes where possible. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Add a cache_coherent field to brw_boMatt Turner2017-06-063-0/+9
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove unused 'use_resource_streamer' fieldMatt Turner2017-06-061-1/+0
| | | | | | Missing in the resource streamer removal of commit 951f56cd43bc. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove brw_bo's virtual memberMatt Turner2017-06-0617-121/+102
| | | | | | Just return the map from brw_map_bo_* Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove unused brw_bo_map__* functionsMatt Turner2017-06-062-109/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: make use of NewWindowRectangles driver flagsSamuel Pitoiset2017-06-062-3/+5
| | | | | | | | Now, st_update_window_rectangles() won't be called when the scissor is going to be updated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add new gl_driver_flags::NewWindowRectanglesSamuel Pitoiset2017-06-061-0/+5
| | | | | | | | | | | | This new driver flag will replace _NEW_SCISSOR which is emitted when setting new window rectangles but it actually triggers useless changes in the state tracker (like scissor and rasterizer). EXT_window_rectangles is currently only supported by Nouveau. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove call to Driver.Scissor() in _mesa_WindowRectanglesEXT()Samuel Pitoiset2017-06-061-3/+0
| | | | | | | | | This is actually useless because this driver call is only used by the classic DRI drivers which don't support that extension and probably won't never support it. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when min sample shading changesSamuel Pitoiset2017-06-061-3/+6
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when sample mask changesSamuel Pitoiset2017-06-061-0/+3
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when coverage parameters changeSamuel Pitoiset2017-06-061-3/+7
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Finalize miptrees before prepare_textureJason Ekstrand2017-06-051-0/+4
| | | | | | | | | In order to do resolves for texture views with different formats, we need intel_texture_object::_Format to be valid. Calling intel_finalize_mipmap_tree can safely be done multiple times in a row and should be a fairly cheap operation. Reviewed-by: Topi Pohjolainen <[email protected]>
* st/mesa: don't load cached TGSI shaders on demandMarek Olšák2017-06-051-1/+6
| | | | | | | | | | This fixes a performance issue with the shader cache that delayed Gallium shader create calls until draw calls. I'd like this in stable, but it's not a showstopper. Cc: 17.1 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Order write of query availablity with earlier writesChris Wilson2017-06-031-2/+11
| | | | | | | | | | | | Currently we signal the availabilty of the query result using an unordered pipe-control write. As it is unordered, it may be executed before the write of the query result itself - and so an observer may read the query result too early. Fix this by requesting that the write of the availablity flag is ordered after earlier pipe control writes. Testcase: piglit/arb_query_buffer_object-qbo/*async* Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* st/mesa: Add support for ARB_post_depth_coverageLyude2017-06-022-1/+7
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* i965: Replace 0 with ISL_FORMAT_UNSUPPORTED in format table (v2)Chad Versace2017-06-022-92/+6
| | | | | | | | | | | | | | | | | When given an *unsupported* mesa_format, brw_isl_format_for_mesa_format() returned 0, a *valid* isl_format, ISL_FORMAT_R32G32B32A32_FLOAT. The problem is that brw_isl_format_for_mesa_format's inner table used 0 instead of ISL_FORMAT_UNSUPPORTED to indicate unsupported mesa formats. Some callers of brw_isl_format_for_mesa_format() were aware of this weirdness, and worked around it. This patch removes those workarounds. v2: Ensure that all array elements are initialized to ISL_FORMAT_UNSUPPORTED, even when new formats are added to enum mesa_format, by using an designated range initializer. Reviewed-by: Matt Turner <[email protected]>
* mesa: document range of SampleCoverageValue, MinSampleShadingValueBrian Paul2017-06-021-2/+2
| | | | Trivial.
* xlib: fix glXGetCurrentDisplay() failureBrian Paul2017-06-024-5/+18
| | | | | | | | | | | | | | | | | glXGetCurrentDisplay() has been broken for years and nobody noticed until recently. This change adds a new XMesaGetCurrentDisplay() that the GLX emulation API can call, just as we did for glXGetCurrentContext(). Tested by hacking glxgears to call glXGetCurrentContext() before and after glXMakeCurrent() to verify the return value is NULL beforehand and the same as the opened display afterward. Also tested by Tom Hudson with his tests programs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100988 Cc: [email protected] Tested-by: Tom Hudson <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* intel/blorp: Handle gen6 stencil/HiZ offsets in the back-endJason Ekstrand2017-06-014-72/+11
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/isl: Make get_intratile_offset_el take the element size in bitsJason Ekstrand2017-06-011-1/+1
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/isl: Remove the device parameter from isl_tiling_get_infoJason Ekstrand2017-06-011-2/+1
| | | | | | | | | We were only using it for validating that we don't use Ys/Yf on gen8 and earlier. Removing it from isl_tiling_get_info lets us remove it from a bunch of other things that had no business needing a hardware generation. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Rework Sandy Bridge HiZ and stencil layoutsJason Ekstrand2017-06-015-29/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sandy Bridge does not technically support mipmapped depth/stencil. In order to work around this, we allocate what are effectively completely separate images for each miplevel, ensure that they are page-aligned, and manually offset to them. Prior to layered rendering, this was a simple matter of setting a large enough halign/valign. With the advent of layered rendering, however, things got more complicated. Now, things weren't as simple as just handing a surface off to the hardware. Any miplevel of a normally mipmapped surface can be considered as just an array surface given the right qpitch. However, the hardware gives us no capability to specify qpitch so this won't work. Instead, the chosen solution was to use a new "all slices at each LOD" layout which laid things out as a mipmap of arrays rather than an array of mipmaps. This way you can easily offset to any of the miplevels and each is a valid array. Unfortunately, the "all slices at each lod" concept missed one fundamental thing about SNB HiZ and stencil hardware: It doesn't just always act as if you're always working with a non-mipmapped surface, it acts as if you're always working on a non-mipmapped surface of the same size as LOD0. In other words, even though it may only write the upper-left corner of each array slice, the qpitch for the array is for a surface the size of LOD0 of the depth surface. This mistake causes us to under-allocate HiZ and stencil in some cases and also to accidentally allow different miplevels to overlap. Sadly, piglit test coverage didn't quite catch this until I started making changes to the resolve code that caused additional HiZ resolves in certain tests. This commit switches Sandy Bridge HiZ and stencil over to a new scheme that lays out the non-zero miplevels horizontally below LOD0. This way they can all have the same qpitch without interfering with each other. Technically, the miplevels still overlap, but things are spaced out enough that each page is only in the "written area" of one LOD. Cc: "17.0 17.1" <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* automake: Link all libGL.so variants with -Bsymbolic.Jose Fonseca2017-06-011-0/+1
| | | | | | | | | | | | | | | | | | We were linking src/glx with -Bsymbolic, but not the classic/gallium X11 libGL.so. But it's always a good idea to build all libGL.so and all DRI drivers with -Bsymbolic, otherwise they might resolve symbols from the 3rd party application executable or shared libraries, which is _never_ what we want. In particular, this can happen when intercepting OpenGL calls with apitrace, before https://github.com/apitrace/apitrace/commit/63194b2573176ef34efce1a5c8b08e624b8dddf5 Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()Chad Versace2017-06-011-5/+1
| | | | | | | | | | | This function never occurs in the callchain of a GL function. It occurs only in the callchain of eglCreate*Surface and the analogous paths for GLX. Therefore, even if a thread does have a bound GL context, emitting a GL error here is wrong. A misplaced GL error, when no GL call is made, can confuse clients. Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]>
* i965: Cleanup in intel_create_winsys_renderbuffer()Chad Versace2017-06-011-5/+2
| | | | | | | Combine variable declarations and assignments. Trivial cleanup. Reviewed-by: Ian Romanick <[email protected]>
* i965: Remove bad assert on isl_formatChad Versace2017-06-011-1/+0
| | | | | | | translate_tex_format() asserted that isl_format != 0. But 0 is a valid format, ISL_FORMAT_R32G32B32A32_FLOAT. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Fix return type of translate_tex_format()Chad Versace2017-06-013-6/+6
| | | | | | | | | It returns an isl_format, not GLuint BRW_FORMAT. I updated every translate_tex_format() found by git-grep. No change in behavior. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Fix return type of brw_isl_format_for_mesa_format() [v2]Chad Versace2017-06-013-8/+10
| | | | | | | | | | | It returns an isl_format, not uint32_t BRW_FORMAT. I updated every brw_isl_format_for_mesa_format() found by git-grep. No change in behavior. v2: Rebased atop Anuj's patch, which has some of the same fixes. Reviewed-by: Jason Ekstrand <[email protected]> (v1)
* i965: Remove an extra semicolonAnuj Phogat2017-06-011-1/+1
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Rename brw_format variable names to isl_formatAnuj Phogat2017-06-013-7/+9
| | | | | | | | | | This patch makes non functional changes. Renaming is just to make the code more readable. V2: update the types to "enum isl_format" Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Reject unsupported formats in glEGLImageTargetTexture2D()Chad Versace2017-06-011-0/+4
| | | | | | | | | | If the EGLImage's format is not a supported texture format according to brw_surface_formats.c, then refuse to create the miptree. This follows the precedent in glEGLImageRenderbufferStorage (implemented by intel_image_target_renderbuffer_storage), which rejects the EGLImage's format if is not renderable. Reviewed-by: Kenneth Graunke <[email protected]>
* genxml: Make 3DSTATE_CONSTANT_BODY on Gen7+ use arrays.Kenneth Graunke2017-06-011-6/+4
| | | | | | This will let us initialize the constant buffers with loops. Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Simplify SO_DECL handling.Kenneth Graunke2017-06-011-28/+13
| | | | | | | We can initialize structs directly, avoid some temporaries, and cut out about half of the skip component handling. Reviewed-by: Rafael Antognolli <[email protected]>
* i965: Make a local for linked_xfb->Outputs[i], to shorten things.Kenneth Graunke2017-06-011-9/+10
| | | | | | This seems a bit more readable. Reviewed-by: Rafael Antognolli <[email protected]>
* i965: Move SOL PSIZ hacks from draw time to link time.Kenneth Graunke2017-06-012-22/+40
| | | | | | | | | We can just update the gl_transform_feedback_info fields at link time to make the VUE header fields have the right location and component. Then we don't need to handle them specially at draw time, which is expensive. Reviewed-by: Rafael Antognolli <[email protected]>
* mesa/main: replace remaining uses of IROUND() in GetUniform*() by round()Iago Toral Quiroga2017-06-011-2/+2
| | | | | | | | | These were correct since they were used only in conversions to signed integers, however this makes the implementation a bit more is more consistent and reduces chances of propagating use of these macros to unsigned cases in the future, which would not be correct. Reviewed-by: Matt Turner <[email protected]>
* mesa/main: conversion from float in GetUniformi64v requires rounding to nearestIago Toral Quiroga2017-06-011-1/+1
| | | | | | | | As we do for all other cases of float/double conversions to integers. v2: use round() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Add conversion from double to uint64/int64 in GetUniform*i64v()Iago Toral Quiroga2017-06-011-0/+14
| | | | | | | | v2: - need unsigned rounding for double->uint64 conversion (Nicolai) - use round() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Clamp GetUniformui64v values to be >= 0Iago Toral Quiroga2017-06-011-1/+45
| | | | | | | | | | Like we do for the 32-bit case. v2: - need unsigned rounding for float->uint64 conversion (Nicolai) - use roundf() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Clamp GetUniformuiv values to be >= 0Kenneth Graunke2017-06-011-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | Section 2.2.2 (Data Conversions For State Query Commands) of the OpenGL 4.5 October 24th 2016 specification says: "If a command returning unsigned integer data is called, such as GetSamplerParameterIuiv, negative values are clamped to zero." v2: uint to int conversion should clamp to INT_MAX (Nicolai) v3 (Iago) - Add conversions conversions from 64-bit integer paths - Rebase on master v4: - need unsigned rounding for float/double->uint conversions (Nicolai) - use round{f}() instead of IROUND() macros (Iago) Fixes: KHR-GL45.gpu_shader_fp64.state_query Reviewed-by: Nicolai Hähnle <[email protected]> (v2) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: fix indentation in _mesa_get_uniform()Iago Toral Quiroga2017-06-011-98/+101
| | | | | | | v2: also change the style of the large conditional in that function to follow the style from most other parts of Mesa (Nicolai) Reviewed-by: Matt Turner <[email protected]>
* r100: Silence numerous unused this or that warningsIan Romanick2017-05-311-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | radeon_fbo.c: In function ‘radeon_map_renderbuffer_s8z24’: radeon_fbo.c:147:50: warning: unused parameter ‘ctx’ [-Wunused-parameter] radeon_map_renderbuffer_s8z24(struct gl_context *ctx, ^~~ radeon_fbo.c: In function ‘radeon_map_renderbuffer_z16’: radeon_fbo.c:186:48: warning: unused parameter ‘ctx’ [-Wunused-parameter] radeon_map_renderbuffer_z16(struct gl_context *ctx, ^~~ radeon_fbo.c: In function ‘radeon_unmap_renderbuffer_s8z24’: radeon_fbo.c:344:52: warning: unused parameter ‘ctx’ [-Wunused-parameter] radeon_unmap_renderbuffer_s8z24(struct gl_context *ctx, ^~~ radeon_fbo.c: In function ‘radeon_unmap_renderbuffer_z16’: radeon_fbo.c:377:50: warning: unused parameter ‘ctx’ [-Wunused-parameter] radeon_unmap_renderbuffer_z16(struct gl_context *ctx, ^~~ radeon_fbo.c: In function ‘radeon_nop_alloc_storage’: radeon_fbo.c:624:75: warning: unused parameter ‘rb’ [-Wunused-parameter] radeon_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb, ^~ radeon_fbo.c:625:12: warning: unused parameter ‘internalFormat’ [-Wunused-parameter] GLenum internalFormat, GLuint width, GLuint height) ^~~~~~~~~~~~~~ radeon_fbo.c:625:35: warning: unused parameter ‘width’ [-Wunused-parameter] GLenum internalFormat, GLuint width, GLuint height) ^~~~~ radeon_fbo.c:625:49: warning: unused parameter ‘height’ [-Wunused-parameter] GLenum internalFormat, GLuint width, GLuint height) ^~~~~~ radeon_fbo.c: In function ‘radeon_bind_framebuffer’: radeon_fbo.c:696:74: warning: unused parameter ‘fbread’ [-Wunused-parameter] struct gl_framebuffer *fb, struct gl_framebuffer *fbread) ^~~~~~ radeon_fbo.c: In function ‘radeon_validate_framebuffer’: radeon_fbo.c:832:19: warning: unused variable ‘radeon’ [-Wunused-variable] radeonContextPtr radeon = RADEON_CONTEXT(ctx); ^~~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* r100: Use _mesa_get_format_base_format in radeon_update_wrapperIan Romanick2017-05-311-1/+1
| | | | | | | | | | | | | | The wrapper is for a renderbuffer around a texture. Textures can have formats (e.g., 3) that aren't valide for API generated renderbuffers. _mesa_base_fbo_format will return 0, but _mesa_get_format_base_format will return the base format of RGB. Fixes a crashes in piglit tests fbo-alphatest-formats (all subtests pass) and fbo-colormask-formats (some subtests pass, some fail). Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* r100,r200: Don't assume glVisual is non-NULL during context creationIan Romanick2017-05-313-3/+1
| | | | | | | | | | | Thanks to EGL_MESA_configless_context, the visual pointer can be NULL. Fixes a segfault (or assertion failure) in piglit's egl-configless-context test. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* r100: Don't assume that the base mipmap of a texture existsIan Romanick2017-05-311-4/+10
| | | | | | | | Fixes crashes in piglit's gl-1.2-texture-base-level. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>