summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* radeonsi: add a debug option to compile shaders when they're createdMarek Olšák2015-04-163-0/+6
| | | | Tested-by: Tom Stellard <[email protected]>
* st/mesa: add a debug option to compile shaders at link timeMarek Olšák2015-04-166-4/+55
| | | | | | | v2: fix crashes Tested-by: Tom Stellard <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* i965: Rewrite ir_tex to ir_txl with lod 0 for vertex shadersKristian Høgsberg2015-04-161-0/+9
| | | | | | | | | | | | | | | | The ir_tex opcode turns into a sample or sample_c message, which will try to compute derivatives to determine the lod. This produces garbage for non-fragment shaders where the sample coordinates don't correspond to subspans. We fix this by rewriting the opcode from ir_tex to ir_txl and setting the lod to 0. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89457 Cc: "10.5" <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* radeonsi: remove bogus r600-- tripleEmil Velikov2015-04-161-2/+0
| | | | | | | | | | As mentioned by Michel Dänzer for LLVM >= 3.6 we create the LLVMTargetMachine (with triple amdgcn--), as we setup the radeonsi context. For older LLVM or hardware (r600) the triple is always r600-- and is created at a later stage - radeon_llvm_compile() Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* i965/skl: Add the header for constant loads outside of the generatorNeil Roberts2015-04-166-35/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 5a06ee738 added a step to the generator to set up the message header when generating the VS_OPCODE_PULL_CONSTANT_LOAD_GEN7 instruction. That pseudo opcode is implemented in terms of multiple actual opcodes, one of which writes to one of the source registers in order to set up the message header. This causes problems because the scheduler isn't aware that the source register is written to and it can end up reorganising the instructions incorrectly such that the write to the source register overwrites a needed value from a previous instruction. This problem was presenting itself as a rendering error in the weapon in Enemy Territory: Quake Wars. Since commit 588859e1 there is an additional problem that the double register allocated to include the message header would end up being split into two. This wasn't happening previously because the code to split registers was explicitly avoided for instructions that are sending from the GRF. This patch fixes both problems by splitting the code to set up the message header into a new pseudo opcode so that it will be done outside of the generator. This new opcode has the header register as a destination so the scheduler can recognise that the register is written to. This has the additional benefit that the scheduler can optimise the message header slightly better by moving the mov instructions further away from the send instructions. On Skylake it appears to fix the following three Piglit tests without causing any regressions: gs-float-array-variable-index gs-mat3x4-row-major gs-mat4x3-row-major I think we actually may need to do something similar for the fs backend and possibly for message headers from regular texture sampling but I'm not entirely sure. v2: Make sure the exec-size is retained as 8 for the mov instruction to initialise the header from g0. This was accidentally lost during a rebase on top of 07c571a39fa1. Split the patch into two so that the helper function is a separate change. Fix emitting the MOV instruction on Gen7. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89058 Reviewed-by: Ben Widawsky <[email protected]>
* i965/vec4: Add a helper function to emit VS_OPCODE_PULL_CONSTANT_LOADNeil Roberts2015-04-163-77/+75
| | | | | | | | | | | There were three places in the visitor that had a similar chunk of code to emit the VS_OPCODE_PULL_CONSTANT_LOAD opcode using a register for the offset. This patch combines the chunks into a helper function to reduce the code duplication. It will also be useful in the next patch to expand what happens on Gen9+. This shouldn't introduce any functional changes. Reviewed-by: Ben Widawsky <[email protected]>
* mesa,glsl: rename `interface` to `programInterface`.Jose Fonseca2015-04-163-25/+25
| | | | | | | | | | | | | | | | | `interface` is a define on Windows -- an alias for `struct` keyword, used when declaring COM interfaces in C or C++. So use instead `programInterface`, therefore matching the name used in GL_ARB_program_interface_query spec/headers, which was renamed exactly for the same reason: "Revision 10, May 10, 2012 (pbrown) - Rename the formal parameter <interface> used by the functions in this extension to <programInterface>. Certain versions of the Microsoft C/C++ compiler and/or its headers cause "interface" to be treated as a reserved keyword." Trivial.
* gbm: Add GBM_BO_USE_LINEAR flagFlora Cui2015-04-162-0/+6
| | | | | | | Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* mesa: refactor GetUniformBlockIndexTapani Pälli2015-04-161-6/+6
| | | | | | | Use _mesa_program_resource_index to get index. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetUniformIndicesTapani Pälli2015-04-161-3/+3
| | | | | | | Use _mesa_program_resource_index to get indices. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetUniformLocationTapani Pälli2015-04-161-18/+1
| | | | | | | Use _mesa_program_resource_location to get location. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetActiveUniformBlockNameTapani Pälli2015-04-161-13/+5
| | | | | | | Use _mesa_get_program_resource_name to get name. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: remove unused _mesa_get_uniform_nameTapani Pälli2015-04-162-44/+0
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetActiveUniformNameTapani Pälli2015-04-161-9/+2
| | | | | | | Use _mesa_get_program_resource_name to get name. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetActiveUniformTapani Pälli2015-04-161-17/+16
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetTransformFeedbackVaryingTapani Pälli2015-04-161-7/+12
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetActiveUniformsiv, use _mesa_program_resource_propTapani Pälli2015-04-161-70/+39
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: mesa_bufferiv utility function for buffer objectsTapani Pälli2015-04-162-121/+78
| | | | | | | | | | | | | | | Patch adds new function 'mesa_bufferiv' and refactors existing GetActiveUniformBlockiv and GetActiveAtomicCounterBufferiv to use it. corresponding Piglit tests: arb_uniform_buffer_object* arb_shader_atomic_counters* (Many tests hit the corresponding queries.) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetFragDataIndexTapani Pälli2015-04-161-23/+2
| | | | | | | | Use _mesa_program_resource_location_index to fetch index. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetFragDataLocationTapani Pälli2015-04-161-22/+16
| | | | | | | Use program_resource_location to fetch location. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetAttribLocationTapani Pälli2015-04-161-22/+20
| | | | | | | Use program_resource_location to fetch location. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: refactor GetActiveAttribTapani Pälli2015-04-161-31/+27
| | | | | | | | Instead of iterating IR, retrieve required information through the new program resource functions. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: enable GL_ARB_program_interface_query extensionTapani Pälli2015-04-163-2/+4
| | | | | | | (and mark it as DONE in docs/GL3.txt + 10.6.0 relnotes) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: implementation of glGetProgramResourceivTapani Pälli2015-04-163-0/+300
| | | | | | | | | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. The property query functionality can be tested with tests for following functions that are refactored by later patches: GetActiveAtomicCounterBufferiv GetActiveUniformBlockiv GetActiveUniformsiv v2: code cleanup (Ilia Mirkin) add bufSize < 0 check and error out fix is_resource_referenced to return bool check for propCount and bufSize, fixes in buffer_prop Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: glGetProgramResourceLocationIndexTapani Pälli2015-04-163-1/+46
| | | | | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. The added functionality can be tested by tests for following functions that are refactored by later patches: GetFragDataIndex v2: return -1 if output not referenced by fragment stage (Ilia Mirkin) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: glGetProgramResourceLocationTapani Pälli2015-04-163-1/+151
| | | | | | | | | | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. corresponding Piglit test: arb_program_interface_query-resource-location The added functionality can be tested by tests for following functions that are refactored by later patches: GetAttribLocation GetUniformLocation GetFragDataLocation v2: code cleanup, changes to array element syntax checking (Ilia Mirkin) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: glGetProgramResourceNameTapani Pälli2015-04-163-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. Name generation copied from '_mesa_get_uniform_name' which can be removed later by refactoring functions to use resource list. The added functionality can be tested by tests for following functions that are refactored by later patches: GetActiveUniformName GetActiveUniformBlockName v2: no index for geometry shader inputs (Ilia Mirkin) add bufSize < 0 check and error out validate enum corresponding Piglit test: arb_program_interface_query-getprogramresourcename Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: glGetProgramResourceIndexTapani Pälli2015-04-163-1/+183
| | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. v2: code cleanup (Ilia Mirkin) corresponding Piglit test: arb_program_interface_query-getprogramresourceindex Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: glGetProgramInterfaceivTapani Pälli2015-04-163-0/+185
| | | | | | | | | | | | | | | | | | Patch adds required helper functions to shaderapi.h and the actual implementation. v2: code cleanup (Ilia Mirkin) fix array size fo xfb varyings validate programInterface and throw error v3: put GL_MAX_NUM_COMPATIBLE_SUBROUTINES where it belongs corresponding Piglit test: arb_program_interface_query-getprograminterfaceiv Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa/glsl: build list of program resources during linkingTapani Pälli2015-04-163-0/+212
| | | | | | | | | | | | | | | | Patch adds ProgramResourceList to gl_shader_program structure. List contains references to active program resources and is constructed during linking phase. This list will be used by follow-up patches to implement hooks for GL_ARB_program_interface_query. It can be also used to implement any of the older shader program query APIs. v2: code cleanups + note for SSBO and subroutines (Ilia Mirkin) v3: code cleanups + assert(MESA_SHADER_STAGES < 8) (Martin Peres) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* glapi: add GL_ARB_program_interface_query skeletonTapani Pälli2015-04-167-7/+247
| | | | | | | | | | | v2: update dispatch_sanity test (Jason Ekstrand) + small code cleanups v3: xml and Makefile fixes (Ilia Mirkin, Matt Turner) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* linker: fix varying linking if SSO program has only gs and fsTapani Pälli2015-04-161-12/+17
| | | | | | | | | | | | | | | | Previously linker did not take in to account case where one would have only gs and fs (with SSO), patch adds the case by refactoring code around assign_varying_locations. This makes sure locations for gs get populated correctly. This was found with some of the SSO subtests of Martin's upcoming GetProgramInterfaceiv Piglit test which passes with the patch, no Piglit regressions. v2: code cleanups (Martin Peres) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* r600g/sb: Skip empty ALU clause while schedulingGlenn Kennard2015-04-161-0/+3
| | | | | | | | | Fixes assert triggered by ext_transform_feedback-intervening-read output use_gs piglit test. Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nir: Try commutative sources in CSEIan Romanick2015-04-151-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shader-db results: GM45 NIR: total instructions in shared programs: 4082044 -> 4081919 (-0.00%) instructions in affected programs: 27609 -> 27484 (-0.45%) helped: 44 Iron Lake NIR: total instructions in shared programs: 5678776 -> 5678646 (-0.00%) instructions in affected programs: 27406 -> 27276 (-0.47%) helped: 45 Sandy Bridge NIR: total instructions in shared programs: 7329995 -> 7329096 (-0.01%) instructions in affected programs: 142035 -> 141136 (-0.63%) helped: 406 HURT: 19 Ivy Bridge NIR: total instructions in shared programs: 6769314 -> 6768359 (-0.01%) instructions in affected programs: 140820 -> 139865 (-0.68%) helped: 423 HURT: 2 Haswell NIR: total instructions in shared programs: 6183693 -> 6183298 (-0.01%) instructions in affected programs: 96538 -> 96143 (-0.41%) helped: 303 HURT: 4 Broadwell NIR: total instructions in shared programs: 7501711 -> 7498170 (-0.05%) instructions in affected programs: 266403 -> 262862 (-1.33%) helped: 705 HURT: 5 GAINED: 4 v2: Rebase on top of Connor's fix. v3: Convert the if-test for num_inputs == 2 to an assertion. Suggested by Jason after some comments / questions by Ilia. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> [v1] Reviewed-by: Jason Ekstrand <[email protected]> Cc: Connor Abbott <[email protected]>
* glx: Create proper server dependency for GLX_EXT_create_context_es2_profileIan Romanick2015-04-151-11/+1
| | | | | | | | | | | | | | | | | | | | Previously GLX_EXT_create_context_es2_profile was marked as "direct only" so that it would not depend on server support. Since the extension required functions that are part of GLX_ARB_create_context_profile, support for the EXT was disabled if the ARB was not supported. This was complete rubbish. If the server supported the ARB but not the EXT, sending a request with GLX_CONTEXT_ES2_PROFILE_BIT_EXT would result in GLXBadProfileARB. Instead of the misguided hack, make GLX_EXT_create_context_es2_profile properly depend on server support by not marking it as "direct only." Signed-off-by: Ian Romanick <[email protected]> Acked-by: José Fonseca <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: Emil Velikov <[email protected]>
* vc4: Don't try to use color load/stores to blit across format changes.Eric Anholt2015-04-151-0/+3
| | | | | | We could potentially support the right combination of 8888 to 565, but the important thing for now is to not mix up our orderings of 8888. Fixes fbo-copyteximage regressions.
* vc4: Don't try to use color load/stores to do depth/stencil blits.Eric Anholt2015-04-151-0/+3
| | | | | Fixes regressions in fbo-generatemipmap-formats on depth/stencil (which does blits to work around baselevel/lastlevel).
* vc4: Update the shadow texture for public textures on every draw.Eric Anholt2015-04-153-7/+20
| | | | | We don't know who else has written to it, so we'd better update it every time. This makes the gears spin in X again.
* vc4: Hook up VC4_DEBUG=perf to some useful printfs.Eric Anholt2015-04-153-1/+16
|
* st/mesa: log shaders, GLSL info log with _mesa_log()Brian Paul2015-04-151-6/+4
| | | | | | As with previous patch. Reviewed-by: José Fonseca <[email protected]>
* mesa: log shaders, GLSL info log with _mesa_log()Brian Paul2015-04-151-14/+11
| | | | | | | Now, if we set MESA_LOG_FILE and MESA_GLSL=dump, all the shader info will get logged to the named file instead of stderr. Reviewed-by: José Fonseca <[email protected]>
* mesa: add _mesa_log(), _mesa_get_log_file() functionsBrian Paul2015-04-152-7/+43
| | | | | | | | | | _mesa_log() simply writes log information to stderr or MESA_LOG_FILE. _mesa_get_log_file() returns the file handle to use for logging. This will be used for shader dumping/logging instead of always printing to stderr. Reviewed-by: José Fonseca <[email protected]>
* tgsi: also dump label for TGSI_OPCODE_BGNSUB opcodeBrian Paul2015-04-151-0/+1
| | | | | | So we can see the label associated with subroutines. Reviewed-by: José Fonseca <[email protected]>
* st/wgl: Couple of fixes to opengl32.dll's wglCreateContext/wglDeleteContext ↵Jose Fonseca2015-04-153-9/+66
| | | | | | | | | | | | | | | dispatch. - Use GetModuleHandle instead of LoadLibrary to avoid incrementing the opengl32.dll reference count (otherwise the opengl32.dll will linger in memory forever.) - Ensure we use our fake wglCreateContext/wglDeleteContext when using Mesa as a drop-in replacement for opengl32.dll Untested. Just noticed by accident. Reviewed-by: Brian Paul <[email protected]>
* mesa: Enable _mesa_dlopen on MSVC too.Jose Fonseca2015-04-151-3/+3
| | | | | | As pointed out by Shervin Sharifi. Reviewed-by: Brian Paul <[email protected]>
* glsl: fix assignment of multiple scalar and vecs to matrices.Samuel Iglesias Gonsalvez2015-04-151-61/+49
| | | | | | | | | | | | | | | | | When a vec has more elements than row components in a matrix, the code could end up failing an assert inside assign_to_matrix_column(). This patch makes sure that when there is still room in the matrix for more elements (but in other columns of the matrix), the data is actually assigned. This patch fixes the following dEQP test: dEQP-GLES3.functional.shaders.conversions.matrix_combine.float_bvec4_ivec2_bool_to_mat4x2_vertex dEQP-GLES3.functional.shaders.conversions.matrix_combine.float_bvec4_ivec2_bool_to_mat4x2_fragment Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* nir: Fix typo in "ushr by 0" algebraic replacementIan Romanick2015-04-141-1/+1
| | | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Cc: "10.5" <[email protected]>
* nir: Silence unused parameter warningsIan Romanick2015-04-142-1/+3
| | | | | | | | | | | | | | | | | | | nir/nir.h: In function 'nir_validate_shader': nir/nir.h:1567:56: warning: unused parameter 'shader' [-Wunused-parameter] static inline void nir_validate_shader(nir_shader *shader) { } ^ nir/nir_opt_cse.c: In function 'src_is_ssa': nir/nir_opt_cse.c:165:32: warning: unused parameter 'data' [-Wunused-parameter] src_is_ssa(nir_src *src, void *data) ^ nir/nir_opt_cse.c: In function 'dest_is_ssa': nir/nir_opt_cse.c:171:35: warning: unused parameter 'data' [-Wunused-parameter] dest_is_ssa(nir_dest *dest, void *data) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* nir/cse: fix bug with comparing non-per-component sourcesConnor Abbott2015-04-141-10/+7
| | | | | | | | | | | | We weren't comparing the right number of components when checking swizzles. Use nir_ssa_alu_instr_num_src_components() to do the right thing. No piglit regressions, and no fixes either. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Connor Abbott <[email protected]>
* i965/fs: Combine tex/fb_write operations (opt)Ben Widawsky2015-04-143-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain platforms support the ability to sample from a texture, and write it out to the file RT - thus saving a costly send instructions (note that this is a potnential win if one wanted to backport to a tag that didn't have the patch from Topi which removed excess MOVs from LOAD_PAYLOAD - 97caf5fa04dbd2), v2: Modify the algorithm. Instead of iterating in reverse through blocks and insts, since the last block/inst is the only thing which can benefit. Rebased on top of Ken's patching modifying is_last_send v3: Rebased over almost 2 months, and Incorporated feedback from Matt: Some comment typo fixes and rewordings. Whitespace Move the optimization pass outside of the optimize loop v4: Some cosmetic changes requested from Ken. These changes ensured that the optimization function always returned true when an optimization occurred, and false when one did not. This behavior did not exist with the original patch. As a result, having the separate helper function which Matt did not like no longer made sense, and so now I believe everyone should be happy. Benchmark (n=20) %diff *OglBatch5 -1.4 *OglBatch7 -1.79 OglFillTexMulti 5.57 OglFillTexSingle 1.16 OglShMapPcf 0.05 OglTexFilterAniso 3.01 OglTexFilterTri 1.94 No piglit regressions: (http://otc-gfxtest-01.jf.intel.com:8080/view/dev/job/bwidawsk/112/) [*] I believe my measurements are incorrect for Batch5-7. If I add this new optimization, but never emit the new instruction I see similar results. v5: Remove declaration of combine_tex_header since v4 dropped that function (Ben) Remove check for impossible case of an empty block (Matt) Set dest earlier to avoid extra special-casing in generate_tex (Matt) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>