summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add update_single_shader_texture_used() helperSamuel Pitoiset2017-06-141-29/+38
| | | | | | | | This will also be used for looping over bindless samplers bound to texture units. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: process uniform images declared bindlessSamuel Pitoiset2017-06-141-0/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: process uniform samplers declared bindlessSamuel Pitoiset2017-06-141-0/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add infrastructure for bindless samplers/images bound to unitsSamuel Pitoiset2017-06-141-0/+52
| | | | | | | | | | | | | | | | | | | Yes, ARB_bindless_texture allows to do this. In other words, in a situation like: layout (bindless_sampler) uniform sampler2D tex; The 'tex' sampler uniform can be either set with glUniform1() (old-style bound samplers) or with glUniformHandleui() (resident handles). When glUniform1() is used, we have to somehow make the texture resident "under the hood". This is done by requesting a texture handle to the driver, making the handle resident in the current context and overwriting the value directly in the constant buffer. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: store bindless samplers as PROGRAM_UNIFORMSamuel Pitoiset2017-06-141-1/+1
| | | | | | | | Old-style samplers (ie. bound samplers) are stored as PROGRAM_SAMPLER, while bindless ones are PROGRAM_UNIFORM. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: keep track of the current variable in add_uniform_to_shaderSamuel Pitoiset2017-06-141-0/+2
| | | | | | | | | | | | Bindless samplers are considered PROGRAM_UNIFORM but add_uniform_to_shader::visit_field() is based on glsl_type. Because only ir_variable knows if the uniform variable is bindless via ir_variable::bindless, store it instead of adding a new parameter to visit_field(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to change tex buffers when a handle is allocatedSamuel Pitoiset2017-06-141-2/+2
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by BufferData if it is called to modify a buffer object bound to a buffer texture while that texture object is referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to change textures when a handle is allocatedSamuel Pitoiset2017-06-141-1/+24
| | | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to update tex parameters when a handle is allocatedSamuel Pitoiset2017-06-141-0/+38
| | | | | | | | | | | | | The ARB_bindless_texture spec says: "The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to update sampler parameters when a handle is allocatedSamuel Pitoiset2017-06-141-11/+22
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by SamplerParameter* if <sampler> identifies a sampler object referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add support for glUniformHandleui64*ARB()Samuel Pitoiset2017-06-143-0/+83
| | | | | | | | | | | | | | Bindless sampler/image handles are represented using 64-bit unsigned integers. The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by UniformHandleui64{v}ARB if the sampler or image uniform being updated has the "bound_sampler" or "bound_image" layout qualifier"." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add support for unsigned 64-bit vertex attributesSamuel Pitoiset2017-06-145-3/+52
| | | | | | | | This adds support in the VBO and array code to handle unsigned 64-bit vertex attributes as specified by ARB_bindless_texture. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: implement ARB_bindless_textureSamuel Pitoiset2017-06-148-7/+960
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move some hash declarations to hash.hSamuel Pitoiset2017-06-142-56/+56
| | | | | | | These will be used by the bindless hash tables to initialize the default deleted key value. Signed-off-by: Samuel Pitoiset <[email protected]>
* mapi: add GL_ARB_bindless_texture entry pointsSamuel Pitoiset2017-06-1415-0/+258
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unmap the stream_uploader buffer before drawingBrian Paul2017-06-131-0/+4
| | | | | | | | | | | | | Some drivers require that the vertex buffers be unmapped prior to drawing. This change unmaps the stream_uploader buffer after we've uploaded the zero-stride attributes (unless the driver supports rendering with mapped buffers). This fixes a regression in the VMware driver since 17f776c27be266f2. Some Mesa demos such as mandelbrot and brick would display black quads instead of the expected rendering. Reviewed-by: Marek Olšák <[email protected]>
* st_glsl_to_tgsi: init index to 0 before get_deref_offsets()Samuel Pitoiset2017-06-131-2/+2
| | | | | | | Fixes: 8ec4975cd83 ("st_glsl_to_tgsi: don't try and pass 32-bit values to get_deref_offsets") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101401 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-and-Tested-by: Michel Dänzer <[email protected]>
* st/mesa: skip texture validation logic when nothing has changedTimothy Arceri2017-06-133-0/+39
| | | | | | | | | | Based on the same logic in the i965 driver 2f225f61451abd51 and 16060c5adcd4. perf reports st_finalize_texture() going from 0.60% -> 0.16% with this change when running the Xonotic benchmark from PTS. Reviewed-by: Marek Olšák <[email protected]>
* st_glsl_to_tgsi: don't try and pass 32-bit values to get_deref_offsetsDave Airlie2017-06-131-3/+6
| | | | | | | | | Just use a temporary 16-bit index. This fixes coverity issue, pointed to me by Ilia. Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: fix missing breakLionel Landwerlin2017-06-121-0/+1
| | | | | | | | | Pretty obvious missing break statement. CID: 1412564 Fixes: 641405f797 "i965: Use the new tracking mechanism for HiZ" Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed by: Elie Tournier <[email protected]>
* st/mesa: call check_program_state only when neededMarek Olšák2017-06-121-2/+5
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: include gen4_blorp_exec.h into EXTRA_DISTJuan A. Suarez Romero2017-06-121-0/+1
| | | | | | Otherwise, `make distcheck` will fail. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Call intel_prepare_render() from intel_update_state()Kenneth Graunke2017-06-121-0/+2
| | | | | | | | | | | | | | | | | | | The resolve code looks at the current color draw buffers. These are not valid until intel_prepare_render() is called. You can end up with one color buffer bound, but where the renderbuffer has zero width/height and no miptree allocated. You can get a call chain like: _mesa_Clear -> _mesa_update_state -> intel_update_state, where no brw driver hooks were called, so there is no other point at which we could have called this. Fixes crashes in KWin where Clear was causing intel_disable_rb_aux_buffer to crash on irb != NULL but irb->mt == NULL. According to Tapani, this also fixes crashes seen on Android. Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Tapani Pälli <[email protected]>
* i965/cnl: Make URB {VS, GS, HS, DS} sizes non multiple of 3Anuj Phogat2017-06-091-0/+1
| | | | | | | | | | v1: By Ben Widawsky <[email protected]> v2: v1 had an assert only for VS. Add the restriction for GS, HS and DS as well and make sure the allocated sizes are not multiple of 3. v3: Move the entry_size checks in to compiler code (Ken) Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/cnl: Don't resolve single sampled color rb in case of sRGB formatsAnuj Phogat2017-06-091-1/+1
| | | | | | | | As sRGB now supports lossless compression, we also need to stop resolving single sampled color render buffers for sRGB formats in Gen 10. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Implement depth count workaroundBen Widawsky2017-06-091-0/+8
| | | | | Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Start using CNL MOCS definesAnuj Phogat2017-06-094-4/+16
| | | | | | | | CNL MOCS defines are duplicates of SKL MOCS defines. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Handle gen10 in switch cases across the driverAnuj Phogat2017-06-094-1/+11
| | | | | | | | | V2: Start using gen10 functions isl_gen10*(), gen10_blorp_exec() gen10_init_atoms() (Jason) Remove Vulkan changes. Do them later in a separate patch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Update few assertionsAnuj Phogat2017-06-091-1/+1
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Add pci id for INTEL_DEVID_OVERRIDEAnuj Phogat2017-06-091-0/+1
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/cnl: Wire up android Mesa build files for gen10Anuj Phogat2017-06-091-1/+23
| | | | | | | | Signed-off-by: Anuj Phogat <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Mauro Rossi <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* i965/cnl: Wire up Mesa build files for gen10Anuj Phogat2017-06-092-1/+9
| | | | | | | | V2: Remove isl_gen10.c and isl_gen10.h Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965/cnl: Add gen10 specific function declarationsAnuj Phogat2017-06-092-0/+3
| | | | | | | | | These declarations will help the code start compiling once we wire up the makefiles for gen10. Later patches will start using these functions for gen10. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Temporarily disable async mappings on non-LLCMatt Turner2017-06-091-2/+2
| | | | | | | | | | | | | | Fixes regressions from commits e0a9b261e593 and a16355d67d92 by neutering async mappings on non-LLC to be synchronous, like they were before those two commits. :( The failing tests include piglit-test piglit.spec.nv_primitive_restart.primitive-restart-vbo_index_only piglit-test piglit.spec.nv_primitive_restart.primitive-restart-vbo_combined_vertex_and_index piglit-test piglit.spec.nv_primitive_restart.primitive-restart-vbo_separate_vertex_and_index piglit-test piglit.spec.nv_primitive_restart.primitive-restart-vbo_vertex_only piglit-test piglit.spec.arb_pixel_buffer_object.texsubimage-unpack pbo
* mesa/main/debug: Check if we successfully reopened the ppm file.Rafael Antognolli2017-06-091-0/+5
| | | | | | | | | | Since we created the file, we should be able to reopen it for appending, but some weird filesystem error could cause that to be false. So simply check whether we could reopen it or not. CID: 1177144 Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: make use of NewScissorTest driver flagsSamuel Pitoiset2017-06-092-3/+3
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: make use of NewScissorRect driver flagsSamuel Pitoiset2017-06-092-2/+4
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add gl_driver_flags::NewScissor{Rect,Test}Samuel Pitoiset2017-06-091-0/+6
| | | | | | | | | | | | | | | | | _NEW_SCISSOR mesa flag is set when a scissor test is enabled/disabled or when a new rectangle is defined. However, it triggers too much changes in the state tracker. Actually, ST_NEW_RASTERIZER should only be called when a scissor test is enabled/disabled, while ST_NEW_SCISSOR should be called in both situations. In other words, this will avoid to update the rasterizer every time a new rectangle is defined using glScissor*(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add KHR_no_error support to glDrawRangeElements*()Timothy Arceri2017-06-091-3/+10
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: rework _ae_invalidate_state() so that it just sets a dirty flagTimothy Arceri2017-06-093-18/+19
| | | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove redundant _ae_invalidate_state() callTimothy Arceri2017-06-091-3/+0
| | | | | | | | | The FLUSH_VERTICES(ctx, _NEW_ARRAY) above this will already cause this to be called. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: inline vbo_exec_invalidate_state() and call from mesa coreTimothy Arceri2017-06-0916-45/+22
| | | | | | | | Rather than calling it indirectly in each driver. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: rework vbo_exec_init()Timothy Arceri2017-06-093-8/+18
| | | | | | | | | | Here we make some assumptions about the AEcontext and set the recalculate bools directly. Some formating fixes are also made while we are here. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: stop passing state bitfield to UpdateState()Timothy Arceri2017-06-0913-22/+33
| | | | | | | | | | | | | | | | | | The code comment which seems to have been added in cab974cf6c2db (from year 2000) says: "Set ctx->NewState to zero to avoid recursion if Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)" As far as I can tell nothing in any of the UpdateState() calls should cause it to be called recursively. V2: add a wrapper around the osmesa update function so it can still be used internally. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add st_invalidate_buffers() helperTimothy Arceri2017-06-094-16/+26
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* r200/radeon: stop calling _ae_invalidate_state() directlyTimothy Arceri2017-06-092-4/+0
| | | | | | | It is already called via _vbo_InvalidateState(). Reviewed-by: Marek Olšák <[email protected]> Tested-by: Ian Romanick <[email protected]>
* i965: Add format/modifier advertisingVarad Gautam2017-06-081-4/+72
| | | | | | | | | v2: Rebase and reuse tiling/modifier map. (Daniel Stone) v3: bump DRIimageExtension to version 15, fill external_only array. v4: Y-tiling works since gen 6 Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Support dmabuf import with modifiersVarad Gautam2017-06-081-18/+76
| | | | | | | | | | | | Add support for createImageFromDmaBufs2, adding a modifier to the original, and allow importing CCS resources with auxiliary data from dmabufs. v2: avoid DRIimageExtension version bump, pass single modifier to createImageFromDmaBufs2. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Improve same-buffer restriction for importsDaniel Stone2017-06-081-5/+13
| | | | | | | | | | | | | | | | Intel hardware requires that all planes of an image come from the same buffer, which is currently implemented by testing that all FDs are numerically the same. However, when going through a winsys (e.g.) or anything which transits FDs individually, the FDs may be different even if the underlying buffer is the same. Instead of checking the FDs for equality, we must check if they actually point to the same buffer (Jason). Reviewed-by: Varad Gautam <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Allocate tile aligned heightBen Widawsky2017-06-081-5/+26
| | | | | | | | | | | | | | | This patch shouldn't actually do anything because the libdrm function should already do this alignment. However, it preps us for a future patch where we add in the CCS AUX size, and in the process it serves as a good place to find bisectable issues if libdrm or kernel does something incorrectly. v2: Do proper alignment for X tiling, and make sure non-tiled case is handled (Jason) v3: Rebase (Daniel) Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>