summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/get: Remove unused extra_ARB_viewport_arrayBoyan Ding2017-01-131-1/+0
| | | | | | | | Unused since 0a7691ee (mesa: Enable enums for OES_viewport_array). Silence a warning of unused variable. Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* main/fbobject: throw invalid operation when get_attachment fails if neededAlejandro Piñeiro2017-01-131-7/+42
| | | | | | | | | | | | | | | | In most cases, if a call to get_attachment fails is because attachment is a INVALID_ENUM. But for some specific cases, if COLOR_ATTACHMENTm (where m >= MAX_COLOR_ATTACHMENTS) is used, it should raise an INVALID_OPERATION exception instead. Fixes: GL45-CTS.direct_state_access.framebuffers_get_attachment_parameter_errors GL45-CTS.direct_state_access.framebuffers_renderbuffer_attachment_errors v2: extra new line before quote block. Include "color attachment" on both new message errors (Nicolai). Reviewed-by: Nicolai Hähnle <[email protected]>
* main/fboject: return if it is color_attachment on get_attachmentAlejandro Piñeiro2017-01-131-11/+19
| | | | | | | | | Some callers would need that info to know if they should raise INVALID_ENUM or INVALID_OPERATION. An alternative would be the caller to check if the attachment is a GL_COLOR_ATTACHMENTm, but that seems redundant as get_attachment is already doing that. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: fix version/extension checks in _mesa_ClampColorNicolai Hähnle2017-01-131-6/+10
| | | | | | | | | | | | | Add a proper check for feature support, and raise an invalid enum for GL_CLAMP_VERTEX/FRAGMENT_COLOR unconditionally in core profiles, since those enums were explicitly removed after the extension was promoted to core functionality (not in the profile sense) with OpenGL 3.0. This matches the behavior of the AMD closed source driver and fixes GL45-CTS.gtf30.GL3Tests.half_float.half_float_textures. Cc: "12.0 13.0" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main/buffers: take into account FRONT_AND_BACK on ReadBufferAlejandro Piñeiro2017-01-121-0/+2
| | | | | | | | | | | | | | | | | | From OpenGL 3.1 spec, section 4.3.1 "Reading Pixels", page 190 (203 PDF) "When READ FRAMEBUFFER BINDING is zero, i.e. the default framebuffer, src must be one of the values listed in table 4.4, including NONE . FRONT_AND_BACK , FRONT , and LEFT refer to the front left buffer." There is an equivalent text on OpenGL 4.5 spec, section 18.2.1 "Selecting Buffers for Reading", page 502 (524 PDF), so the behaviour is still the same. Part of the fix for: GL45-CTS.direct_state_access.framebuffers_draw_read_buffers_errors Reviewed-by: Anuj Phogat <[email protected]>
* main/buffers: update error handling on DrawBuffers for 4.5Alejandro Piñeiro2017-01-121-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 4.5, GL_BACK was not allowed as a value of bufs. Since 4.5 it is allowed under some circumstances: From the OpenGL 4.5 specification, Section 17.4.1 "Selecting Buffers for Writing", page 493 (page 515 of the PDF): "An INVALID_ENUM error is generated if any value in bufs is FRONT, LEFT, RIGHT, or FRONT_AND_BACK . This restriction applies to both the de- fault framebuffer and framebuffer objects, and exists because these constants may themselves refer to multiple buffers, as shown in table 17.4." And on page 492 (page 514 of the PDF): "If the default framebuffer is affected, then each of the constants must be one of the values listed in table 17.6 or the special value BACK . When BACK is used, n must be 1 and color values are written into the left buffer for single-buffered contexts, or into the back left buffer for double-buffered contexts." This patch keeps the same behaviour if OpenGL version is < 4. We assume that for 4.x this is the intended behaviour, so a fix, but for 3.x the intended behaviour is the already in place. Part of the fix for: GL45-CTS.direct_state_access.framebuffers_draw_read_buffers_errors v2: remove forgot printf v3: remove spaces before commas on spec quote, split line too long (Anuj) Reviewed-by: Anuj Phogat <[email protected]>
* compiler: Merge shader_info's tcs and tes structs.Kenneth Graunke2017-01-101-5/+5
| | | | | | | | | | | | | | | Annoyingly, SPIR-V lets you specify all of these fields in either the TCS or TES, which means that we need to be able to store all of them for either shader stage. Putting them in a union won't work. Combining both is an easy solution, and given that the TCS struct only had a single field, it's pretty inexpensive. This patch renames the combined struct to "tess" to indicate that it's for tessellation in general, not one of the two stages. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: set GLSL 1.20 for the fixed-function fragment shaderMarek Olšák2017-01-101-1/+13
| | | | | | | | | | | | This fixes broken depth texturing after: commit 22639a6e19f95902aef23474ad672bf489231ea7 Author: Timothy Arceri <[email protected]> Date: Mon Nov 21 00:29:29 2016 +1100 st/mesa: get Version from gl_program rather than gl_shader_program Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa/glsl: set num_images directly in shader_infoTimothy Arceri2017-01-092-8/+0
| | | | | | This change also removes the now duplicate NumImages field. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Introduce a compiler enum for tessellation spacing.Kenneth Graunke2017-01-072-7/+19
| | | | | | | | | | It feels weird using GL_* enums in a Vulkan driver. v2: Fix the TESS_SPACING -> PIPE_TESS_SPACING conversion. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* compiler: Change shader_info->tes.vertex_order into a ccw boolean.Kenneth Graunke2017-01-071-1/+1
| | | | | | | | | | The vertex order is either clockwise or counterclockwise. We can just store a "ccw" boolean rather than GLenum values. I don't want to use GLenums in a Vulkan driver, and even in GL a simple boolean works fine. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: Support gl_TessLevelInner/Outer[] as TES input variables.Kenneth Graunke2017-01-061-0/+6
| | | | | | | | | | Upcoming reworks in i965 are going to make it easy to handle this like any other input. Having it as a system value will just require additional code for no benefit. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa/glsl: move SamplerTargets to gl_programTimothy Arceri2017-01-063-8/+10
| | | | | | | | This will help allow us to simplify the handling of samplers by storing them in a single location rather than duplicating them in both gl_linked_shader and gl_program. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa/glsl: set SamplersUsed directly in gl_programTimothy Arceri2017-01-061-2/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa/glsl: set sampler units directly in gl_programTimothy Arceri2017-01-063-15/+4
| | | | | | | Now that we create gl_program earlier there is no need to mess about copying things to gl_linked_shader then to gl_program. Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify sampler setting codeTimothy Arceri2017-01-061-22/+11
| | | | | | | | There is no need to loop over active samplers the code above this would have already exited if the sampler was inactive, or errored if the count was larger than the uniforms array size. Reviewed-by: Eric Anholt <[email protected]>
* mesa/glsl: set num_textures per stage directly in shader_infoTimothy Arceri2017-01-062-2/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: make _CurrentFragmentProgram a gl_program struct pointerTimothy Arceri2017-01-065-24/+20
| | | | | | | | Making this point to a gl_program struct rather than a gl_shader_program struct will allow use to later also make the CurrentProgram array hold gl_program structs which in turn will allow for code simpilifcation. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa/glsl: add new is_arb_asm flag in gl_programTimothy Arceri2017-01-065-5/+7
| | | | | | | | | | | | | | | | Set the flag via the _mesa_init_gl_program() and NewProgram() helpers. In i965 we currently check for the existance of gl_shader_program to decide if this is an ARB assembly style program or not. Adding a flag makes the code clearer and will help removes a dependency on gl_shader_program in the i965 codegen functions. Also this will allow use to skip initialising sampler units for linked shaders, we currently memset it to zero again during linking. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa/glsl/i965: move ShaderStorageBlocks to gl_programTimothy Arceri2017-01-061-2/+1
| | | | | | | | | | | | Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader variant but may have lost some required fields. Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa/glsl/i965: set num_ssbos directly in shader_infoTimothy Arceri2017-01-061-1/+0
| | | | | | | Here we also remove the duplicate field in gl_linked_shader and always get the value from shader_info instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa/glsl/i965: move per stage UniformBlocks to gl_programTimothy Arceri2017-01-061-2/+2
| | | | | | | This will help allow us to store pointers to gl_program structs in the CurrentProgram array resulting in a bunch of code simplifications. Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa/glsl/i965: set num_ubos directly in shader_infoTimothy Arceri2017-01-061-1/+0
| | | | | | | This also removes the duplicate field in gl_linked_shader, and gets num_ubos from shader_info instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa/glsl/i965: move ImageUnits and ImageAccess fields to gl_programTimothy Arceri2017-01-062-21/+21
| | | | | | | | | | | | | | | Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader variant but may have lost some required fields. We drop the memset on ImageUnits because gl_program is already created using rzalloc(). Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: add gl_constants::GLSLOptimizeConservativelyMarek Olšák2017-01-052-3/+14
| | | | | | to reduce the amount of GLSL optimizations for drivers that can do better. Reviewed-by: Eric Anholt <[email protected]>
* glsl/mesa: add reference to gl_shader_program_data from gl_programTimothy Arceri2016-12-311-0/+3
| | | | | | | | | We also add the stubs for the standalone compiler in this change. By adding a reference here we can now refactor some code to use gl_program where we were previously awkwardly using gl_shader_program. Reviewed-by: Eric Anholt <[email protected]>
* mesa: make union in gl_program a struct and add FIXMETimothy Arceri2016-12-311-1/+5
| | | | | | | | i915 is mixing the use of these fields, for now change this to a struct and add a FIXME. Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99229
* mesa/glsl/i965: remove Driver.NewShader()Timothy Arceri2016-12-303-27/+0
| | | | | | | | | After removing brw_shader in the previous commit this is no longer needed. V2: remove use in src/compiler/glsl/test_optpass.cpp Reviewed-by: Eric Anholt <[email protected]>
* mesa/glsl: move BlendSupport bitfield to gl_programTimothy Arceri2016-12-302-6/+15
| | | | | | | | | | | | This will let us to make _CurrentFragmentProgram a gl_program pointer allowing for simpilifications to be made. We also need to add a field to gl_shader to hold it during parsing. In gl_program we put it inside a union in anticipation of moving more fields here that can be only fs or vertex stage fields. Reviewed-by: Eric Anholt <[email protected]>
* mesa: store gl_program in gl_transform_feedback_object rather than ↵Timothy Arceri2016-12-302-14/+13
| | | | | | | | | gl_shader_program This will allow us to make the CurrentProgram array store gl_program which allows us to do a bunch of simplifications. Reviewed-by: Eric Anholt <[email protected]>
* mesa/glsl: move LinkedTransformFeedback from gl_shader_program to gl_programTimothy Arceri2016-12-303-7/+9
| | | | | | | | | | | | This will help allow us to store gl_program in the CurrentProgram array rather than gl_shader_program which will allow a bunch of simplifications. Note that we make LinkedTransformFeedback a pointer so we don't waste memory creating a struct for each stage. We also store a pointer to the gl_program that will contain the pointer in gl_shader_program so we can get easy access to the correct stage. Reviewed-by: Eric Anholt <[email protected]>
* mesa: move _Used to gl_programTimothy Arceri2016-12-302-5/+6
| | | | | | We no longer need to initialise it because gl_program is never reused. Reviewed-by: Eric Anholt <[email protected]>
* mesa/compiler: add local_size_variable to shader_infoTimothy Arceri2016-12-301-0/+1
| | | | | | | | This will be used in api_validate.c in a following patch when we switch to using gl_program pointers for the pipelines CurrentProgram array. Reviewed-by: Eric Anholt <[email protected]>
* mesa: pass gl_program to _mesa_append_uniforms_to_file()Timothy Arceri2016-12-301-1/+1
| | | | | | This now contains everything we need. Reviewed-by: Eric Anholt <[email protected]>
* glsl/mesa: set separate_shader directly in shader_infoTimothy Arceri2016-12-301-0/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa/glsl: move subroutine metadata to gl_programTimothy Arceri2016-12-303-63/+66
| | | | | | | | This will allow us to store gl_program rather than gl_shader_program as the current program perstage which allows us to simplify code that makes use of the CurrentProgram list. Reviewed-by: Eric Anholt <[email protected]>
* mesa/shaderobj: Fix races on refcountsChad Versace2016-12-281-10/+4
| | | | | | | | | | | | | | | | | | | | | | Use atomic ops when updating gl_shader::RefCount. Fixes intermittent failures and crashes in 'dEQP-EGL.functional.sharing.gles2.multithread.*'. All tests in that group now pass except 'dEQP-EGL.functional.sharing.gles2.multithread.simple_egl_server_sync.textures.copyteximage2d_texsubimage2d_render'. Tested with: mesa: branch 'master' at d6545f2 deqp: branch 'nougat-cts-dev' at 4acf725 with additional local fixes DEQP_TARGET: x11_egl hw: Intel Broadwell 0x1616 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99085 Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: [email protected] Cc: Mark Janes <[email protected]> Cc: Haixia Shi <[email protected]>
* mesa/texformat: Handle GL_RGBA + GL_UNSIGNED_SHORT_5_5_5_1Chad Versace2016-12-271-0/+2
| | | | | | | | | | | | | | | | _mesa_choose_tex_format() already handles GL_RGBA + GL_UNSIGNED_SHORT_1_5_5_5_REV by converting it to MESA_FORMAT_B5G5R5A1_UNORM. Teach it do the same for the non-reversed type. Otherwise, the switch's fallthrough converts it to an 8888 format, which has incompatible precision in the alpha channel. Patch 2/2 to fix dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8 on Intel. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99185 Cc: Haixia Shi <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: "13.0" <[email protected]>
* mesa: don't attempt to unlock an unlocked debug state mutexJonathan Gray2016-12-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 929fcee47e46781c57f2a354ce0a013915c033d1 introduced code that attempts to unlock an unlocked mutex which is undefined behaviour. On OpenBSD this leads to an abort: 0 0x0000124dadfa96ba in thrkill () at <stdin>:2 1 0x0000124dadf3da39 in *_libc_abort () at /usr/src/lib/libc/stdlib/abort.c:52 2 0x0000124d2c1165b5 in *_libpthread_pthread_mutex_unlock (mutexp=<optimized out>) at /usr/src/lib/librthread/rthread_sync.c:221 3 0x0000124d279c02e4 in init_attrib_groups (ctx=0x124df0fda000) at main/context.c:825 4 _mesa_initialize_context (ctx=ctx@entry=0x124df0fda000, api=api@entry=API_OPENGL_CORE, visual=visual@entry=0x7f7ffffbdfd0, share_list=share_list@entry=0x0, driverFunctions=driverFunctions@entry=0x7f7ffffbda60) at main/context.c:1204 5 0x0000124d27b507ec in st_create_context (api=api@entry=API_OPENGL_CORE, pipe=pipe@entry=0x124dc4910000, visual=visual@entry=0x7f7ffffbdfd0, share=share@entry=0x0, options=options@entry=0x7f7ffffbe128) at state_tracker/st_context.c:545 6 0x0000124d27b8639f in st_api_create_context (stapi=<optimized out>, smapi=0x124d1b608800, attribs=0x7f7ffffbe100, error=0x7f7ffffbe0fc, shared_stctxi=0x0) at state_tracker/st_manager.c:669 7 0x0000124d27cc5b9c in dri_create_context (api=<optimized out>, visual=0x124d8a0f8a00, cPriv=0x124de473f240, major_version=<optimized out>, minor_version=<optimized out>, flags=<optimized out>, notify_reset=false, error=0x7f7ffffbe2b4, sharedContextPrivate=0x0) at dri_context.c:123 8 0x0000124d27cc5029 in driCreateContextAttribs (screen=0x124d8a0f8400, api=<optimized out>, config=0x124d8a0f8a00, shared=<optimized out>, num_attribs=<optimized out>, attribs=<optimized out>, error=0x7f7ffffbe2b4, data=0x124d77814a00) at dri_util.c:448 9 0x0000124d8e109b00 in drisw_create_context_attribs (base=0x124df3e08700, config_base=0x124d7a0e7300, shareList=<optimized out>, num_attribs=<optimized out>, attribs=<optimized out>, error=0x7f7ffffbe2b4) at drisw_glx.c:476 10 0x0000124d8e104b4a in glXCreateContextAttribsARB (dpy=0x124d533f0000, config=0x124d7a0e7300, share_context=0x0, direct=1, attrib_list=0x7f7ffffbe300) at create_context.c:78 Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* mesa: Silence numerous "unused parameter" warnings in dlist.cIan Romanick2016-12-191-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | main/dlist.c: In function ‘save_DrawArraysInstancedARB’: main/dlist.c:1748:36: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawArraysInstancedARB(GLenum mode, ^~~~ main/dlist.c:1749:35: warning: unused parameter ‘first’ [-Wunused-parameter] GLint first, ^~~~~ main/dlist.c:1750:37: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1751:37: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount) ^~~~~~~~~ main/dlist.c: In function ‘save_DrawElementsInstancedARB’: main/dlist.c:1759:38: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawElementsInstancedARB(GLenum mode, ^~~~ main/dlist.c:1760:39: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1761:38: warning: unused parameter ‘type’ [-Wunused-parameter] GLenum type, ^~~~ main/dlist.c:1762:45: warning: unused parameter ‘indices’ [-Wunused-parameter] const GLvoid *indices, ^~~~~~~ main/dlist.c:1763:39: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount) ^~~~~~~~~ main/dlist.c: In function ‘save_DrawElementsInstancedBaseVertexARB’: main/dlist.c:1771:48: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawElementsInstancedBaseVertexARB(GLenum mode, ^~~~ main/dlist.c:1772:49: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1773:48: warning: unused parameter ‘type’ [-Wunused-parameter] GLenum type, ^~~~ main/dlist.c:1774:55: warning: unused parameter ‘indices’ [-Wunused-parameter] const GLvoid *indices, ^~~~~~~ main/dlist.c:1775:49: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount, ^~~~~~~~~ main/dlist.c:1776:47: warning: unused parameter ‘basevertex’ [-Wunused-parameter] GLint basevertex) ^~~~~~~~~~ main/dlist.c: In function ‘save_DrawArraysInstancedBaseInstance’: main/dlist.c:1785:45: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawArraysInstancedBaseInstance(GLenum mode, ^~~~ main/dlist.c:1786:44: warning: unused parameter ‘first’ [-Wunused-parameter] GLint first, ^~~~~ main/dlist.c:1787:46: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1788:46: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount, ^~~~~~~~~ main/dlist.c:1789:45: warning: unused parameter ‘baseinstance’ [-Wunused-parameter] GLuint baseinstance) ^~~~~~~~~~~~ main/dlist.c: In function ‘save_DrawElementsInstancedBaseInstance’: main/dlist.c:1797:47: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawElementsInstancedBaseInstance(GLenum mode, ^~~~ main/dlist.c:1798:48: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1799:47: warning: unused parameter ‘type’ [-Wunused-parameter] GLenum type, ^~~~ main/dlist.c:1800:52: warning: unused parameter ‘indices’ [-Wunused-parameter] const void *indices, ^~~~~~~ main/dlist.c:1801:48: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount, ^~~~~~~~~ main/dlist.c:1802:47: warning: unused parameter ‘baseinstance’ [-Wunused-parameter] GLuint baseinstance) ^~~~~~~~~~~~ main/dlist.c: In function ‘save_DrawElementsInstancedBaseVertexBaseInstance’: main/dlist.c:1810:57: warning: unused parameter ‘mode’ [-Wunused-parameter] save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, ^~~~ main/dlist.c:1811:58: warning: unused parameter ‘count’ [-Wunused-parameter] GLsizei count, ^~~~~ main/dlist.c:1812:57: warning: unused parameter ‘type’ [-Wunused-parameter] GLenum type, ^~~~ main/dlist.c:1813:62: warning: unused parameter ‘indices’ [-Wunused-parameter] const void *indices, ^~~~~~~ main/dlist.c:1814:58: warning: unused parameter ‘primcount’ [-Wunused-parameter] GLsizei primcount, ^~~~~~~~~ main/dlist.c:1815:56: warning: unused parameter ‘basevertex’ [-Wunused-parameter] GLint basevertex, ^~~~~~~~~~ main/dlist.c:1816:57: warning: unused parameter ‘baseinstance’ [-Wunused-parameter] GLuint baseinstance) ^~~~~~~~~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix all the whitespace errors in dlist.cIan Romanick2016-12-191-187/+186
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Track the linearized array index for each UBO instance array elementIan Romanick2016-12-191-0/+15
| | | | | | | | | | v2: Set linearizer_array_index in process_block_array_leaf. Suggested by Timothy. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix program interface queries relating to interface blocks.Kenneth Graunke2016-12-191-73/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes 555 dEQP tests (using the nougat-cts-dev branch), Piglit's arb_program_interface_query/arb_program_interface_query-resource-query, and GL45-CTS.program_interface_query.separate-programs-{tess-control, tess-eval,geometry}. Only one dEQP program interface failure remains. I would have liked to split this up into several distinct changes, but I wasn't sure how to do that given thet tangled nature of these issues. So, the issues: * We need to treat interface blocks declared as an array of instances as a single block - removing the outer array. The resource list entry's name should not include the array length. Properties such as GL_ARRAY_SIZE should refer to the variable inside the block, not the interface block's array properties. * We need to do this prefixing even for structure variables. * We need to do this for built-ins (such as gl_PerVertex.gl_Position). * After interface array unwrapping, any variable which is an array should have [0] appended. It doesn't matter if it's a TCS/TES/GS input or TCS output - that looked like an attempt to unwrap for per-vertex variables, but that didn't consider per-patch variables, and as far as I can tell there's nothing to justify this. Several Mesa developers have suggested that Issue 16 contradicts the main specification, but I believe that it doesn't - the main spec just isn't terribly clear. The main ARB_program_interface query spec says: "* For an active interface block not declared as an array of block instances, a single entry will be generated, using the block name from the shader source. * For an active interface block declared as an array of instances, separate entries will be generated for each active instance. The name of the instance is formed by concatenating the block name, the "[" character, an integer identifying the instance number, and the "]" character." Issue 16 says that built-ins should be named "gl_PerVertex.gl_Position", but several people suggested the second bullet above means that it should be named "gl_PerVertex[array length].gl_Position". There are two important things to note. Those bullet points say "an active interface block", while the others say "variable" or "active shader storage block member". They also don't mention applying the rules recursively (unlike the other bullets). Both suggest that these rules apply to blocks themselves, not members of blocks. In fact, for GL_UNIFORM_BLOCK queries, we do have "block[0]", "block[1]", ... resource list entries - so those rules are real, and actually used. So if they don't apply to block members, then how should members be named? Unfortunately, I don't see any rules outside of issue 16 - where the rationale is very unclear. I hope to clarify the spec in the future. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/get: Convert stencil values to TYPE_UINT.Kenneth Graunke2016-12-191-6/+6
| | | | | | | | | | | | | | | These are listed as Z+ in the GL spec, and often have values of 0xFFFFFFFF. For glGetFloat, we should return 4294967295.0 rather than -1.0. Similarly, for glGetInteger64v, we should return 0xFFFFFFFF, not the sign extended 0xFFFFFFFFFFFFFFFF. Fixes 6 dEQP tests matching the pattern dEQP-GLES3.functional.state_query.integers.stencil*value*mask*getfloat when run in a single process (with state reset code happening between tests, which makes dEQP set the stencil value mask to 0xFFFFFFFF). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/get: Add TYPE_UINT for casting through a GLuint.Kenneth Graunke2016-12-191-0/+80
| | | | | | | | | | | | | | | | | The "State Tables" section of the OpenGL specification lists many values as belonging to Z+ (non-negative integers), not Z (all integers). For ordinary glGetInteger queries, this doesn't matter. However, when accessing Z+ values via glGetFloat or glGetInteger64, we need to treat the source value as an unsigned value. Otherwise, we'll produce a negative number when bit 31 is set. This commit merely adds the plumbing. It doesn't convert any values. v2: Gotta catch 'em all (add missing cases caught by Ilia) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/get: Make GetFloat/GetDouble of TYPE_INT_N not normalize things.Kenneth Graunke2016-12-191-3/+3
| | | | | | | | | | | | | | | | | GetFloat of integer valued things is supposed to perform a simple int -> float conversion. INT_TO_FLOAT is not that. Instead, it converts [-2147483648, 2147483647] to a normalized [-1.0, 1.0] float. This is only used for COMPRESSED_TEXTURE_FORMATS, which nobody in their right mind would try and access via glGetFloat(), but we may as well fix it. Found by inspection. v2: Gotta catch 'em all (fix another case of this caught by Ilia) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main: add INTEL_conservative_rasterization enum query supportLionel Landwerlin2016-12-132-0/+8
| | | | | | | v2: add extra parameter (Ilia) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* extensions: update INTEL_conservative_rasterization dependenciesLionel Landwerlin2016-12-131-1/+1
| | | | | | | Suggested by Ilia. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main: don't error when enabling conservative rasterization on glesLionel Landwerlin2016-12-131-1/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main: use new driver flag for conservative rasterization stateLionel Landwerlin2016-12-132-1/+8
| | | | | | | | | | | Suggested by Marek. v2: Use new driver flag (Marek) v3: Fix i965 comments (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>