summaryrefslogtreecommitdiffstats
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: add ir_variable::contains_bindless()Samuel Pitoiset2017-06-141-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: set the explicit binding value for bindless samplers/imagesSamuel Pitoiset2017-06-141-6/+29
| | | | | | | | | This handles a situation like: layout (bindless_sampler, binding = 7) uniform sampler2D; Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: pass the ir_variable object to set_opaque_binding()Samuel Pitoiset2017-06-141-3/+4
| | | | | | | | In order to set the explicit binding value for bindless samplers/images. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: process uniform images declared bindlessSamuel Pitoiset2017-06-143-9/+89
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: process uniform samplers declared bindlessSamuel Pitoiset2017-06-143-11/+99
| | | | | 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-146-0/+92
| | | | | | | | | | | | | | 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-146-3/+55
| | | | | | | | 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/util: add a hash table wrapper which support 64-bit keysSamuel Pitoiset2017-06-142-0/+172
| | | | | | | | | Needed for bindless handles which are represented using 64-bit unsigned integers. All hash table implementations should be uniformized later on. 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]>
* mesa/util: add new util_dynarray_delete_unordered helperSamuel Pitoiset2017-06-141-0/+14
| | | | | | | | This helper function will be used for managing dynamic arrays of resident texture/image handles. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mapi: add GL_ARB_bindless_texture entry pointsSamuel Pitoiset2017-06-1419-1/+363
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* clover/device: Get device/host unified memory from pipe driverAaron Watry2017-06-133-1/+7
| | | | | | | clinfo no longer reports my discrete GCN card as unified memory Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* gallium/radeon: Include the family name in the renderer string if it's not ↵Henri Verbeet2017-06-131-14/+18
| | | | | | | | | | | equal to the marketing name. The "family" name is often more informative than the "marketing" name. More importantly, applications, like for example Wine, may recognise GPUs based on the existing "family" names. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Henri Verbeet <[email protected]>
* gallium/docs: clarify TGSI_SEMANTIC_SAMPLEMASK, againBrian Paul2017-06-131-4/+11
| | | | | | | | | I've since discovered the fragment shader sample mask system value (which corresponds to gl_SampleMaskIn). v2: It's a system value, not a shader input. 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]>
* gallium/util: whitespace, formatting fixes in u_upload_mgr.cBrian Paul2017-06-131-25/+29
| | | | Reviewed-by: Marek Olšák <[email protected]>
* egl: improve dri2_fallback_swap_buffers_with_damage()Eric Engestrom2017-06-131-0/+1
| | | | | | | Let's (try to) set damages before swapping buffers. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* softpipe: Match pipe_context::render_condition prototype.Jose Fonseca2017-06-132-5/+5
| | | | To silence compiler warnings. Trivial.
* llvmpipe: Match pipe_context::render_condition prototype.Jose Fonseca2017-06-132-5/+5
| | | | To silence compiler warnings. Trivial.
* 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]>
* glsl: simplify an assertion in lower_ubo_referenceNicolai Hähnle2017-06-131-1/+1
| | | | | | Struct types are now equal when they're structurally equal. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: simplify validate_intrastage_arraysNicolai Hähnle2017-06-131-8/+0
| | | | | | Struct types are now equal when they are structurally equal. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: simplify varying matchingNicolai Hähnle2017-06-131-32/+9
| | | | | | Unnamed struct types are now equal if they have the same field. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: remove redundant record_compare check when linking globalsNicolai Hähnle2017-06-131-22/+17
| | | | | | | | | | | | | Unnamed struct types are now equal across stages based on the fields they contain, so overriding the type to make sure names match has become unnecessary. The check was originally introduced in commit 955c93dc089f ("glsl: Match unnamed record types across stages.") v2: clarify the commit message Reviewed-by: Timothy Arceri <[email protected]>
* glsl: stop considering unnamed and named structures equalNicolai Hähnle2017-06-131-6/+2
| | | | | | | | | | | | Previously, if an unnamed and a named struct contained the same fields, they were considered the same type during linking of globals. The discussion around commit e018ea81bf58 ("glsl: Structures must have same name to be considered same type.") doesn't seem to have considered this thoroughly, and I see no evidence that an unnamed struct should ever be considered to be the same type as a named struct. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: give all unnamed structs the same nameNicolai Hähnle2017-06-131-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a result, unnamed structs defined in different places of the program are considered the same types if they have the same fields in the same order. This will simplify matching of global variables whose type is an unnamed struct. It also fixes a memory leak when the same shader containing unnamed structs is compiled over and over again: instead of creating a new type each time, the existing type is re-used. Finally, this does have the effect that some previously rejected programs are now accepted, such as: struct { float a; } s1; struct { float a; } s2; s2 = s1; C/C++ do not allow that, but GLSL does seem to want to treat unnamed structs with the same fields as the same type at least during linking (and apparently, some applications require it), so it seems odd to treat them as different types elsewhere. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: do not add unnamed struct types to the symbol tableNicolai Hähnle2017-06-131-1/+1
| | | | | | | We removed the need for lookups, and we will assign them all the same name in the future. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: do not lookup struct types by typenameNicolai Hähnle2017-06-133-6/+10
| | | | | | | | | | | | | | | | | | | | | This changes the logic during the conversion of the declaration list struct S { ... } v; from AST to IR, but should not change the end result. When assigning the type of v, instead of looking `S' up in the symbol table, we read the type from the member variable of ast_struct_specifier. This change is necessary for the subsequent change to how anonymous types are handled. v2: remove a type override when redefining a structure; should be the same type in that case anyway Reviewed-by: Timothy Arceri <[email protected]>
* glsl: fix a race condition when inserting new typesNicolai Hähnle2017-06-132-40/+32
| | | | | | | | | | | | By splitting glsl_type::mutex into two, we can avoid dropping the hash mutex while creating the new type instance (e.g. struct/record, interface). This fixes a time-of-check/time-of-use race where two threads would simultaneously attempt to create the same type but end up with different instances of glsl_type. Reviewed-by: Timothy Arceri <[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]>
* ac/gpu: drop duplicated code line.Dave Airlie2017-06-131-1/+0
| | | | | | | | | has_hw_decode is assigned twice. Pointed out by coverity. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move assert down in radv_bind_descriptor_setDave Airlie2017-06-131-2/+2
| | | | | | | coverity complains about the deref before NULL check. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: return correct error on invalid handle from vkAllocateMemoryDave Airlie2017-06-131-2/+3
| | | | | | | Coverity pointed out this was returning uninitialised. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[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]>
* u_dynarray: fix coverity warning about ignoring return value from rerallocDave Airlie2017-06-131-1/+1
| | | | | | | | >>> Ignoring storage allocated by "reralloc_size(buf->mem_ctx, buf->data, buf->size)" leaks it. Reviewed-by: Thomas Helland<[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl/lower_distance: only set max_array_access for 1D clip dist arraysDave Airlie2017-06-121-1/+1
| | | | | | | | | | | | | | The max_array_access field applies to the first dimension, which means we only want to set it for the 1D clip dist arrays. This fixes an ir_validate assert seen with KHR-GL44.cull_distance.functional on nouveau and radeon with debug builds. Fixes: a08c4ebbe (glsl: rewrite clip/cull distance lowering pass) Reviewed-by: Timothy Arceri <[email protected]> Tested-by: Tobias Klausmann <[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]>
* radeonsi: pack si_context betterMarek Olšák2017-06-121-18/+18
| | | | | | there isn't much to gain here Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: pack si_framebuffer betterMarek Olšák2017-06-123-8/+8
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: pack si_sampler_view betterMarek Olšák2017-06-121-2/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: pack si_buffer_resources betterMarek Olšák2017-06-121-4/+5
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>