aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Make the drivers call a non-code-generated dispatch table setup.Eric Anholt2013-01-2110-10/+10
| | | | | | | I want to drive the Save dispatch table setup from this same function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove the dead PrepareExecBegin() driver hook.Eric Anholt2013-01-211-1/+0
| | | | | | | This was used in i965 for a while, but no more. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* scons: Fix dependencies of generated headers.José Fonseca2013-01-212-5/+2
| | | | | | | | | | | | | | It appears that scons implicit dependency scanners fail to chain dependencies of generated headers when these are outside the build tree. This patch ensures generated source files are _always_ put in the build tree. I'm not 100% this will fix all depency issues, but from my experiments it does seem to fix this. NOTE: For this to be effective it is necessary to clean the source tree from generated header/source files. Reviewed-by: Brian Paul <[email protected]>
* intel: Don't expose XRGB8888 visuals any moreIan Romanick2013-01-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There really isn't any point. There is no resource savings, and we have to do gymnastics in the driver to make it work. There are also bad interactions with multisampling and OpenGL ES 3.0. In ES3, a multisample-to-singlesample blit must have identical source and destination format. This means a multisample RGBA8 to singlesample RGB8 (window) blit will generate an error. Also in ES3, RGB8 is not a renderable format. This means that the application CANNOT make an RGB8 multisample renderbuffer. As a result, if an application gets an RGB8 window and wants to do multisample FBO rendering, it will probably break. "Fixes" gles3conform framebuffer_blit_functionality_multisampled_to_singlesampled_blit test on RGB8 visuals. v2: Fix 'formats' array size. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* i965: Enable floating-point textures alwaysIan Romanick2013-01-212-20/+5
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* xmlpool/build: generate options.h via BUILT_SOURCESMatt Turner2013-01-201-1/+1
| | | | | | | Fixes missing options.h when doing 'make check' in dri/common before 'make' has been run. Reviewed-by: Andreas Boll <[email protected]>
* intel: Enable GL_OES_depth_texture_cube_mapIan Romanick2013-01-201-0/+1
| | | | | | | | | | For now I'm just enabling this on the same subset of hardware that has OpenGL 3.0 enabled. This same functionality is part of OpenGL 3.0, and there is no matching desktop extension. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for GL_ARB_texture_buffer_object_rgb32.Eric Anholt2013-01-181-0/+1
| | | | | | Tested with piglit ARB_texture_buffer_object/formats. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for MESA_FORMAT_RGB_FLOAT32 surfaces.Eric Anholt2013-01-181-1/+1
| | | | | | | | | This is for GL_ARB_texture_buffer_object_rgb32 support, but it also causes the format to get used for float32 rgb textures as well on Ironlake and later. Since that came with some surprises, separate the change from the enable commit. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Make intel_region's pitch be bytes instead of pixels.Eric Anholt2013-01-1821-77/+67
| | | | | | | | | | | | We almost never want a stride in pixels -- if you're doing anything with a stride, you're specifying an offset or incrementing a pointer, and in both cases you had to multiply by cpp to get the bytes value you wanted. But worse, on the way to creating a region from a new tiled BO, we divided by cpp to get pitch in pixels, and for an RGB32 buffer (an upcoming change) the pitch wouldn't divide exactly, and we'd end up with a wrong stride in our region. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Make intel_blit.c take pitches in bytes.Eric Anholt2013-01-188-19/+15
| | | | | | As we gain support for NPOT cpp, a pitch may not divide by cpp cleanly. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Store texturing results into a vec4 temporary.Kenneth Graunke2013-01-181-6/+7
| | | | | | | | | | | | | | | | The sampler appears to ignore writemasks (even when correcting the WRITEMASK_XYZW in brw_vec4_emit.cpp to the proper writemask) and just always writes all four values. To cope with this, just texture into a temporary, then MOV out into a register that has the proper number of components. NOTE: This is a candidate for stable branches. Fixes es3conform's shadow_execution_vert.test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Set LOD to 0 for ordinary texture() calls.Kenneth Graunke2013-01-181-2/+5
| | | | | | | | | Previously it was left undefined, causing us to select a random LOD. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.Kenneth Graunke2013-01-181-5/+8
| | | | | | | | | | This is purely a refactor. However, in a moment, we'll want to set lod_type to float for ir_tex, where ir->lod_info.lod is NULL. NOTE: This is a candidate for stable branches (for the next patch). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.Kenneth Graunke2013-01-181-6/+9
| | | | | | | | | | | | | | | | | Fixes regressions since commit 899017fc54c40c969b5239b33f3a17b311878b0d Author: Kenneth Graunke <[email protected]> Date: Fri Jan 4 07:53:09 2013 -0800 i965: Use Haswell's sample_d_c for textureGrad with shadow samplers. That patch assumed that all instances were lowered. However, we weren't lowering textureGrad() with samplerCubeShadow because I couldn't figure out the LOD calculations. It turns out they're easy: you just have to use 1 for the depth. This causes it to pass oglconform's four tests. Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Anuj Phogat <[email protected]> Tested-by: Ian Romanick <[email protected]>
* meta: add 'f' suffix to floats to silence some MSVC warningsBrian Paul2013-01-161-1/+1
|
* intel: Enable GL_ARB_internalformat_queryIan Romanick2013-01-152-0/+24
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add driver method to determine the possible sample countsIan Romanick2013-01-151-0/+1
| | | | | | | | | | | | | | Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and GL_NUM_SAMPLE_COUNTS. v2: internalFormat may not be color renderable by the driver, so zero can be returned as a sample count. Require that drivers supporting the extension provide a QuerySamplesForFormat function. The later was suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* meta: Move loop variable declaration outside for loop.Vinson Lee2013-01-151-1/+2
| | | | | | Fixes build with MSVC. Signed-off-by: Vinson Lee <[email protected]>
* intel: Support blitting to multiple color draw buffersAnuj Phogat2013-01-152-34/+63
| | | | | | | | | | | | | | | This patch enables blitting to multiple color attachments of a framebuffer. It also fixes a case when blitting to a framebuffer with renderbuffer/texture attached to non-zero attachment point i.e. GL_COLOR_ATTACHMENT{1, 2, ...}. Earlier we were incorrectly blitting to GL_COLOR_ATTACHMENT0 by default. V2: Use intel_copy_texsubimage() for blitting only if all the color attachments can blit using it. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: Add functionality to do _mesa_meta_BlitFrameBuffer() using glslAnuj Phogat2013-01-151-93/+344
| | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites _mesa_meta_BlitFrameBuffer() function to add support for blitting with GLSL/GLSL ES shaders. These changes were required to support glBlitFrameBuffer() in gles3. This patch, along with other patches in this series, make 16 failing framebuffer_blit test cases in gles3 conformance pass. V2: Properly handle flipped blits for source and destination renderbuffer / textures. Add support for GL_TEXTURE_RECTANGLE in _mesa_meta_BlitFrameBuffer. Create a temp depth texture to support depth buffer blitting. V3: Remove unsupported / redundant shader code. Add an assertion to make sure that we don't use rectangle texture in ES. Put API guard on glTexEnvi(). V4: For gles3: Don't use ReadPixels or CopyTexImage2D to blit depth buffer. gles3 spec says for CopyTexImage2D that "color buffer components can be dropped during the conversion to internalformat, but new components cannot be added." So, use the internal format of read renderbuffer to create texture for color buffer blitting. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Expose support for DRI_API_GLES3Chad Versace2013-01-151-0/+2
| | | | | | | | | If the hardware/driver combo supports GLES3, then set the GLES3 bit in intel_screen's bitmask of supported DRI API's. Neither the EGL nor GLX layer uses the bit yet. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* dri: Define enum __DRI_API_GLES3Chad Versace2013-01-152-0/+2
| | | | | | | | | | | | | | This enum corresponds to EGL_OPENGL_ES3_BIT_KHR. Neither the GLX nor EGL layer use the enum yet. I don't like the GLES bits. I'd prefer that all GLES APIs be exposed through a single API bit, as is done in GLX_EXT_create_context_es_profile. But, we need this GLES3 enum in order to do the plumbing necessary to correctly support EGL_OPENGL_ES3_BIT_KHR as required by the EGL_KHR_create_context spec. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move validation of context version into intelInitContextChad Versace2013-01-157-105/+100
| | | | | | | | | | | | | | | | | | | | | Each driver (i830, i915, i965) used independent but similar code to validate the requested context version. With the rececnt arrival of GLES3, that logic has needed an update. Rather than apply identical updates to each drivers validation code, let's just move the validation into the shared routine intelInitContext. This refactor required some incidental changes to functions i830CreateContext and intelInitContext. For each function, this patch: - Adds context version parameters to the signature. - Adds a DRI_CTX_ERROR out param to the signature. - Sets the DRI_CTX_ERROR at each early return. Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Set screen's api mask according to hw capabilities (v3)Chad Versace2013-01-152-11/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky heuristic below: if (gen >= 3) api_mask = GL | GLES1 | GLES2; else api_mask = 0; This hack was likely broken on gen2 (i830), but I don't care enough to properly investigate. It appears that every EGLConfig on i830 has EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed. Anyway, moving on to living drivers... With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now insufficient. We must enable the GLES3 bit if and only if the driver is capable of creating a GLES3 context. This requires us to determine the maximum supported context version supported by the hardware/driver for each api *during initialization of intel_screen*. Therefore, this patch adds four new fields to intel_screen which indicate the maximum supported context version for each api: max_gl_core_version max_gl_compat_version max_gl_es1_version max_gl_es2_version The api mask is now correctly set as: api_mask = GL; if (max_gl_es1_version > 0) api_mask |= GLES1; if (max_gl_es2_version > 0) api_mask |= GLES2; Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. v2: - Replace the if-tree on gen with a switch, for Ian. - Unconditionally enable the DRI_API_OPENGL bit, for Ian. v3: - Drop max gl version to 1.4 on gen3 if !has_occlusion_query, because occlusion queries entered core in 1.5. For Ian. v4: - Drop ES2 version back to 2.0 due to rebase (Ian). Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
* i965: Force even an empty query to flush all previous queries.Carl Worth2013-01-151-0/+17
| | | | | | | | | | | | | | | | | | The specification requires that query results are processed in order, (when one query result is returned, all previous query of the same type must also be available). The implementation was failing this requirement in the case of BeginQuery and EndQuery with no intervening drawing, (the result would be made available immediately without flushing previous queries). This fixes the following es3conform test: occlusion_query_query_order as well as the following piglit test: occlusion_query_order Reviewed-by: Ian Romanick <[email protected]>
* meta: Allow meta operations to pause/resume an active occlusion queryCarl Worth2013-01-152-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | This allows for avoiding the occlusion query erroneously accumulating results during the meta operation. This functionality is made conditional on a new MESA_META_OCCLUSION_QUERY bit so that meta-operations which should generate fragments can continue to get the current behavior. The implementation of glClear is specifically augmented to request the flag since glClear is specified to not generate fragments. This fixes the following es3conform tests: occlusion_query_draw_occluded.test occlusion_query_clear occlusion_query_custom_framebuffer occlusion_query_stencil_test occlusion_query_discarded_fragments As well as the following piglit test: occlusion_query_meta_no_fragments Reviewed-by: Ian Romanick <[email protected]>
* i965: Avoid blending with destination alpha when RB format has no alpha bitsCarl Worth2013-01-143-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | The hardware does not support a render target without an alpha channel. So when the user creates a render buffer with no alpha channel, there actually is storage available for alpha internally. It requires special care to avoid these unwanted alpha bits from causing any problems. Specifically, when blending, and when the blend factors would read the destination alpha values, this commit coerces the blend factors to instead be either 0 or 1 as appropriate. A similar fix was made for pre-gen6 hardware in commit eadd9b8e and this commit shares the fixup function written by Ian then. This commit the following es3conform test: rgb8_rgba8_rgb As well as the following piglit (sub) tests: EXT_framebuffer_object/fbo-blending-formats/3 EXT_framebuffer_object/fbo-blending-formats/GL_RGB EXT_framebuffer_object/fbo-blending-formats/GL_RGB8 Reviewed-by: Ian Romanick <[email protected]>
* xmlpool: Fix out-of-tree builds.Johannes Obermayr2013-01-135-1/+5
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* r200: Fix probable thinko in r200EmitArraysAdam Jackson2013-01-131-1/+2
| | | | | | | | | | Effectively this path would always assert. Move the break statement to the (probable) intended place. Note: This is a candidate for the stable branches. Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* Remove hacks for static MakefilesMatt Turner2013-01-136-18/+0
| | | | | | | | | | | v2: Andreas Boll <[email protected]> - don't remove compatibility with scripts for the old build system v3: Andreas Boll <[email protected]> - remove more obsolete hacks v4: Andreas Boll <[email protected]> - add a previously removed TOP variable to fix vgapi build
* i965: Move program_id to intel_screen instead of brw_context.Kenneth Graunke2013-01-124-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to bug #54524, I regressed oglconform's multicontext test when I reenabled the fragment shader precompile. However, these test cases only passed by miraculous coincedence. We assign each fragment program a unique ID (brw_fragment_program::id which becomes brw_wm_prog_key::program_string_id) which we obtain by storing a per-context counter. The test case uses GLX context sharing to access the same fragment program from two different contexts. This means that we share a program cache. Before the precompile, if both contexts happened to use the same shaders in the same order, we'd obtain the same program_string_ids (by virtue of doing the same computation twice). However, the more likely scenario is that they completely disagree on program_string_id. This meant that we'd have two completely different fragment shaders in the cache with the same ID, tricking us to think they were the same (aside from NOS), so we'd render using the wrong program. This patch implements a simple fix suggested by Eric: it moves the global counter out of brw_context and into intel_screen, which is shared across all contexts. A mutex protects it from concurrent access. This is also the first direct usage of pthreads in the i965 driver. Fixes 10 subcases of oglconform's multicontext test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524 Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix build error with clang.Kenneth Graunke2013-01-121-3/+7
| | | | | | | | | | | | | | | Technically, variable sized arrays are a required feature of C99, redacted to be optional in C11, and not actually part of C++ whatsoever. Gcc allows using them in C++ unless you specify -pedantic, and Clang appears to allow them for simple/POD types. exec_list is arguably POD, since it doesn't have virtual methods, but I can see why Clang would be like "meh, it's a C++ struct, say no", seeing as it's meant to support C99. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58970 Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Don't mix integer/float immediates in i2b handling.Kenneth Graunke2013-01-121-1/+3
| | | | | | | | | | | | | | | The simulator gets very angry about our i2b code: cmp.ne(16) g3<1>D g2<0,1,0>D 0F We can't mix integer DWord and float types. The only reason to use 0F here was to share code with f2b. Split it and use 0D instead. While we don't believe anything bad will actually happen because of this, it's nice to fix the warnings and easy enough to do. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add an INTEL_DEBUG=no16 option.Kenneth Graunke2013-01-123-1/+4
| | | | | | | | | | | Often when debugging, I don't want to see SIMD16 shaders. It makes INTEL_DEBUG=vs/fs output much easier to read, especially when a program dumps many shaders. Plus, I also want to verify that SIMD8 works before even considering SIMD16. v2: Fix the likeliness check (caught by Chris and Eric). Reviewed-by: Eric Anholt <[email protected]>
* scons: Update for xmlpool/options.h generation.José Fonseca2013-01-122-0/+17
|
* drirc: Add quirk to disable GLSL line continuations for Savage2Carl Worth2013-01-111-0/+3
| | | | | | | | | | | | | | | | | | This application is known to contain shaders that: 1. Have a stray backslash as the last line of comment lines 2. Have a declaration immediately following that line Hence, interpreting that backslash as a line continuation causes the declaration to be hidden and the shader fails to compile. Fortunately, the shaders also: 3. Do not have any other intentional line-continuation characters So disabling line continuations entirely for the application fixes this problem without causing any other breakage. Reviewed-by: Kenneth Graunke <[email protected]>
* driconf: Add a new option: disable_glsl_line_continuationsCarl Worth2013-01-113-1/+9
| | | | | | | | | This is to enable a quirk for Savage2 which includes a shader with a stray '\' at the end of a comment line. Interpreting that backslash as a line continuation will break the compilation of the shader, so we need a way to disable this. Reviewed-by: Kenneth Graunke <[email protected]>
* driconf: Add proper dependency for compiling .mo files from .po files.Carl Worth2013-01-112-21/+20
| | | | | | | | | | | Previously this was happening unconditionally, leading to some excessive rebuilding/relinking during builds. Note that the .po files are not automatically updated due to changes to the t_options.h file. Instead, translators should continue to use "make po" manually. This is because after new strings are merged into the existing .po file, manual work is still required by translators to ensure that the translations are correct.
* driconf: Add translation-generation to build system, don't track generated filesCarl Worth2013-01-118-643/+64
| | | | | | | | | | | | | | | | | | | | Previously, the xmlpool directory had a lone Makefile to assist poeple in manually invoking a deep make in order to update the translations in options.h. We can observe that this wasn't happening in fact, (new translations had been added to de.po without being generated into options.h, and new options had been manually added directly to options.h rather than to t_options.h). Prevent both of these problems from occurring in the future by automatically generating options.h as part of the standard build of mesa. For this, the generated options.h is now removed from version control, (along with Makefile in favor of Makefile.am). [chadv: Port the Autotools changes to Android.] Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* driconf: Fix German translations by removing a couple of bogus backslashesCarl Worth2013-01-111-2/+2
| | | | | | | | | As can be seen, many other translation strings already include a single apostrophe just fine without any escaping. This strangely-escaped apostrophe was causing a build failure ("invalid escape sequence") resulting in no "de" translations in the final options.h file. Reviewed-by: Kenneth Graunke <[email protected]>
* driconf: Fix gen_xmlpool.py script to allow running from any directoryChad Versace2013-01-112-4/+18
| | | | | | | | | | | | | | The gen_xmlpool.py script would work correctly only when executed from the directory that contained the script. This shortcoming was due to some hard-coded paths in the script. In order to easily invoke the script from the Android build system, we must be able to execute the script from an arbitrary directory. To enable that, this patch replaces the two hard-coded paths with new command line arguments. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Carl Worth <[email protected]>
* driconf: Add some translations which have been available, but were not compiledCarl Worth2013-01-111-8/+8
| | | | | | | These translations have existed in the de.po file, but were not in the generated options.h file. This was fixed by simply running "make options.h". Reviewed-by: Kenneth Graunke <[email protected]>
* driconf: Add option definitions to source file, not generated targetCarl Worth2013-01-111-0/+10
| | | | | | | | | | | | | | For the last two most-recently-added driconf options, their definition was manually added to options.h, a file which is intended to be automatically generated, (as part of support for translated driconf option descriptions). This means that these options would be eliminated if the generation step were performed again. Fix this by correctly adding the definitions of these options to t_options.h, (the file used as input to the generator), and not the options.h file, which is generated. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEXIan Romanick2013-01-111-4/+4
| | | | | | | | | | | | | This requires some derived state. The cut vertex used is either the value specified by glPrimitiveRestartIndex or it's hard-coded to ~0. The derived state gl_array_attrib::_RestartIndex captures this value. In addition, the derived state gl_array_attrib::_PrimitiveRestart is set whenever either gl_array_attrib::PrimitiveRestart or gl_array_attrib::PrimitiveRestartFixedIndex is set. v2: Use _mesa_is_gles3. Signed-off-by: Ian Romanick <[email protected]>
* i965: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVEIan Romanick2013-01-111-0/+3
| | | | | | | | We just treat this as an alias for GL_ANY_SAMPLES_PASSED. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Clean up .gitignore filesMatt Turner2013-01-1010-11/+0
|
* intel: Clean up confusion between logical and physical surface dimensions.Paul Berry2013-01-098-153/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases, the width, height, and depth of the physical surface used by the driver to implement a texture or renderbuffer is equal to the logical width, height, and depth exposed to the client through functions such as glTexImage3D(). However, there are two exceptions: cube maps (which have a physical depth of 6 but a logical depth of 1) and multisampled renderbuffers (which have larger physical dimensions than logical dimensions to allow multiple samples per pixel). Previous to this patch, we accounted for the difference between physical and logical surface dimensions at inconsistent places in the call graph (multisampling was accounted for in intel_miptree_create_for_renderbuffer(), and cubemaps were accounted for in intel_miptree_create_internal()). As a result, it wasn't always clear, when calling a miptree creation function, whether physical or logical dimensions were needed. Also, we weren't consistent about storing logical dimensions in the intel_mipmap_tree structure (we only did so in the intel_miptree_create_for_renderbuffer() code path, and we did not store depth). This patch refactors things so that intel_miptree_create_internal() is responsible for converting logical to physical dimensions and for storing both the physical and logical dimensions in the intel_mipmap_tree structure. As a result, all miptree creation functions interpret their arguments as logical dimensions, and both physical and logical dimensions are always available to functions that work with intel_mipmap_trees. In addition, it renames the fields in intel_mipmap_tree used to store the dimensions, so that it is clear from the name whether physical or logical dimensions are being referred to. This should fix the following bugs: - When creating a separate stencil surface for a depthstencil cubemap, we would erroneously try to convert the depth from 1 to 6 twice, resulting in an assertion failure. - When creating an MCS buffer for compressed multisampling, we used physical dimensions instead of logical dimensions, resulting in wasted memory. In addition, this should considerably simplify the implementation of ARB_texture_multisample, because it moves the code to compute the physical size of multisampled surfaces out of renderbuffer-only code. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: Add a force_y_tiling parameter to intel_miptree_create().Paul Berry2013-01-095-26/+34
| | | | | | | | | | | This allows intel_miptree_alloc_mcs() to force Y tiling for the MCS buffer. Previously we accomplished this by the hack of passing INTEL_MSAA_LAYOUT_CMS as the msaa_layout parameter, but that parameter is going to be going away soon. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: Move compute_msaa_layout earlier in file.Paul Berry2013-01-091-38/+41
| | | | | | | | | | No functional change. This patch moves the compute_msaa_layout() function earlier in intel_mipmap_tree.c so that it can be used by other functions in that file. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>