summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-07-15osmesa: fix OSMesaPixelsStore typoHEADmasterBrian Paul2-2/+2
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91337 Cc: 10.6 <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-14vc4: Cache the texture p1 for the sampler.Eric Anholt3-49/+69
Cuts another 12% of vc4_uniforms.o, in exchange for computing it at CSO creation time.
2015-07-14vc4: Cache texture p0/p1 setup for the sampler view.Eric Anholt3-28/+43
In exchange for a bit of space and computation in CSO setup, we cut vc4_uniform.c (draw time) code size by 4.8%.
2015-07-14vc4: Move uniforms handling to a separate file.Eric Anholt3-314/+341
The rest of vc4_program.c is about compiling, while this is about uniform emit at draw time.
2015-07-14vc4: Fix some -Wdouble-promotion warnings.Eric Anholt3-6/+6
No code generation changes from this, but it'll be useful to have this next time I go checking -Wdouble-promotion.
2015-07-14i965/cs: Initialize GPGPU Thread CountJordan Justen2-0/+25
This field should always be set for gen8. In the bdw PRM, Volume 2d: Command Reference: Structures under INTERFACE_DESCRIPTOR_DATA, DWORD 6, Bits 9:0, Number of Threads in GPGPU Thread Group: "This field should not be set to 0 even if the barrier is disabled, since an accurate value is needed for proper pre-emption." In the HSW PRM, the it doesn't mention that it must always be set, but it should not hurt. Reported-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-07-14vc4: Fix compiler warnings on release builds.Eric Anholt4-7/+14
2015-07-14vc4: Add better debug for register allocation failure.Eric Anholt1-1/+5
2015-07-14vc4: Drop reloc_count tracking for debug asserts on non-debug builds.Eric Anholt1-0/+10
Cuts another 88 bytes of compiled code.
2015-07-14vc4: Rework cl handling to be friendlier to the compiler.Eric Anholt6-152/+203
Drops 680 bytes of code, from avoiding a bunch of extra updates to the next pointer in the struct.
2015-07-14vc4: Make a helper function for getting the current offset in the CL.Eric Anholt4-20/+21
I needed to rewrite this a bit for safety checking in the next commit. Despite being a static inline of the same thing that was being done, we lose 36 bytes of code for some reason.
2015-07-14vc4: Drop separate cl*_reloc_hindex().Eric Anholt1-18/+6
Now that RCL generation is in the kernel, we don't have any other callers. Oddly, the compiler generates another 8 bytes of code for this, but the simplification is worth it.
2015-07-14vc4: Store reloc pointers as pointers, not offsets.Eric Anholt1-5/+5
Now that we don't resize the CL as we build (it's set up at the top by vc4_start_draw()), we can store the pointers instead of offsets from the base. Saves a bit of math in emitting relocs (about 60 bytes of code).
2015-07-14vc4: Add perf debug for when we wait on BOs.Eric Anholt4-43/+72
2015-07-14i965: Mark constant static data as const.Matt Turner2-23/+23
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2015-07-14glsl: Lower shader storage buffer object loads to GLSL IR instrinsicsSamuel Iglesias Gonsalvez1-8/+65
Extend the existing lower_ubo_reference pass to also detect SSBO loads and lower them to __intrinsic_load_ssbo intrinsics. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Lower shader storage buffer object writes to GLSL IR instrinsicsSamuel Iglesias Gonsalvez1-130/+311
Extend the existing lower_ubo_reference pass to also detect SSBO writes and lower them to __intrinsic_store_ssbo intrinsics. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Don't do copy propagation on buffer variablesIago Toral Quiroga1-1/+1
Since the backing storage for these is shared we cannot ensure that the value won't change by writes from other threads. Normally SSBO accesses are not guaranteed to be syncronized with other threads, except when memoryBarrier is used. So, we might be able to optimize some SSBO accesses, but for now we always take the safe path and emit the SSBO access. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Don't do constant variable on buffer variablesIago Toral Quiroga1-0/+7
Since the backing storage for these is shared we cannot ensure that the value won't change by writes from other threads. Normally SSBO accesses are not guaranteed to be syncronized with other threads, except when memoryBarrier is used. So, we might be able to optimize some SSBO accesses, but for now we always take the safe path and emit the SSBO access. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Don't do constant propagation on buffer variablesIago Toral Quiroga1-0/+8
Since the backing storage for these is shared we cannot ensure that the value won't change by writes from other threads. Normally SSBO accesses are not guaranteed to be syncronized with other threads, except when memoryBarrier is used. So, we might be able to optimize some SSBO accesses, but for now we always take the safe path and emit the SSBO access. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Do not kill dead assignments to buffer variables or SSBO declarations.Iago Toral Quiroga1-3/+6
If we kill dead assignments we lose the buffer writes. Also, we never kill UBO declarations even if they are never referenced by the shader, they are always considered active. Although the spec does not seem say this specifically for SSBOs, it is probably implied since SSBOs are pretty much the same as UBOs, only that you can write to them. v2: - Fix the comment (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Don't do tree grafting on buffer variablesIago Toral Quiroga1-4/+5
Otherwise we can lose writes into the buffers backing the variables. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Implement _mesa_BindBufferRange for target GL_SHADER_STORAGE_BUFFERIago Toral Quiroga1-0/+37
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Implement _mesa_BindBufferBase for target GL_SHADER_STORAGE_BUFFERIago Toral Quiroga1-0/+56
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Implement _mesa_BindBuffersRange for target GL_SHADER_STORAGE_BUFFERIago Toral Quiroga1-0/+110
v2: - Fix error message (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Implement _mesa_BindBuffersBase for target GL_SHADER_STORAGE_BUFFERIago Toral Quiroga2-0/+149
v2: - Add space before const (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Implement _mesa_DeleteBuffers for target GL_SHADER_STORAGE_BUFFERIago Toral Quiroga1-0/+11
v2: - Remove the extra spaces (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Initialize and free shader storage buffersIago Toral Quiroga1-0/+19
v2: - Fix indention, used tabs instead of whitespaces. (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: fix error messages in invalid declarations of shader storage blocksSamuel Iglesias Gonsalvez1-7/+8
Due to GL_ARB_shader_storage_buffer_object extension, shader storage blocks have the same limitations as uniform blocks. This patch fixes the corresponding error messages. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: buffer variables cannot be defined outside interface blocksSamuel Iglesias Gonsalvez1-0/+12
Section 4.3.7 "Buffer Variables", GLSL 4.30 spec: "Buffer variables may only be declared inside interface blocks (section 4.3.9 “Interface Blocks”), which are then referred to as shader storage blocks. It is a compile-time error to declare buffer variables at global scope (outside a block)." Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: shader buffer variables cannot have initializersSamuel Iglesias Gonsalvez1-0/+9
Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec: "Buffer variables cannot have initializers." v2: - Rewrite error message (Jordan) Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: enable binding layout qualifier usage for shader storage buffer objectsSamuel Iglesias Gonsalvez2-6/+26
See GLSL 4.30 spec, section 4.4.5 "Uniform and Shader Storage Block Layout Qualifiers". v2: - Add whitespace in an error message. Delete period '.' at the end of that error message (Jordan). Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: add MaxShaderStorageBlocks to struct gl_program_constantsSamuel Iglesias Gonsalvez2-0/+5
v2: - Set MaxShaderStorageBlocks to 8. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: Add shader storage buffer support to struct gl_contextIago Toral Quiroga4-0/+51
This includes the array of bindings, the current buffer bound to the GL_SHADER_STORAGE_BUFFER target and a set of general limits and default values for shader storage buffers. v2: - Use spec values for the new defined constants (Jordan) Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Identify active uniform blocks that are buffer blocks as such.Iago Toral Quiroga4-0/+11
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: link buffer variables and shader storage buffer interface blocksKristian Høgsberg4-9/+21
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Implement parser support for 'buffer' qualifierKristian Høgsberg6-9/+42
This is used to identify shader storage buffer interface blocks where buffer variables are declared. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14nir: add nir_var_shader_storageIago Toral Quiroga6-8/+20
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: rename is_in_uniform_block to is_in_buffer_blockIago Toral Quiroga10-16/+17
Since this now checks if a variable is inside a uniform or a shader storage block. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: Add ir_var_shader_storageKristian Høgsberg11-13/+34
This will be used to identify buffer variables inside shader storage buffer objects, which are very similar to uniforms except for a few differences, most important of which is that they are writable. Since buffer variables are so similar to uniforms, we will almost always want them to go through the same paths as uniforms. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14mesa: define ARB_shader_storage_buffer_object extensionSamuel Iglesias Gonsalvez5-31/+44
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-07-14glsl: free interface_typesTimothy Arceri1-0/+5
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-07-14glsl: replace some more old hash_table usesTimothy Arceri2-41/+41
The util/hash_table was intended to be a fast hash table replacement for the program/hash_table see 35fd61bd99c1 and 72e55bb6888ff. This change replaces some more uses of the old hash table. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-07-13auxiliary/vl: use the correct screen indexEmil Velikov1-4/+13
Inspired (copied) from Marek's commit for egl/x11 commit 0b56e23e7f3(egl/dri2: use the correct screen index) v2: Fix copy/pasta errors. Cc: 10.6 <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-13radeon: remove dri_mirror stateEmil Velikov4-31/+15
Most of the data stored(duplicated) was unused, and for the one that is follow the approach set by other drivers. This eliminates the use of legacy (dri1) types. Cc: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-13i915: remove unused driFd variableEmil Velikov2-3/+0
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-07-13i965: bump libdrm requirement to 2.4.61 and drop in-tree workaroundEmil Velikov1-5/+0
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2015-07-13radeonsi: directly include radeon/* headersEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-13auxiliary/vl: use loader_open_device() over open()Emil Velikov2-1/+4
The former handles O_CLOEXEC (and the lack of it) appropriately. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-07-13pipe-loader: use loader_open_device() rather than open()Emil Velikov1-1/+1
The former handles O_CLOEXEC (and the lack of it) appropriately. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>