summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Track changed.texture only for stateblocksAxel Davy2016-12-205-10/+4
| | | | | | | | Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Move draw calls to nine_stateAxel Davy2016-12-209-251/+388
| | | | | | | | | | | | Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. v2: Release buffers for Draw*Up functions in device9.c, instead of nine_context. This prevents a leak with csmt where the wrong pointers were released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Move core of device clear to nine_stateAxel Davy2016-12-203-141/+160
| | | | | | | | Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Introduce nine_contextAxel Davy2016-12-207-148/+163
| | | | | | | | | | | nine_context is a new structure which goal will be to contain all internal states. It will be the states of the second thread in the to-be-introduced CSMT mode. This patch moves several internal states to nine_context, while the next patches add the other fields. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement WFOG properlyAxel Davy2016-12-201-7/+35
| | | | | | | | We were advertising support for WFOG (like all win drivers), but we weren't implementing it. This patch implements the behaviour. See comments. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ff texture coordinate selectionAxel Davy2016-12-201-4/+5
| | | | | | | | The code was wrongly detecting which texture coordinates to generate when the coordinate index was different to the stage index. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Convert redundant check to assert in ff psAxel Davy2016-12-201-2/+3
| | | | | | We disable the alpha stage if the color stage is disabled. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix two special cases in ff psAxel Davy2016-12-201-0/+20
| | | | | | | | | | if first alpha stage is disabled and writes to temp, diffuse alpha is written to temp. Last stage always writes to current. Behaviour was deduced by tests with a test app. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove useless code in ff psAxel Davy2016-12-201-5/+0
| | | | | | Current is already initialized to Diffuse. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ff cases when stages should be disabledAxel Davy2016-12-201-6/+16
| | | | | | | | | | When a texture is read by a stage for colorop, it should be disabled, and disable following stages. When a texture is read for alphaop, 1.0f is read for the input, which is the behaviour for a dummy texture. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Always initialize current in ff psAxel Davy2016-12-201-24/+1
| | | | | | | The check was not catching all possible cases. NVE4 should be fine. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix check for ff specularAxel Davy2016-12-201-2/+7
| | | | | | | | | Fix the check for computing ff specular. This seems to match the opengl behavior, and give the correct output on windows. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not saturate illumination coefficients in ffAxel Davy2016-12-201-4/+0
| | | | | | | Fixes bad rendering of a test app. Wine has the same behaviour. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ff COLOR0 w component computationAxel Davy2016-12-201-21/+10
| | | | | | | | | | The computation was wrong. COLOR0's last component should be equal to the material diffuse w component. The behaviour was checked with a test app on Windows. Wine has the same behaviour. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix specular enable for alphaAxel Davy2016-12-201-1/+1
| | | | | | | | | | | Apparently specular enable doesn't affect the alpha channel. Fixes https://github.com/iXit/Mesa-3D/issues/253 Behaviour comfirmed looking in wine sources. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Ignore MULTISAMPLEMASK when RT is not multisampledAxel Davy2016-12-202-3/+3
| | | | | | | | | We were ignoring MULTISAMPLEMASK for non-maskable multisample modes, but we were missing the non-multisampled case. Fixes a crash in Halo. Signed-off-by: Axel Davy <[email protected]>
* driconf: Fix missing gettextAxel Davy2016-12-201-1/+1
| | | | | | | DRI_CONF_NINE_OVERRIDEVENDOR was missing gettext for the description. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add new driconf options to control DISCARD behaviourAxel Davy2016-12-204-2/+31
| | | | | | See the patch for the new controls added. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework buffer presentation pathAxel Davy2016-12-201-48/+132
| | | | | | Use the new API for DISCARD. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix a leak in Swapchain dtorAxel Davy2016-12-202-16/+16
| | | | | | | | Count properly the number of backbuffers, and use the new info to release the correct number of buffers Signed-off-by: Axel Davy <[email protected]>
* st/nine: Silent warnings with guid_strAxel Davy2016-12-203-0/+12
| | | | | | | In non-debug build, the variables are unused, and thus trigger a compilation warning. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not generate gallium NOP on d3d NOPAxel Davy2016-12-201-1/+8
| | | | | | | Some drivers crash if NOP is generated. Besides there is no point to generate NOP. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix leak in user constant upload pathAxel Davy2016-12-202-29/+39
| | | | | | | The new code properly releases the previous buffers allocated. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Correctly release sw cursor imageAxel Davy2016-12-201-0/+1
| | | | | | | cursor.image is used for software cursor emulation. It wasn't released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Handle when cursor stride is not what is expectedAxel Davy2016-12-202-2/+19
| | | | | | | | SetCursor assumes for now a 32x32 argb cursor with pitch 128. 32x32 argb doesn't have pitch 128 on all hw, thus use a temporary surface with the correct pitch when needed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid crash on empty Draw*UpAxel Davy2016-12-201-0/+2
| | | | | | | | Ignore empty draw calls. Avoid assertion fault when such draw calls happen in u_upload_mgr. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Capture texturestage states in pixel stateblocksAxel Davy2016-12-201-1/+4
| | | | | | pixels stateblocks need to capture these. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add missing changed states to pixel stateblocksAxel Davy2016-12-201-1/+4
| | | | | | Some states were not properly recorded in pixel stateblocks. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add some debug info in stateblocksAxel Davy2016-12-201-0/+5
| | | | | | This is useful to check what is exactly recorded. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove useless check in surface9 ctorAxel Davy2016-12-201-4/+0
| | | | | | | Textures already have the check in BaseTexture9. Non-Textures cannot be in the MANAGED Pool. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix bad light initialization in stateblocksAxel Davy2016-12-201-2/+2
| | | | | | src was initialized instead of dst. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove unused ff.changed.groupAxel Davy2016-12-202-6/+0
| | | | | | It was unused. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ps multisample checkAxel Davy2016-12-201-1/+1
| | | | | | | We want to use centroid for nonmaskable multisampling as well. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix useless swapchain init checksAxel Davy2016-12-201-14/+7
| | | | | | | In NineDevice9_SetDefaultState we can assume the implicit swapchain is properly initialized. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Don't update stream_usage_mask in sw pathAxel Davy2016-12-201-2/+0
| | | | | | The variable is used only in the hw path. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove useless call to nine_update_stateAxel Davy2016-12-201-1/+0
| | | | | | The call was not needed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add validation to SetSamplerStateAxel Davy2016-12-205-3/+48
| | | | | | Check value validity and mimick Win behaviour. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Improve doc of D3DPMISCCAPS_POSTBLENDSRGBCONVERTAxel Davy2016-12-201-1/+1
| | | | | | | | | | The cap should be advertised for d3d10 able cards, but only for Ex contexts. Unfortunately at this point Mesa has no way to know if Ex is used or not (the info is got later). Signed-off-by: Axel Davy <[email protected]>
* gallium-docs: Add documentation for when using several contextsAxel Davy2016-12-201-0/+23
| | | | | | | | Add documentation to explicit what can be expected and what is allowed when using several contexts. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium-docs: Add documentation for threading requirementsAxel Davy2016-12-201-0/+10
| | | | | | | | Add documentation for the requirements related to threading for screens and contexts. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Check config's surface types in eglCreate*Surface()Chad Versace2016-12-201-0/+10
| | | | | | | | | | | If the provided EGLConfig does not support the requested surface type, then emit EGL_BAD_MATCH. Fixes dEQP-EGL.functional.negative_api.create_pbuffer_surface on GBM. Cc: "13.0" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl: Use ir_var_temporary when generating inline functions.Kenneth Graunke2016-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | We were using ir_var_auto for the inlined function parameter variables, which is wrong, as it suggests that those are real variables declared by the program. Normally this doesn't matter. However, if you called built-ins at global scope, it would pollute the global variable namespace with these new parameter temporaries. If the shader already had variables with those names, the linker might see contradictory global variable declarations and raise an error. Making them temporaries indicates that these are just things generated by the compiler internally. This avoids confusing the linker. Fixes a new Piglit test: glsl-fs-multiple-builtins. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99154 Reported-by: Niels Ole Salscheider <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Don't bail on vertex element processing if we need draw params.Kenneth Graunke2016-12-201-17/+17
| | | | | | | | | | | | | | | BaseVertex, BaseInstance, DrawID, and some edge flag conditions need vertex buffer and elements structs. We can't bail early in this case. Gen4-7 already do this properly. Gen8+ did not. Thanks to Ilia Mirkin for helping track this down. Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99144 Reported-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[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]>
* glsl: allow invariant on fragment shader outputs.Dave Airlie2016-12-201-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From page 27 (page 33 of the PDF) of the GLSL 1.20 spec: " Only variables output from a vertex shader can be candidates for invariance." But this later changes to: From page 37 (page 43 of the PDF) of the GLSL 1.30 spec: " Only variables output from a shader can be candidates for invariance." We can also find: From page 37 (page 43 of the PDF) of the GLSL 1.30 spec: " Initially, by default, all output variables are allowed to be variant. To force all output variables to be invariant, use the pragma #pragma STDGL invariant(all) before all declarations in a shader. If this pragma is used after the declaration of any variables or functions, then the set of outputs that behave as invariant is undefined. It is an error to use this pragma in a fragment shader." But this needs to be corrected and it is being addressed at: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16140 Fixes GL45-CTS.shading_language_420pack.qualifier_order. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* i965: keep gl_program shader info in sync after gather infoTimothy Arceri2016-12-202-2/+11
| | | | | | | | | | It's possible that nir_shader was cloned and it no longer contains a pointer to the shader_info in gl_program. So we need to copy shader_info back to gl_program if that is the case. Fixes a regression with NIR_TEST_CLONE=true Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98840
* nir: Trivial clean ups in the generated nir_constant_expressions.cIan Romanick2016-12-191-6/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Silence unused parameter warnings in nir_constant_expression.cIan Romanick2016-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | nir/nir_constant_expressions.c:290:25: warning: unused parameter 'num_components' [-Wunused-parameter] evaluate_ball3(unsigned num_components, nir_const_value *_src) ^ nir/nir_constant_expressions.c: In function 'evaluate_fddx': nir/nir_constant_expressions.c:1282:57: warning: unused parameter '_src' [-Wunused-parameter] evaluate_fddx(unsigned num_components, nir_const_value *_src) ^ v2: Unconditionally mark the parameters as MAYBE_UNUSED instead of conditionally adding (void) casts to keep the generator simple. Suggested by Jason. Number of total warnings in my build reduced from 1575 to 1485 (reduction of 89). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Silence missing field initializer warnings for vectors in ↵Ian Romanick2016-12-191-0/+3
| | | | | | | | | | | | | | | | | | | | | nir_constant_expressions nir/nir_constant_expressions.c: In function 'evaluate_ball2': nir/nir_constant_expressions.c:279:7: warning: missing initializer for field 'z' of 'struct bool_vec' [-Wmissing-field-initializers] }; ^ nir/nir_constant_expressions.c:234:10: note: 'z' declared here bool z; ^ Number of total warnings in my build reduced from 2532 to 2304 (reduction of 228). v2: Initialize bool vectors with 0 instead of false to keep the generator simpler. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Silence "unused parameter" warnings in ast_type.cppIan Romanick2016-12-191-6/+4
| | | | | | | | | | | | | | glsl/ast_type.cpp: In function ‘bool validate_point_mode(YYLTYPE*, _mesa_glsl_parse_state*, const ast_type_qualifier&, const ast_type_qualifier&)’: glsl/ast_type.cpp:173:30: warning: unused parameter ‘loc’ [-Wunused-parameter] validate_point_mode(YYLTYPE *loc, ^~~ glsl/ast_type.cpp:174:45: warning: unused parameter ‘state’ [-Wunused-parameter] _mesa_glsl_parse_state *state, ^~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Andres Gomez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>