aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: don't flag _NEW_DEPTH for st/mesaMarek Olšák2017-06-223-5/+13
| | | | | | | | skipping _mesa_update_state_locked Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: make _mesa_set_varying_vp_inputs a no-op in GL core profileMarek Olšák2017-06-221-0/+4
| | | | | | | | just don't set _NEW_VARYING_VP_INPUTS. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove _NEW_BUFFER_OBJECTMarek Olšák2017-06-222-5/+4
| | | | | | | | not used Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_SCISSOR for st/mesaMarek Olšák2017-06-222-3/+5
| | | | | | | | | Not needed and we get to bypass _mesa_update_state_locked that would be a no-op. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't execute most of _mesa_update_state_locked for GL core profileMarek Olšák2017-06-221-46/+58
| | | | | | | | There is plenty of legacy stuff here. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: simplify handling the return value of update_programMarek Olšák2017-06-221-3/+2
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: simplify a loop in _mesa_update_texture_stateMarek Olšák2017-06-221-7/+1
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace VP/FP/ATIfs _Enabled flags with helper functionsMarek Olšák2017-06-227-40/+36
| | | | | | | | These are only used in the GL compatibility profile. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't update draw buffer bounds in _mesa_update_stateMarek Olšák2017-06-222-3/+5
| | | | | | | | | | | | | | | | st/mesa doesn't need the draw bounds for draw calls. I've added the call where it's necessary in core Mesa and drivers, but I suspect that most drivers can just move the call to the right places. The core Mesa places aren't hot paths, so the call overhead doesn't matter there. For now, only st/mesa is made such that this function is invoked very rarely. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove update_framebuffer_sizeMarek Olšák2017-06-221-43/+1
| | | | | | | | | | For the default framebuffer, _mesa_resize_framebuffer updates it. For FBOs, _mesa_test_framebuffer_completeness updates it. This code is redundant. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: replace ctx->Polygon._FrontBit with a helper functionMarek Olšák2017-06-224-20/+10
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace ctx->VertexProgram._TwoSideEnabled with a helper functionMarek Olšák2017-06-223-21/+11
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: stop using _NEW_STENCIL with st/mesa, use DriverFlags.NewStencil insteadMarek Olšák2017-06-223-13/+29
| | | | | | | | | | | | | | | | | | | This bypasses _mesa_update_state_locked. Before: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 3.99 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.56 million After: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.93 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 5.84 million It's quite a difference in the draw call rate when ctx->NewState stays equal to 0 the whole time. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace _mesa_update_stencil() with helper functionsMarek Olšák2017-06-224-39/+31
| | | | | | | | | | | | | The idea is to remove the dependency on _mesa_update_state_locked, so that st/mesa can skip it for stencil state updates, and then stop setting _NEW_STENCIL in mesa/main if the driver is st/mesa. The main motivation is to stop invoking _mesa_update_state_locked for certain state groups. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glStencilOp()Samuel Pitoiset2017-06-212-0/+10
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add stencil_op() helperSamuel Pitoiset2017-06-212-20/+29
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glStencilFunc()Samuel Pitoiset2017-06-212-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add stencil_func() helperSamuel Pitoiset2017-06-212-12/+20
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glStencilOpSeparate()Samuel Pitoiset2017-06-212-0/+12
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add stencil_op_separate() helperSamuel Pitoiset2017-06-211-24/+37
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glStencilMaskSeparate()Samuel Pitoiset2017-06-212-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add stencil_mask_separate() helperSamuel Pitoiset2017-06-211-11/+20
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glStencilFuncSeparate()Samuel Pitoiset2017-06-212-0/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add stencil_func_separate() helperSamuel Pitoiset2017-06-211-17/+28
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa/main: Move NULL pointer check.Plamena Manolova2017-06-201-6/+6
| | | | | | | | | | In blit_framebuffer we're already doing a NULL pointer check for readFb and drawFb so it makes sense to do it before we actually use the pointers. CID: 1412569 Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* mesa: simplify _mesa_IsVertexArray()Samuel Pitoiset2017-06-201-6/+1
| | | | | | | | | _mesa_lookup_vao() already returns NULL if id is zero. v2: - change the conditional (Ian) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> (v1)
* mesa/format_info: use designated initialiser listEric Engestrom2017-06-201-17/+20
| | | | | | | | Also, make that table const, since no-one is supposed to modify it anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add KHR_no_error support for gl*UniformHandleui64*ARBSamuel Pitoiset2017-06-181-19/+39
| | | | | | | | Similar to _mesa_uniform() except that we have to call validate_uniform_parameters() instead of validate_uniform(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glGetImageHandleARB()Samuel Pitoiset2017-06-182-0/+19
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glGetTexture*HandleARB()Samuel Pitoiset2017-06-182-0/+38
| | | | | | | | | | | | It would be nice to have a no_error path for _mesa_test_texobj_completeness() because this function doesn't only test if the texture is complete. Anyway, that seems enough for now and a bunch of checks are skipped with this patch. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glMake{Image,Texture}Handle*ResidentARB()Samuel Pitoiset2017-06-182-0/+58
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glIs{Image,Texture}HandleResidentARB()Samuel Pitoiset2017-06-182-0/+21
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: whitespace fixes in enable.cBrian Paul2017-06-161-68/+68
| | | | Remove trailing whitespace, replace tabs w/ spaces, etc. Trivial.
* mesa: fix 'make check' by moving bindless functions at the right placeSamuel Pitoiset2017-06-151-18/+18
| | | | | | | | | Fixes: 5f249b9f05e ("mapi: add GL_ARB_bindless_texture entry points") Reported-by: Mark Janes <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Aaron Watry <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* mesa: Add a BUFFER_BITS mask for depth+stencilJason Ekstrand2017-06-141-0/+3
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: fix setting uniform variables for bindless samplers/imagesSamuel Pitoiset2017-06-141-6/+19
| | | | | | | | | This fixes a 64-bit vs 32-bit mismatch when setting an array of bindless samplers. Also, we need to unconditionally set size_mul to 2 when the underlying uniform is bindless. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: handle bindless uniforms bound to texture/image unitsSamuel Pitoiset2017-06-141-6/+116
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: update textures for bindless samplers bound to texture unitsSamuel Pitoiset2017-06-142-2/+33
| | | | | | | | This is analogous to the existing SamplerUnits and SamplerTargets, but it loops over bindless samplers bound to texture units. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add update_single_program_texture_state() helperSamuel Pitoiset2017-06-141-13/+23
| | | | | | | | This will also be used for looping over bindless samplers bound to texture units. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add update_single_shader_texture_used() helperSamuel Pitoiset2017-06-141-29/+38
| | | | | | | | This will also be used for looping over bindless samplers bound to texture units. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add infrastructure for bindless samplers/images bound to unitsSamuel Pitoiset2017-06-141-0/+52
| | | | | | | | | | | | | | | | | | | Yes, ARB_bindless_texture allows to do this. In other words, in a situation like: layout (bindless_sampler) uniform sampler2D tex; The 'tex' sampler uniform can be either set with glUniform1() (old-style bound samplers) or with glUniformHandleui() (resident handles). When glUniform1() is used, we have to somehow make the texture resident "under the hood". This is done by requesting a texture handle to the driver, making the handle resident in the current context and overwriting the value directly in the constant buffer. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to change tex buffers when a handle is allocatedSamuel Pitoiset2017-06-141-2/+2
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by BufferData if it is called to modify a buffer object bound to a buffer texture while that texture object is referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to change textures when a handle is allocatedSamuel Pitoiset2017-06-141-1/+24
| | | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to update tex parameters when a handle is allocatedSamuel Pitoiset2017-06-141-0/+38
| | | | | | | | | | | | | The ARB_bindless_texture spec says: "The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: refuse to update sampler parameters when a handle is allocatedSamuel Pitoiset2017-06-141-11/+22
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by SamplerParameter* if <sampler> identifies a sampler object referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add support for glUniformHandleui64*ARB()Samuel Pitoiset2017-06-143-0/+83
| | | | | | | | | | | | | | Bindless sampler/image handles are represented using 64-bit unsigned integers. The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by UniformHandleui64{v}ARB if the sampler or image uniform being updated has the "bound_sampler" or "bound_image" layout qualifier"." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add support for unsigned 64-bit vertex attributesSamuel Pitoiset2017-06-142-0/+22
| | | | | | | | This adds support in the VBO and array code to handle unsigned 64-bit vertex attributes as specified by ARB_bindless_texture. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: implement ARB_bindless_textureSamuel Pitoiset2017-06-148-7/+960
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move some hash declarations to hash.hSamuel Pitoiset2017-06-142-56/+56
| | | | | | | These will be used by the bindless hash tables to initialize the default deleted key value. Signed-off-by: Samuel Pitoiset <[email protected]>
* mapi: add GL_ARB_bindless_texture entry pointsSamuel Pitoiset2017-06-1411-0/+241
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>