summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* glsl: don't lose uniform values when falling back to full compileTimothy Arceri2017-02-171-2/+2
| | | | | | | | | Here we skip the recreation of uniform storage if we are relinking after a cache miss. This is improtant because uniform values may have already been set by the application and we don't want to reset them. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: don't reference shader prog data during cache fallbackTimothy Arceri2017-02-171-1/+2
| | | | | | We already have a reference. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: add cache_fallback flag to gl_shader_program_dataTimothy Arceri2017-02-171-0/+2
| | | | | | | | | | | This will allow us to skip certain things when falling back to a full recompile on a cache miss such as avoiding reinitialising uniforms. In this change we use it to avoid reading the program metadata from the cache and skipping linking during a fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: use correct shader source in case of cache fallbackTimothy Arceri2017-02-173-3/+15
| | | | | | | | | | | | | | | | | The scenario is: glShaderSource glCompileShader <-- deferred due to cache hit of shader glShaderSource <-- with new source code glAttachShader glLinkProgram <-- no cache hit for program At this point we need to compile the original source when we fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: retain gl_shader_programs after glDeleteProgram if they are in useTimothy Arceri2017-02-164-8/+16
| | | | | | | | | | | | | | Fixes regressions from c505d6d852220f4aaaee161465dd2c579647e672. Switching from using gl_shader_program to gl_program for the pipline objects CurrentProgram array meant we were freeing gl_shader_programs immediately after glDeleteProgram was called, but the spec states the program should only get deleted once it is no longer in use. To work around this we add a new ReferencedPrograms array to track gl_shader_programs in use. Reviewed-by: Kenneth Graunke <[email protected]>
* getteximage: Return correct error value when texure object is not foundEduardo Lima Mitev2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | | | | glGetTextureSubImage() and glGetCompressedTextureSubImage() are currently returning INVALID_OPERATION error when the passed texture argument does not correspond to an existing texture object. However, the error should be INVALID_VALUE instead. From OpenGL 4.5 spec PDF, section '8.11. Texture Queries', page 236: "An INVALID_VALUE error is generated if texture is not the name of an existing texture object." Same wording applies to the compressed version. The INVALID_OPERATION error is coming from the call to _mesa_lookup_texture_err(). This patch uses _mesa_lookup_texture() instead and emits the correct error in the caller. Fixes: GL45-CTS.get_texture_sub_image.errors_test Reviewed-by: Nicolai Hähnle <[email protected]>
* driconf: add allow_higher_compat_version optionSamuel Pitoiset2017-02-152-2/+11
| | | | | | | | | | | | | | | | | | | Mesa currently doesn't allow to create 3.1+ compatibility profiles mainly because various features are unimplemented and bugs can happen. However, some buggy apps request a compat profile without using any old features unimplemented in mesa, and they fail to start. This option should help some games to run but it's not enough for all (eg. Dying Light). v2: - s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Add EXT_frag_depth bits and enable it on all driversAnuj Phogat2017-02-131-0/+1
| | | | | | | | | Passes the newly added piglit test for this extension on i965. V2: Fix comments by Ilia. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Ignore per-vertex array size in SSO pipeline validation.Kenneth Graunke2017-02-121-42/+56
| | | | | | | | | | | | We were already unwrapping types when the producer was a non-array stage and the consumer was an arrayed-stage...but we ought to unwrap both ends for TCS -> TES matching too. This will allow us to drop the "resize to gl_MaxPatchVertices" check shortly, which breaks some things. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: Do a draw time check for TES && !TCS in ES 3.x.Kenneth Graunke2017-02-121-0/+14
| | | | | | | | | | | | | ES 3.x requires both TCS and TES to be present. We already checked the TCS && !TES case above, so we just have to check !TCS && TES here. Note that this is allowed in OpenGL, just not ES. This fixes a subcase of: dEQP-GLES31.functional.debug.negative_coverage.*.tessellation.single_tessellation_stage Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: Do (TCS && !TES) draw time validation in ES as well.Kenneth Graunke2017-02-121-19/+26
| | | | | | | | | | | | | | | | | Now that we have OES_tessellation_shader, the same situation can occur in ES too, not just GL core profile. Having a TCS but no TES may confuse drivers - i965 crashes, for example. This prevents regressions in ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage with some SSO pipeline validation changes I'm making. v2: Add an ES spec citation (suggested by Alejandro) Cc: "17.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl: add param to force shader recompileTimothy Arceri2017-02-091-1/+1
| | | | | | This will be used to skip checking the cache and force a recompile. Reviewed-by: Anuj Phogat <[email protected]>
* st/mesa/i965: create link status enumTimothy Arceri2017-02-094-8/+19
| | | | | | | | | | | | For the on-disk shader cache we want to be able to differentiate between a program that was linked and one that was loaded from cache. V2: - don't return the new enum directly to the application when queried, instead return GL_TRUE or GL_FALSE as required. Fixes google-chrome corruptions when using cache. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: (trivial) include <inttypes.h> for PRIx64 macrosRoland Scheidegger2017-02-081-0/+1
| | | | Fixes a compile error with mingw.
* mesa: use PRId64/PRIu64 when printing 64-bit intsTimothy Arceri2017-02-081-2/+2
| | | | | | V2: actually use PRIu64 Reviewed-by: Dave Airlie <[email protected]>
* mesa/uniform: fix strict aliasing issues with int64 code.Dave Airlie2017-02-081-12/+26
| | | | | | | This fixes these like the double version does. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* main/fboject: default_framebuffer allowed for GetFramebufferParameterAlejandro Piñeiro2017-02-061-7/+37
| | | | | | | | | | | | | | | | | | | | Before 4.5, the default framebuffer was not allowed for GetFramebufferParameter, so it should return INVALID_OPERATION for any call using the default framebuffer. 4.5 included new pnames, and some of them are allowed for the default framebuffer. For the rest, INVALID_OPERATION. From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries: "An INVALID_OPERATION error is generated by GetFramebufferParameteriv if the default framebuffer is bound to target and pname is not one of the accepted values from table 23.73, other than SAMPLE_POSITION." Fixes: GL45-CTS.direct_state_access.framebuffers_get_parameter_errors Reviewed-by: Anuj Phogat <[email protected]>
* main/fbobject: implement new 4.5 pnames for GetFramebufferParameterAlejandro Piñeiro2017-02-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | 4.5 added new pnames allowed for GetFramebufferParameter, and GetNamedFramebufferParameter. From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries" (quoting the paragraph with only the new pnames, not all the supported): "pname may also be one of DOUBLEBUFFER, IMPLEMENTATION_COLOR_READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE, SAMPLES, SAMPLE_BUFFERS, or STEREO, indicating the corresponding framebuffer-dependent state from table 23.73. Values of framebuffer-dependent state are identical to those that would be obtained were the framebuffer object bound and queried using the simple state queries in that table. These values may be queried from either a framebuffer object or a default framebuffer." Fixes: GL45-CTS.direct_state_access.framebuffers_get_parameters Reviewed-by: Anuj Phogat <[email protected]>
* main/framebuffer: refactor _mesa_get_color_read_format/typeAlejandro Piñeiro2017-02-064-22/+71
| | | | | | | | | | | | | | | | | | Current implementation returns the value for the currently bound read framebuffer. GetNamedFramebufferParameteriv allows to get it for any given framebuffer. GetFramebufferParameteriv would be also interested on that method It was refactored by allowing to pass a given framebuffer. If NULL is passed, it used the currently bound framebuffer. It also adds a call to _mesa_update_state. When used only by GetIntegerv, this one was called as part of the extra checks defined at get_hash. But now that the method is used by more methods, and the update is needed, it makes sense (and it is safer) just calling it on the method itself, instead of rely on the caller. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: whitespace fixes in context.cBrian Paul2017-02-031-31/+31
| | | | Remove trailing whitespace, replace tabs with spaces. Trivial.
* mesa: Don't crash when destroying contexts created with no visual.Kenneth Graunke2017-02-031-1/+1
| | | | | | | | | | | | | | | dEQP-EGL.functional.create_context.no_config tries to create a context with no config, then immediately destroys it. The drawbuffer is never set up, so we can't dereference it asking if it's double buffered, or we'll crash on a null pointer dereference. Just bail early. Applications using EGL_KHR_no_config_context could hit this. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* texgetimage: Add check for the effective target to GetTextureSubImageEduardo Lima Mitev2017-02-031-0/+6
| | | | | | | | | | | | | | | | | | | OpenGL 4.5 spec, section "8.11.4 Texture Image Queries", page 233 of the PDF states: "An INVALID_OPERATION error is generated if texture is the name of a buffer or multisample texture." This is currently not being checked and e.g a multisample texture image can be passed down to the driver hook. On i965, it is crashing the driver with an assertion: intel_mipmap_tree.c:3125: intel_miptree_map: Assertion `mt->num_samples <= 1' failed. v2: (Ilia Mirkin) Move the check from gettextimage_error_check() to GetTextureSubImage() and use the texObj target. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Enable EXT_compressed_ETC1_RGB8_sub_texturePlamena Manolova2017-02-022-1/+1
| | | | | | | | | | | | | | | | Since we already have the functionality in place and games like Game of Thrones seem to depend on this extension, I think it makes sense to enable it by making it part of the extension string even though it's still a draft: https://www.khronos.org/registry/gles/extensions/EXT/EXT_compressed_ETC1_RGB8_sub_texture.txt Note: OES_compressed_ETC1_RGB8_sub_texture seems to be listed in gl2ext.h, but there's no documentation for it in the KHR registry Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: use same is_color_attachment trick to discern error casesIlia Mirkin2017-01-311-3/+11
| | | | | | | | | | | All the other calls to retrieve the attachment have been covered except this one - return the proper error for attachment points that are valid enums but out of bound for the driver. Fixes GL45-CTS.geometry_shader.layered_fbo.fb_texture_invalid_attachment Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add new MESA_GLSL flag for printing shader cache debug infoTimothy Arceri2017-01-312-0/+3
| | | | Reviewed-by: Eric Anholt <[email protected]>
* glsl: add cache to ctx and add sha1 string fieldsCarl Worth2017-01-312-0/+15
| | | | | | | | | We also add a flag for detecting shaders written to shader cache. V2: dont leak cache Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: add new uniform fields to be used to restore state from cacheCarl Worth2017-01-311-0/+4
| | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move variable declaration to where its usedEmil Velikov2017-01-271-2/+2
| | | | | | | | | | | The variable replacement was unused when building w/o ENABLE_SHADER_CACHE. Since we can mix variable declarations and code, move it to where its used. Fixes: 9f8dc3bf03e "utils: build sha1/disk cache only with Android/Autoconf" Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: use correct return statement for a void functionEmil Velikov2017-01-271-3/+4
| | | | | | | | | | Using return foo() is incorrect even if foo itself returns void. Spotted by AppVeyor, as below: teximage.c(3653) : warning C4098: 'copyteximage' : 'void' function returning a value Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/tests: automake: include builddir prior to srcdirEmil Velikov2017-01-271-1/+1
| | | | | | | Analogous to previous commit. Cc: "12.0 13.0" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* meta: Refactor texture format translationTopi Pohjolainen2017-01-272-0/+19
| | | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* mesa: Arrange validate_uniform_parameters parameters to match call sitesIan Romanick2017-01-261-11/+11
| | | | | | | | | | | | | | | Saves a measly 20 bytes on IA32 and nothing on x64. Depending on exactly when this is applied, a lot of variation is possible due to function alignment. text data bss dec hex filename 6670131 228340 22552 6921023 699b3f lib/i965_dri.so before 6670111 228340 22552 6921003 699b2b lib/i965_dri.so after 6342932 293872 29880 6666684 65b9bc lib64/i965_dri.so before 6342932 293872 29880 6666684 65b9bc lib64/i965_dri.so after Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Arrange _mesa_uniform parameters to match the call sitesIan Romanick2017-01-263-106/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By putting the parameters first that match the parameters to the call site, 4 (of 14) instructions are saved at _mesa_Uniform4fv on x64. On IA32, the details of the instructions change, but it is the same count and mix of instructions. Before: 0000000000000830 <_mesa_Uniform4fv>: 830: 48 83 ec 10 sub $0x10,%rsp 834: 49 89 d0 mov %rdx,%r8 837: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 83e <_mesa_Uniform4fv+0xe> 83e: 89 f8 mov %edi,%eax 840: 89 f1 mov %esi,%ecx 842: 41 b9 02 00 00 00 mov $0x2,%r9d 848: 64 48 8b 3a mov %fs:(%rdx),%rdi 84c: 48 8b 97 c8 01 02 00 mov 0x201c8(%rdi),%rdx 853: 48 8b 72 70 mov 0x70(%rdx),%rsi 857: 6a 04 pushq $0x4 859: 89 c2 mov %eax,%edx 85b: e8 00 00 00 00 callq 860 <_mesa_Uniform4fv+0x30> 860: 48 83 c4 18 add $0x18,%rsp 864: c3 retq After: 00000000000007f0 <_mesa_Uniform4fv>: 7f0: 48 83 ec 10 sub $0x10,%rsp 7f4: 48 8b 05 00 00 00 00 mov 0x0(%rip),%rax # 7fb <_mesa_Uniform4fv+0xb> 7fb: 41 b9 02 00 00 00 mov $0x2,%r9d 801: 64 48 8b 08 mov %fs:(%rax),%rcx 805: 48 8b 81 c8 01 02 00 mov 0x201c8(%rcx),%rax 80c: 6a 04 pushq $0x4 80e: 4c 8b 40 70 mov 0x70(%rax),%r8 812: e8 00 00 00 00 callq 817 <_mesa_Uniform4fv+0x27> 817: 48 83 c4 18 add $0x18,%rsp 81b: c3 retq Saves a measly 416 bytes of text on x64. Depending on exactly when this is applied, a lot of variation is possible due to function alignment. text data bss dec hex filename 6670131 228340 22552 6921023 699b3f lib/i965_dri.so before 6670131 228340 22552 6921023 699b3f lib/i965_dri.so after 6343348 293872 29880 6667100 65bb5c lib64/i965_dri.so before 6342932 293872 29880 6666684 65b9bc lib64/i965_dri.so after There is likely to be no performance change with just this patch. _mesa_uniform immediately calls validate_uniform_parameters with parameters in the "wrong" (different from the call site) order. v2: Rebase on GL_ARB_gpu_shader_fp64. v3: Rebase on GL_ARB_gpu_shader_int64. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Arrange _mesa_uniform_matrix parameters to match the call sitesIan Romanick2017-01-263-64/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By putting the parameters first that match the parameters to the call site, 4 (of 16) instructions are saved at _mesa_UniformMatrix4fv on x64. On IA32, the details of the instructions change, but it is the same count and mix of instructions. Before: 0000000000001380 <_mesa_UniformMatrix4fv>: 1380: 48 83 ec 10 sub $0x10,%rsp 1384: 48 8b 05 00 00 00 00 mov 0x0(%rip),%rax # 138b <_mesa_UniformMatrix4fv+0xb> 138b: 41 89 f8 mov %edi,%r8d 138e: 41 89 f1 mov %esi,%r9d 1391: 0f b6 d2 movzbl %dl,%edx 1394: 64 48 8b 38 mov %fs:(%rax),%rdi 1398: 48 8b b7 c8 01 02 00 mov 0x201c8(%rdi),%rsi 139f: 48 8b 76 70 mov 0x70(%rsi),%rsi 13a3: 68 06 14 00 00 pushq $0x1406 13a8: 51 push %rcx 13a9: 52 push %rdx 13aa: b9 04 00 00 00 mov $0x4,%ecx 13af: ba 04 00 00 00 mov $0x4,%edx 13b4: e8 00 00 00 00 callq 13b9 <_mesa_UniformMatrix4fv+0x39> 13b9: 48 83 c4 28 add $0x28,%rsp 13bd: c3 retq After: 0000000000001360 <_mesa_UniformMatrix4fv>: 1360: 48 83 ec 10 sub $0x10,%rsp 1364: 48 8b 05 00 00 00 00 mov 0x0(%rip),%rax # 136b <_mesa_UniformMatrix4fv+0xb> 136b: 0f b6 d2 movzbl %dl,%edx 136e: 64 4c 8b 00 mov %fs:(%rax),%r8 1372: 49 8b 80 c8 01 02 00 mov 0x201c8(%r8),%rax 1379: 68 06 14 00 00 pushq $0x1406 137e: 6a 04 pushq $0x4 1380: 6a 04 pushq $0x4 1382: 4c 8b 48 70 mov 0x70(%rax),%r9 1386: e8 00 00 00 00 callq 138b <_mesa_UniformMatrix4fv+0x2b> 138b: 48 83 c4 28 add $0x28,%rsp 138f: c3 retq Saves a measly 576 bytes of text on x64. text data bss dec hex filename 6670131 228340 22552 6921023 699b3f lib/i965_dri.so before 6670131 228340 22552 6921023 699b3f lib/i965_dri.so after 6343924 293872 29880 6667676 65bd9c lib64/i965_dri.so before 6343348 293872 29880 6667100 65bb5c lib64/i965_dri.so after v2: Rebase on GL_ARB_gpu_shader_fp64. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Trivial clean-ups in uniform_query.cppIan Romanick2017-01-261-8/+4
| | | | | | | | | This is C++, so we can mix code and declarations. Doing so allows constification. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Plamena Manolova <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Fix copy-and-paste bug in _mesa_(Program|)Uniform[1234](i|ui)64vARB ↵Ian Romanick2017-01-251-16/+16
| | | | | | | | | | | | | | | | | | | | | functions All of the functions were passing 1 to _mesa_uniform instead of passing count. Fixes 16 unsed parameter warnings like: main/uniforms.c: In function ‘_mesa_Uniform1i64vARB’: main/uniforms.c:1692:47: warning: unused parameter ‘count’ [-Wunused-parameter] _mesa_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *value) ^~~~~ This is why I build with extra warnings enabled. Unfortunately, there are so many unused parameter warnings in Mesa that I didn't notice these added warnings for over 6 months. :( Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Don't advertise GL_OES_read_format in core profileIan Romanick2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenGL ES implementations are not allowed to ship ARB extensions, and OpenGL implementations are not allowed to ship OES extensions. The functionality is also included in GL_ARB_ES2_compatibility. Ever OpenGL core-profile driver currently exposes both extensions. I don't know of any applications that explicitly check for GL_OES_read_format, so removing it seems very unlikely to cause problems. No functionality is removed. I have left this extension in place for compatibility profile. There are still OpenGL 1.x drivers in Mesa, and adding code to check for compatibility profile and not GL_ARB_ES2_compatibility for GL_IMPLEMENTATION_COLOR_READ_TYPE and GL_IMPLEMENTATION_COLOR_READ_FORMAT just feels dumb. Three other other alternatives considered: - Remove the string from compatibility profile drivers but leave the functionality in place. - Add a flag to expose the extension string, and set it in every OpenGL driver that does not expose GL_ARB_ES2_compatibility (and those drivers only). I tried this. You can't have two instances of an extension in the extension table (one dummy_true for ES1 and one with a flag for compatibility profile), so the implementation requires a bit of effort. - Only expose the extension in compatibility if the version is less than 2.0. I didn't see an easy way to do this. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* mesa: remove unused gl_shader_info field from gl_linked_shaderTimothy Arceri2017-01-231-2/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: set and get cs layouts to and from shader_infoTimothy Arceri2017-01-233-16/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: set and get gs layouts directly to and from shader_infoTimothy Arceri2017-01-231-8/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl/i965: set and get tes layouts directly to and from shader_infoTimothy Arceri2017-01-231-11/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: use last_vert_prog to get last {clip,cull}_distance_array_sizeTimothy Arceri2017-01-231-7/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: set {clip,cull}_distance_array_size directly in gl_programTimothy Arceri2017-01-232-46/+0
| | | | | | | There are some line wrapping violations here but those lines will get deleted in the following patch. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/glsl: change xfb_program field to last_vert_progTimothy Arceri2017-01-233-3/+6
| | | | | | | | | | Now that the i965 backend doesn't depend on this field we can make it more generic and short circuit a bunch of code paths. The new field will be used in a following patch for another clean-up. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: use gl_program for CurrentProgram rather than gl_shader_programTimothy Arceri2017-01-2311-210/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes much more sense and should be more performant in some critical paths such as SSO validation which is called at draw time. Previously the CurrentProgram array could have contained multiple pointers to the same struct which was confusing and we would often need to fish out the information we were really after from the gl_program anyway. Also it was error prone to depend on the _LinkedShader array for programs in current use because a failed linking attempt will lose the infomation about the current program in use which is still valid. V2: fix validate_io() to compare linked_stages rather than the consumer and producer to decide if we are looking at inward facing shader interfaces which don't need validation. Acked-by: Edward O'Callaghan <[email protected]> To avoid build regressions the following 2 patches were squashed in to this commit: mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use() These are rewritten to do what the function name suggests, that is _mesa_shader_program_use() sets the use of all stage and _mesa_program_use() sets the use of a single stage. Reviewed-by: Lionel Landwerlin <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> mesa: update active relinked program This likely fixes a subroutine bug were _mesa_shader_program_init_subroutine_defaults() would never have been called for the relinked program as we previously just set _NEW_PROGRAM as dirty and never called the _mesa_use* functions when linking. Acked-by: Edward O'Callaghan <[email protected]>
* mesa: Add support for 64-bit integer uniformsDave Airlie2017-01-202-5/+247
| | | | | | | | | | This hooks up the API to the internals for 64-bit integer uniforms. v2: update to use non-strict aliased alternatives Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Add ARB_gpu_shader_int64 extension bitsDave Airlie2017-01-202-0/+2
| | | | | | | | This just adds the usual boilerplate in mesa core. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mapi: Add support for ARB_gpu_shader_int64.Dave Airlie2017-01-203-0/+302
| | | | | | | | | | | | | | Just add the boilerplate xml code. v2 (idr): Update dispatch_sanity. Only add extension functions in core profile. v3 (idr): Remove comment line from gl_API.xml. Suggested by Matt. Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1] Reviewed-by: Matt Turner <[email protected]>
* mesa: update external textures when (re-)bindingPhilipp Zabel2017-01-201-2/+3
| | | | | | | | | | | | | | | To comply with the requirement from the GL_OES_EGL_image_external extension that a call to glBindTexture guarantees that all further sampling will return values that correspond to the values in the external texture at or after the time that glBindTexture was called, do not bail out early from mesa_BindTextures if the target is external. This will later allow the state tracker to instruct the pipe driver to invalidate internal resources derived from the external texture. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
* mesa/main: Fix FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for NONE attachment typeAlejandro Piñeiro2017-01-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the attachment type is NONE (att->Type), FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE should be NONE always. Note that technically, the current behaviour follows the spec. From OpenGL 4.5 spec, Section 9.2.3 "Framebuffer Object Queries": "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then either no framebuffer is bound to target; or the default framebuffer is bound, attachment is DEPTH or STENCIL, and the number of depth or stencil bits, respectively, is zero." Reading literally this paragraph, for the default framebuffer, NONE should be only returned if attachment is DEPTH and STENCIL without being allocated. But it doesn't makes too much sense to return DEFAULT_FRAMEBUFFER if the attachment type is NONE. For example, this can happens if the attachment is FRONT_RIGHT run on monoscopic mode, as that attachment is only available on stereo mode. With the current behaviour, defensive querying of the object type would not work properly. So you could query the object type checking for NONE, get DEFAULT_FRAMEBUFFER, and then get and INVALID_OPERATION when requesting other pnames (like RED_SIZE), as the real attachment type is NONE. This fixes: GL45-CTS.direct_state_access.framebuffers_get_attachment_parameters v2: don't change the behaviour for att->Type != GL_NONE, as caused some ES CTS regressions v3: simplify condition (Iago) Reviewed-by: Iago Toral Quiroga <[email protected]>