summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965: Avoid int64 induced warningsDave Airlie2017-01-203-0/+6
| | | | | | | | | Just add types into unsupported or double equivalent spots. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/program: Add unused ir operations.Dave Airlie2017-01-201-0/+28
| | | | | | | | | v2 (idr): "cut them down later" => Remove ir_unop_b2u64 and ir_unop_u642b. Handle these with extra i2u or u2i casts just like uint(bool) and bool(uint) conversion is done. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[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]>
* glsl: Add basic ARB_gpu_shader_int64 typesDave Airlie2017-01-202-0/+20
| | | | | | | | | | | | | This adds the builtins and the lexer support. To avoid too many warnings, it adds basic support to the type in a few other places in mesa, mostly in the trivial places. It also adds a query to be used later for if a type is an integer 32 or 64. 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]>
* i965: Validate "Special Cases for Byte Operations"Matt Turner2017-01-202-9/+150
| | | | | Do this in general_restrictions_based_on_operand_types() because the two rules that "Special Cases for Byte Operations" relax are checked there.
* i965: Validate "Region Alignment Rules"Matt Turner2017-01-202-1/+697
|
* i965: Validate "General Restrictions Based on Operand Types"Matt Turner2017-01-202-0/+273
|
* i965: Validate "General Restrictions on Regioning Parameters"Matt Turner2017-01-202-0/+377
|
* i965: Replace reg_type_size[] with a function.Matt Turner2017-01-203-25/+75
| | | | | | A function is necessary to handle immediate types. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Validate math instruction sources.Matt Turner2017-01-202-9/+23
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Claim that SEND/math has two sources.Matt Turner2017-01-201-1/+8
| | | | | | | | src1 must be a descriptor (including the information to determine that the SEND is doing an extended math operation), but src0 can actually be null since it serves as the source of the implicit GRF -> MRF move. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Simplify num_sources_from_inst().Matt Turner2017-01-201-3/+1
| | | | | | | | desc will always be non-NULL, because brw_validate_instructions() does not attempt to validate any instructions that fail the is_unsupported_inst() check. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Factor out send_restrictions() function.Matt Turner2017-01-201-12/+22
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Factor out sources_not_null() validation function.Matt Turner2017-01-201-17/+23
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Structure code so unsupported inst will not generate more errors.Matt Turner2017-01-201-2/+5
| | | | | | | | We want to rely on brw_opcode_desc() always returning non-NULL in other validation functions. Other validation functions will be in the else case of the block added in this patch. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a test for the EU assembly validator.Matt Turner2017-01-202-0/+176
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a CHECK macro to call more complicated validation funcs.Matt Turner2017-01-201-0/+9
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make ERROR_IF usable from other functions.Matt Turner2017-01-201-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Mark error annotation on correct SIMD16 inst.Matt Turner2017-01-201-2/+2
| | | | | | | | | | | | inst, whose assignment can be seen in the last line of context pointed to the correct instruction in the SIMD16 program, but src_offset was the offset from the beginning of the SIMD16 program. So if an instruction at offset 0x100 in the SIMD16 program was illegal, we would mark an error on the instruction at offset 0x100 (which is likely in the SIMD8 program). Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Use UW-typed operands when dest is UW.Matt Turner2017-01-201-4/+6
| | | | | | | | | | Using a UD-typed operand makes the execution size D, and if the size of the execution type is greater than the size of the destination type, the destination must be appropriately strided. We actually just want UW-types all around. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use W-typed immediate in brw_F32TO16().Matt Turner2017-01-201-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Don't change F->VF if dest type is DF.Matt Turner2017-01-201-1/+2
| | | | | | | | | We change the immediate source type to VF to allow instruction compaction, but there are no entires in the compaction table for DF, so there's no point in doing this. Additionally, I mixing floating-point types is now allowed except for F and VF.
* st/mesa: ask pipe driver to recreate derived internal resources when ↵Philipp Zabel2017-01-201-0/+4
| | | | | | | | | | | | | | | (re-)binding external textures Use the resource_changed callback to invalidate internal resources derived from external textures when they are (re-)bound. This is needed 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. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Lucas Stach <[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]>
* i965: Remove unnecessary mt->compressed checksAnuj Phogat2017-01-191-12/+4
| | | | | | | | It's harmless to use ALIGN_NPOT() for uncompressed formats because they have block width/height = 1. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Fix indentation in brw_miptree_layout_2d()Anuj Phogat2017-01-191-3/+2
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Fix comment to include 3d texturesAnuj Phogat2017-01-191-1/+2
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Delete pending CCS and HiZ ops in intel_miptree_make_shareable()Chad Versace2017-01-191-0/+16
| | | | | | | | | | | | | | | | | | | Fixes crash in piglit `egl_khr_gl_renderbuffer_image-clear-shared-image GL_DEPTH_COMPONENT24` on Skylake. The crash happened because blorp attempted to execute a pending hiz clear after the hiz buffer was deleted. Deleting the pending hiz ops when the hiz buffer gets deleted fixes the crash. For good measure, this patch also deletes all pending CCS/MCS ops when the CCS/MCS buffer gets deleted. I'm now aware of any bugs caused by the dangling ops, but deleting them is clearly the right thing to do. Cc: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99265
* 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]>
* mesa/main: fix meta caller of _mesa_ClampColorNicolai Hähnle2017-01-191-1/+2
| | | | | | | | | | | Since _mesa_ClampColor properly checks for support of the API function now, it's meta callers need to check support as well. Fixes: 963311b71f ("mesa/main: fix version/extension checks in _mesa_ClampColor") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99401 Tested-by: Mark Janes <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Cc: "17.0" <[email protected]>
* mesa/glsl: move TransformFeedbackBufferStride to gl_shaderTimothy Arceri2017-01-191-5/+3
| | | | | | | | | | Here we remove the single use of this field in gl_linked_shader which allows us to move the field out of gl_shader_info While we are at it we rewrite link_xfb_stride_layout_qualifiers() to be more clear. Reviewed-by: Lionel Landwerlin <[email protected]>
* glsl: set InnerCoverage directly in gl_programTimothy Arceri2017-01-192-3/+1
| | | | | | Also move out of the shared gl_shader_info. Reviewed-by: Lionel Landwerlin <[email protected]>
* glsl: tidy up PostDepthCoverage shader fieldTimothy Arceri2017-01-192-2/+2
| | | | | | | There is no reason for this to be in the shared gl_shader_info or to copy it to gl_program at the end of linking (its already there). Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move pixel_center_integer to gl_shaderTimothy Arceri2017-01-191-2/+1
| | | | | | | This is only used by gl_linked_shader as a temp during linking so use a temp there instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move origin_upper_left to gl_shaderTimothy Arceri2017-01-191-4/+5
| | | | | | | This is only used by gl_linked_shader as a temp during linking so use a temp there instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move uses_gl_fragcoord to gl_shaderTimothy Arceri2017-01-191-1/+1
| | | | | | | This is only used by gl_linked_shader as a temp during linking so use a temp there instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move redeclares_gl_fragcoord to gl_shaderTimothy Arceri2017-01-191-1/+2
| | | | | | | This is never used in gl_linked_shader other than as a temp during linking so just use a temp instead. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move ARB_fragment_coord_conventions_enable fieldTimothy Arceri2017-01-191-1/+2
| | | | | | | This is only used by gl_shader not gl_linked_shader so move it there. Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa/glsl: set early_fragment_tests directly in shader_infoTimothy Arceri2017-01-193-8/+7
| | | | | | | We also move EarlyFragmentTests out of the gl_shader_info struct as it is now only used by gl_shader. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl/i965: set and use tcs vertices_out directlyTimothy Arceri2017-01-192-9/+3
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: get outputs_written from gl_programTimothy Arceri2017-01-191-2/+2
| | | | | | | There is no need to go via the pointer in nir_shader. This change is required for the shader cache as we don't create a nir_shader. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: don't always set _NEW_PROGRAM when linkingTimothy Arceri2017-01-191-1/+22
| | | | | | | | | | | | We only need to set it when linking was successful and the program being linked is currently active. The programs_in_use mask is just used as a flag for now but in a future change we will use it to update the CurrentProgram array. V2: make sure to flush vertices before linking (suggested by Marek) Reviewed-by: Marek Olšák <[email protected]>
* mesa: change init subroutine defaults helper to work per gl_programTimothy Arceri2017-01-193-24/+20
| | | | | | | A later patch will result in SSO programs calling this helper per gl_program rather than per gl_shader_program. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/glsl: move ProgramResourceList to gl_shader_program_dataTimothy Arceri2017-01-194-46/+53
| | | | | | | | | | We also move NumProgramResourceList at the same time. GLES does interface validation on SSO at runtime so we need to move this to be able to switch to storing gl_program pointers in CurrentProgram. Reviewed-by: Lionel Landwerlin <[email protected]>
* glsl: store number of explicit uniform loactions in gl_shader_programTimothy Arceri2017-01-191-0/+5
| | | | | | | | | This allows us to cleanup the functions that pass this count around, but more importantly we will be able to call the uniform linking functions from that backends linker without having to pass this information to the backend directly via Driver.LinkShader(). Reviewed-by: Kenneth Graunke <[email protected]>
* i965/blorp: Make post draw flush more explicitTopi Pohjolainen2017-01-182-5/+22
| | | | | | | | | | | | | Blits do not need any special treatment as the target buffer object is added to render cache just as one does for normal draw. Color clears and resolves in turn require explicit "end of pipe synchronization". It is not clear what this means exactly but the assumption is that render cache flush with command stream stall should be sufficient. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/gen6: Issue direct depth stall and flush after depth clearTopi Pohjolainen2017-01-181-1/+6
| | | | | | | | | | | | | | | | | | instead of calling unconditionally brw_emit_mi_flush() which does: brw_emit_pipe_control_flush(brw, PIPE_CONTROL_DEPTH_CACHE_FLUSH | PIPE_CONTROL_RENDER_TARGET_FLUSH | PIPE_CONTROL_CS_STALL); brw_emit_pipe_control_flush(brw, PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE | PIPE_CONTROL_CONST_CACHE_INVALIDATE); Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Make depth clear flushing more explicitTopi Pohjolainen2017-01-182-8/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Current blorp logic issues unconditional "flush everything" (see brw_emit_mi_flush()) after each render. For example, all blits issue this unconditionally which shouldn't be needed if they set render cache properly so that subsequent renders do necessary flushing before drawing. In case of piglit: ext_framebuffer_multisample-accuracy all_samples depth_draw small intel_hiz_exec() is always preceded by blorb blit and the unconditional flush looks to hide the lack of stall and flushes in depth clears. By removing the brw_emit_mi_flush() I get gpu hangs. This patch adds the stalls and flushes mandated by the spec and gets rid of those hangs. v2 (Jason, Ken): Document the rational for separating depth cache flush and stall on Gen7. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>