aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.Eric Anholt2014-02-224-4/+10
| | | | | | | | Note that this requires updated run.py in shader_db. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Use the object label when available for shader_time output.Eric Anholt2014-02-221-5/+8
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* meta: Set some object labels on our meta shaders.Eric Anholt2014-02-222-0/+14
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* Revert "i965/fs: Make fs_reg's type an enum for better debugging."Matt Turner2014-02-214-7/+6
| | | | | | | | This reverts commit 5ceadd29b0af835d741bcf09b9622c628e549ae6. I rebased and apparently failed to build test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75355
* i965/fs: Drop the emit(fs_inst) overload.Kenneth Graunke2014-02-213-25/+17
| | | | | | | | | | | | | | | | | | | | Using this emit function implicitly creates three copies, which is pointlessly inefficient. 1. Code creates the original instruction. 2. Calling emit(fs_inst) copies it into the function. 3. It then allocates a new fs_inst and copies it into that. The second could be eliminated by changing the signature to fs_inst(const fs_inst &) but that wouldn't eliminate the third. Making callers heap allocate the instruction and call emit(fs_inst *) allows us to just use the original one, with no extra copies, and isn't much more of a burden. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965/fs: Pass fs_regs by constant reference where possible.Matt Turner2014-02-213-14/+19
| | | | | | | | These functions (modulo emit_lrp, necessitating the small fix-up) pass these arguments by value unmodified to other functions. No point in making an additional copy. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Move setting opcode = NOP to its one useful location.Matt Turner2014-02-211-1/+1
| | | | | | All other callers of init() immediately set opcode to something else. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Use a bitfield for fs_inst's bool fields.Matt Turner2014-02-211-7/+7
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Reorder fs_inst's fields for better packing.Matt Turner2014-02-211-9/+11
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Reduce the sizes of some fs_inst members.Matt Turner2014-02-211-6/+6
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Reorder fs_reg for better packing.Matt Turner2014-02-211-15/+15
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Make fs_reg's type an enum for better debugging.Matt Turner2014-02-214-6/+7
| | | | | | Since the enum is marked as packed, it'll still take only one byte. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Reduce the sizes of some fs_reg members.Matt Turner2014-02-211-3/+3
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Mark brw_reg_type and register_file enums as PACKED.Matt Turner2014-02-212-2/+4
| | | | | | | | | | | | | | | | | | | The C99 spec says the type of an enum is implementation defined (but can be char, signed int, or unsigned int). gcc appears to always give enums four bytes, even when they can fit in less. It does so because this is what other compilers seem to do [0] and therefore to maintain ABI compatibility with them. gcc has an -fshort-enum flag that tells the compiler to use only as much space as needed for an enum. Adding __attribute__((__packed__)) to an enum definition has the same behavior, but on a per-enum basis. brw_reg_type and register_file are not part of the ABI, so we can safely mark them as PACKED so that they'll take only a byte, rather than four. [0] http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#index-fshort-enums-3868 Acked-by: Kenneth Graunke <[email protected]>
* i965: Reduce predicate field of backend_instruction to uint8_t.Matt Turner2014-02-211-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move declarations before code.Vinson Lee2014-02-211-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes these MSVC build errors. Compiling src\mesa\drivers\common\meta_blit.c ... meta_blit.c src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before 'type' src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ')' before 'type' src\mesa\drivers\common\meta_blit.c(255) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(255) : warning C4552: '<' : operator has no effect; expected operator with side-effect src\mesa\drivers\common\meta_blit.c(255) : error C2059: syntax error : ')' src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before '{' src\mesa\drivers\common\meta_blit.c(258) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before 'type' src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ')' before 'type' src\mesa\drivers\common\meta_blit.c(263) : error C2065: 'step' : undeclared identifier src\mesa\drivers\common\meta_blit.c(263) : warning C4552: '<=' : operator has no effect; expected operator with side-effect src\mesa\drivers\common\meta_blit.c(263) : error C2059: syntax error : ')' src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before '{' src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before 'type' src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ')' before 'type' src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(264) : warning C4552: '<' : operator has no effect; expected operator with side-effect src\mesa\drivers\common\meta_blit.c(264) : error C2059: syntax error : ')' src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'step' : undeclared identifier src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before '{' src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'step' : undeclared identifier src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'step' : undeclared identifier src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'step' : undeclared identifier src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'i' : undeclared identifier src\mesa\drivers\common\meta_blit.c(559) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data src\mesa\drivers\common\meta_blit.c(723) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data src\mesa\drivers\common\meta_blit.c(773) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data Signed-off-by: Vinson Lee <[email protected]>
* meta: Eliminate samplers[] array in favor of using vec4_prefix.Kenneth Graunke2014-02-211-10/+2
| | | | | | | | | | | | | We don't need an array mapping the shader index to "sampler2DMS", "isampler2DMS", and so on. We can simply do "%ssampler2DMS" and pass in vec4_prefix, which is "", "i", or "u". This eliminates the use of C99 array initializers and should fix the MSVC build. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75344 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Delete the fabulous target_to_target() function.Kenneth Graunke2014-02-211-19/+2
| | | | | | | | | | | | | | | | gl_texture_object's Target field is never a cube face enumeration, so target_to_target is just the identity function. Aptly named, at least. I verified this by putting an assert(!"ZOMG, CUBES!") in the cube face case, and running Piglit. Nothing ever hit it. Beyond that, I inspected the code in mesa/main. This could probably also be deleted from i915, but I haven't tested there. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix S8 and X8 reversal in brw_depthbuffer_format refactor.Kenneth Graunke2014-02-211-3/+3
| | | | | | | | | | | | | | In commit 09d9a8913e8c28fc4c1c60d7da85a2f093786894, I accidentally botched the X8 and S8 cases. (I wrote this patch before realizing that X8 and S8 had been swapped in the big MESA_FORMAT rename, and apparently didn't rebase it properly after fixing that...) Fixes regressions in 13 Piglit tests on Ironlake. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75291 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Move declarations before code.Vinson Lee2014-02-211-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes these MSVC build errors introduced with 73b78f9c9f86dd38fb165f4730aeac9519635b07. Compiling src\mesa\main\uniforms.c ... uniforms.c src\mesa\main\uniforms.c(291) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(294) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(294) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(294) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(306) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(309) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(309) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(309) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(322) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(325) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(325) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(325) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(345) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(348) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(348) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(348) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(360) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(363) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(363) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(363) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(376) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(379) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(379) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(379) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(588) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(591) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(591) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(591) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(603) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(606) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(606) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(606) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(619) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(622) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(622) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(622) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 Signed-off-by: Vinson Lee <[email protected]>
* scons: Add main/pipelineobj.c to src/mesa/SConscript.Vinson Lee2014-02-211-0/+1
| | | | | | | | | This patch fixes this SCons build error. build/linux-x86_64-debug/mesa/libmesa.a(context.os): In function `init_attrib_groups': src/mesa/main/context.c:815: undefined reference to `_mesa_init_pipeline' Signed-off-by: Vinson Lee <[email protected]>
* mesa/sso: Fix typo of 'unsigned'.Vinson Lee2014-02-211-1/+1
| | | | | | | | | | | | Fix build error introduced with commit f4c13a890fa24ff1f998e7cac0ecc31505a29403. CC pixeltransfer.lo main/pipelineobj.c: In function '_mesa_delete_pipeline_object': main/pipelineobj.c:59:4: error: unknown type name 'unsinged' unsinged i; ^ Signed-off-by: Vinson Lee <[email protected]>
* mesa/sso: Implement _mesa_GetProgramPipelineivGregory Hainaut2014-02-211-0/+58
| | | | | | | | | | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. v2 (idr): * Trivial reformatting. * Remove GL_COMPUTE_SHADER. Compute shaders don't participate in pipeline objects anyway. Suggested by Matt Turner. v3 (idr): * Use _mesa_has_geometry_shaders. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_ActiveShaderProgramGregory Hainaut2014-02-211-0/+28
| | | | | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. v2 (idr): Return early from _mesa_ActiveShaderProgram if _mesa_lookup_shader_program_err returns an error. Suggested by Jordan. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> [v2]
* mesa/sso: Implement _mesa_CreateShaderProgramvGregory Hainaut2014-02-211-1/+6
| | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXTGregory Hainaut2014-02-211-8/+18
| | | | | | | | | | | This will allow the guts of the implementation to be shared with _mesa_CreateShaderProgramv. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add support for GL_PROGRAM_SEPARABLE queryGregory Hainaut2014-02-212-0/+31
| | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_IsProgramPipelineGregory Hainaut2014-02-212-1/+9
| | | | | | | | | | Implement IsProgramPipeline based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_GenProgramPipelinesGregory Hainaut2014-02-211-0/+30
| | | | | | | | | | Implement GenProgramPipelines based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_DeleteProgramPipelinesGregory Hainaut2014-02-211-0/+33
| | | | | | | | | | Implement DeleteProgramPipelines based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add pipeline container/stateGregory Hainaut2014-02-214-3/+206
| | | | | | | | | | | | | | | | | | | | | | | | | V1: * Extend gl_shader_state as pipeline object state * Add a new container gl_pipeline_shader_state that contains binding point of the previous object * Update mesa init/free shader state due to the extension of the attibute * Add an init/free pipeline function for the context V2: * Rename gl_shader_state to gl_pipeline_object * Rename Pipeline.PipelineObj to Pipeline.Current * Formatting improvement V3 (idr): * Split out from previous uber patch. * Remove '#if 0' debug printfs. V4 (idr): * Fix some errors in comments. Suggested by Jordan. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add a mutex and refcounting to gl_shader_stateGregory Hainaut2014-02-212-0/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Make get_shader_flags publicly availableGregory Hainaut2014-02-212-3/+6
| | | | | | | | | | Future patches will use this function outside shaderapi.c. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add extension entry points for GL_ARB_separate_shader_objectsGregory Hainaut2014-02-218-43/+746
| | | | | | | | | | | | | | | | | | | | | | | | | Nothings implemented yet but glProgramUniform* which are mostly a copy/paste of the older function glUniform* I create dedicated pipelineobj.[ch] file that will contains function related to the "new" pipeline container object. V2: formatting improvement V3: * indentation fix * Update copyright * Add a comment on ProgramParameteri already present in another extension * Remove TODO, will be readded on correct patch V4 (idr): * Fix dispatch_sanity unit test * Make extension string available in core profiles (instead of just compatibility). * Trivial reformating Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add extension tracking for ARB_separate_shader_objectsIan Romanick2014-02-212-0/+2
| | | | | | | This adds the necessary bits for both the API and the GLSL compiler. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Refactor per-stage link check to its own functionIan Romanick2014-02-211-68/+34
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Stop throwing away our double precision for time calculations.Eric Anholt2014-02-213-4/+4
| | | | | | Fixes negative times being reported in our perf debug. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for integer blits.Eric Anholt2014-02-212-7/+71
| | | | | | | | Compared to i965, the code generated doesn't use the AVG instruction. But I'm not sure that multisampled integer resolves are really that important to worry about. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for doing MSAA to MSAA blits.Eric Anholt2014-02-212-49/+104
| | | | | | | These are non-stretched, non-resolving blits, so it's just a matter of sampling once from our gl_SampleID and storing that to our color/depth. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Save and restore a bunch of MSAA state.Eric Anholt2014-02-212-4/+38
| | | | | | | | | | We're disabling GL_MULTISAMPLE, so we didn't need to worry about a lot of that state. But to do MSAA to MSAA blits, we need to start handling more state. v2: Fix pasteo caught by Kenneth. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Try to do blending of sRGB values in linear colorspace.Eric Anholt2014-02-211-5/+25
| | | | | | | Blending of values would occur when doing GL_LINEAR filtering with scaling, and in an upcoming commit when doing MSAA resolves. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for doing multisample resolves.Eric Anholt2014-02-212-12/+197
| | | | | | | | | Note that this doesn't handle GL_EXT_multisample_scaled_blit yet. The i965 code for that extension bakes in knowledge of the sample positions (well, knowledge of the sample positions aligned to a lower-resolution grid), which we would have to do at runtime somehow for meta. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix miptree matching for multisampled, non-interleaved miptrees.Eric Anholt2014-02-212-1/+16
| | | | | | | | We haven't been executing this code before the meta-blit case, because we've been flagging the miptree as validated at texstorage time, and never having to revalidate. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary condition.Courtney Goeltzenleuchter2014-02-211-2/+1
| | | | | | | | | Identified by Valgrind memory check. Initialized block-opaque in a different patch. This test seems unnecessary. If opaque must be true, just set to true. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Courtney Goeltzenleuchter <[email protected]>
* i965/fs: Implement FS_OPCODE_[UN]PACK_HALF_2x16_SPLIT[_XY] opcodes.Kenneth Graunke2014-02-202-2/+81
| | | | | | | | | | | | I'd neglected to port these to Broadwell. Most of this code is copy and pasted from Gen7, but instead of using F32TO16/F16TO32, we just use MOV with HF register types. Fixes fs-packHalf2x16 and fs-unpackHalf2x16 tests (both the ARB extension and ES 3.0 variants). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Drop bogus F32TO16/F16TO32 instructions on Broadwell - use MOV.Kenneth Graunke2014-02-203-6/+6
| | | | | | | | | | | | | | | Broadwell removed the F32TO16 and F16TO32 instructions. However, it has actual support for HF values, so they're actually just MOV. Fixes vs-packHalf2x16 and vs-unpackHalf2x16 tests (both the ARB extension and ES 3.0 variants). v2: Emulate F32TO16's align16 zeroing bug, since Chad's front end code relies on it happening. We can probably refactor this code to be better later. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Create a hardware context before initializing state module.Kenneth Graunke2014-02-201-6/+6
| | | | | | | | | | | | | | | | | | | | | brw_init_state() calls brw_upload_initial_gpu_state(). If hardware contexts are enabled (brw->hw_ctx != NULL), this will upload some initial invariant state for the GPU. Without hardware contexts, we rely on this state being uploaded via atoms that subscribe to the BRW_NEW_CONTEXT bit. Commit 46d3c2bf4ddd227193b98861f1e632498fe547d8 accidentally moved the call to brw_init_state() before creating a hardware context. This meant brw_upload_initial_gpu_state would always early return. Except on Gen6+, we stopped uploading the initial GPU state via state atoms, so it never happened. Fixes a regression since 46d3c2bf4ddd227193b98861f1e632498fe547d8. Cc: "10.0 10.1" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Implement scratch read/write support for Broadwell.Kenneth Graunke2014-02-201-9/+109
| | | | | | | | | | | | | | To make sure that both the Gen4 and Gen7 style messages work, I initially disabled the SHADER_OPCODE_GEN7_SCRATCH_READ optimization, ran Piglit, re-enabled it, and ran Piglit again. Both worked fine. Fixes 40 Piglit tests (most of the varying-packing category). v2: Move num_regs assertion from gen8_fs_generator to gen8_set_dp_scratch_message() (suggested by Eric). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add Gen8 assembly support for DP Scratch messages.Kenneth Graunke2014-02-202-0/+47
| | | | | | | | | | The new accessors will make it easy to do Gen7-style scratch messages. v2: Move num_regs assertion from gen8_fs_generator into gen8_set_dp_scratch_message() (suggested by Eric). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Store absolute thread count in max_wm_threads on Broadwell.Kenneth Graunke2014-02-202-2/+5
| | | | | | | | | | | | | | | | | | In the past, 3DSTATE_PS took an absolute number of threads. Conversely, on Broadwell you always program 64, and it implicitly scales based on the GT-level with no special programming. So, I stored 64 in brw_device_info::max_wm_threads. However, I didn't realize that we also use max_wm_threads to compute the size of the scratch space buffer. In that case, we really need the absolute number of threads. This patch hardcodes 3DSTATE_PS to use the value it expects, and changes max_wm_threads back to a (completely fake) absolute thread count (once again copied from Haswell). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>