Commit f8b0a7f6 authored by Keith Whitwell's avatar Keith Whitwell

Merge commit 'origin/master' into gallium-resources

Conflicts:
	src/gallium/drivers/r300/r300_texture.c
parents a3c99807 f43c679c
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.2 Release Notes / April, 5, 2010</H1>
<p>
Mesa 7.8.2 is a bug fix release which fixes bugs found since the 7.8.1 release.
</p>
<p>
Mesa 7.8.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
</ul>
<h2>Changes</h2>
<p>None.</p>
</body>
</html>
......@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
<LI><A HREF="relnotes-7.7.1.html">7.7.1 release notes</A>
......
......@@ -14,12 +14,13 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
......
This diff is collapsed.
......@@ -102,6 +102,19 @@ static void Display(void)
/* read back scaled depth image */
glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2);
/* debug */
if (0) {
int i;
float *z = depth2 + 400 * 200;
printf("z at y=200:\n");
for (i = 0; i < 400; i++) {
printf("%5.3f ", z[i]);
if ((i + 1) % 12 == 0)
printf("\n");
}
}
/* draw as luminance */
glPixelZoom(1.0, 1.0);
glWindowPos2i(100, 0);
......
......@@ -176,7 +176,7 @@ def generate(env):
# MinGW port of gdb does not handle well dwarf debug info which is the
# default in recent gcc versions
env.AppendUnique(CFLAGS = ['-gstabs'])
env.AppendUnique(CCFLAGS = ['-gstabs'])
env.AppendUnique(CPPDEFINES = [('__MSVCRT_VERSION__', '0x0700')])
#env.AppendUnique(LIBS = ['iberty'])
......
......@@ -112,6 +112,7 @@ C_SOURCES = \
util/u_format_table.c \
util/u_format_tests.c \
util/u_format_yuv.c \
util/u_format_zs.c \
util/u_gen_mipmap.c \
util/u_half.c \
util/u_handle_table.c \
......
......@@ -161,6 +161,7 @@ source = [
'util/u_format_table.c',
'util/u_format_tests.c',
'util/u_format_yuv.c',
'util/u_format_zs.c',
'util/u_gen_mipmap.c',
'util/u_half.c',
'util/u_handle_table.c',
......
......@@ -116,7 +116,7 @@ lp_build_stencil_test_single(struct lp_build_context *bld,
stencilVals = LLVMBuildAnd(bld->builder, stencilVals, valuemask, "");
}
res = lp_build_cmp(bld, stencil->func, stencilVals, stencilRef);
res = lp_build_cmp(bld, stencil->func, stencilRef, stencilVals);
return res;
}
......
......@@ -307,7 +307,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
}
else {
/*
* Fallback to calling util_format_description::fetch_float for each
* Fallback to calling util_format_description::fetch_rgba_float for each
* pixel.
*
* This is definitely not the most efficient way of fetching pixels, as
......@@ -324,10 +324,10 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
assert(type.floating);
util_snprintf(name, sizeof name, "util_format_%s_fetch_float", format_desc->short_name);
util_snprintf(name, sizeof name, "util_format_%s_fetch_rgba_float", format_desc->short_name);
/*
* Declare and bind format_desc->fetch_float().
* Declare and bind format_desc->fetch_rgba_float().
*/
function = LLVMGetNamedFunction(module, name);
......@@ -348,7 +348,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
assert(LLVMIsDeclaration(function));
LLVMAddGlobalMapping(lp_build_engine, function, format_desc->fetch_float);
LLVMAddGlobalMapping(lp_build_engine, function, format_desc->fetch_rgba_float);
}
for (chan = 0; chan < 4; ++chan) {
......@@ -361,7 +361,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
"");
/*
* Invoke format_desc->fetch_float() for each pixel and insert the result
* Invoke format_desc->fetch_rgba_float() for each pixel and insert the result
* in the SoA vectors.
*/
......
......@@ -56,7 +56,7 @@ util_format_read_4f(enum pipe_format format,
src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
dst_row = dst;
format_desc->unpack_float(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -78,7 +78,7 @@ util_format_write_4f(enum pipe_format format,
dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
src_row = src;
format_desc->pack_float(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->pack_rgba_float(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -97,7 +97,7 @@ util_format_read_4ub(enum pipe_format format, uint8_t *dst, unsigned dst_stride,
src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
dst_row = dst;
format_desc->unpack_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -116,7 +116,7 @@ util_format_write_4ub(enum pipe_format format, const uint8_t *src, unsigned src_
dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
src_row = src;
format_desc->pack_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -149,6 +149,7 @@ util_format_fits_8unorm(const struct util_format_description *format_desc)
format_desc->channel[chan].size > 8) {
return FALSE;
}
break;
default:
return FALSE;
}
......@@ -242,8 +243,8 @@ util_format_translate(enum pipe_format dst_format,
return;
while (height >= y_step) {
src_format_desc->unpack_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
src_format_desc->unpack_rgba_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_rgba_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
dst_row += dst_step;
src_row += src_step;
......@@ -251,8 +252,8 @@ util_format_translate(enum pipe_format dst_format,
}
if (height) {
src_format_desc->unpack_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
src_format_desc->unpack_rgba_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_rgba_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
}
FREE(tmp_row);
......@@ -267,8 +268,8 @@ util_format_translate(enum pipe_format dst_format,
return;
while (height >= y_step) {
src_format_desc->unpack_float(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_float(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
src_format_desc->unpack_rgba_float(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_rgba_float(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
dst_row += dst_step;
src_row += src_step;
......@@ -276,8 +277,8 @@ util_format_translate(enum pipe_format dst_format,
}
if (height) {
src_format_desc->unpack_float(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_float(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
src_format_desc->unpack_rgba_float(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_rgba_float(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
}
FREE(tmp_row);
......
......@@ -192,43 +192,114 @@ struct util_format_description
/**
* Unpack pixel blocks to R8G8B8A8_UNORM.
*
* Only defined for non-depth-stencil formats.
*/
void
(*unpack_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*unpack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixel blocks from R8G8B8A8_UNORM.
*
* Only defined for non-depth-stencil formats.
*/
void
(*pack_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*pack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixel blocks to R32G32B32A32_FLOAT.
*
* Only defined for non-depth-stencil formats.
*/
void
(*unpack_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*unpack_rgba_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixel blocks from R32G32B32A32_FLOAT.
*
* Only defined for non-depth-stencil formats.
*/
void
(*pack_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
(*pack_rgba_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Fetch a single pixel (i, j) from a block.
*
* Only defined for non-depth-stencil formats.
*/
void
(*fetch_rgba_float)(float *dst,
const uint8_t *src,
unsigned i, unsigned j);
/**
* Unpack pixels to Z32_UNORM.
*
* Only defined for depth formats.
*/
void
(*unpack_z_32unorm)(uint32_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*pack_z_32unorm)(uint8_t *dst, unsigned dst_stride,
const uint32_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixels to Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*unpack_z_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*pack_z_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixels to S8_USCALED.
*
* Only defined for stencil formats.
*/
void
(*unpack_s_8uscaled)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from S8_USCALED.
*
* Only defined for stencil formats.
*/
void
(*fetch_float)(float *dst,
const uint8_t *src,
unsigned i, unsigned j);
(*pack_s_8uscaled)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
};
......
......@@ -31,7 +31,7 @@
void
util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -39,7 +39,7 @@ util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
}
void
util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -47,7 +47,7 @@ util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
}
void
util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
......@@ -55,7 +55,7 @@ util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
void
util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -64,7 +64,7 @@ util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -73,7 +73,7 @@ util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -82,7 +82,7 @@ util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -91,7 +91,7 @@ util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
util_format_r1_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
......@@ -99,7 +99,7 @@ util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
void
util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -108,7 +108,7 @@ util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -123,7 +123,7 @@ util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -156,7 +156,7 @@ util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -188,7 +188,7 @@ util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -217,7 +217,7 @@ util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -247,7 +247,7 @@ util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_fetch_float(float *dst, const uint8_t *src,
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
uint16_t value = *(const uint16_t *)src;
......
......@@ -34,74 +34,74 @@
void
util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
util_format_r1_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_fetch_float(float *dst, const uint8_t *src,
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -129,11 +129,34 @@ def write_format_table(formats):
print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment)
print " },"
print " %s," % (colorspace_map(format.colorspace),)
print " &util_format_%s_unpack_8unorm," % format.short_name()
print " &util_format_%s_pack_8unorm," % format.short_name()
print " &util_format_%s_unpack_float," % format.short_name()
print " &util_format_%s_pack_float," % format.short_name()
print " &util_format_%s_fetch_float" % format.short_name()
if format.colorspace != ZS:
print " &util_format_%s_unpack_rgba_8unorm," % format.short_name()
print " &util_format_%s_pack_rgba_8unorm," % format.short_name()
print " &util_format_%s_unpack_rgba_float," % format.short_name()
print " &util_format_%s_pack_rgba_float," % format.short_name()
print " &util_format_%s_fetch_rgba_float," % format.short_name()
else:
print " NULL, /* unpack_rgba_8unorm */"
print " NULL, /* pack_rgba_8unorm */"
print " NULL, /* unpack_rgba_float */"
print " NULL, /* pack_rgba_float */"
print " NULL, /* fetch_rgba_float */"
if format.colorspace == ZS and format.swizzles[0] != SWIZZLE_NONE:
print " &util_format_%s_unpack_z_32unorm," % format.short_name()
print " &util_format_%s_pack_z_32unorm," % format.short_name()
print " &util_format_%s_unpack_z_float," % format.short_name()
print " &util_format_%s_pack_z_float," % format.short_name()
else:
print " NULL, /* unpack_z_32unorm */"
print " NULL, /* pack_z_32unorm */"
print " NULL, /* unpack_z_float */"
print " NULL, /* pack_z_float */"
if format.colorspace == ZS and format.swizzles[1] != SWIZZLE_NONE:
print " &util_format_%s_unpack_s_8uscaled," % format.short_name()
print " &util_format_%s_pack_s_8uscaled" % format.short_name()
else:
print " NULL, /* unpack_s_8uscaled */"
print " NULL /* pack_s_8uscaled */"
print "};"
print
......@@ -149,7 +172,6 @@ def write_format_table(formats):
print " case %s:" % format.name
print " return &util_format_%s_description;" % (format.short_name(),)
print " default:"
print " assert(0);"
print " return NULL;"
print " }"
print "}"
......
......@@ -334,9 +334,41 @@ util_format_test_cases[] =
{PIPE_FORMAT_R8G8Bx_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x81), UNPACKED_1x1( 0.0, -1.0, 0.0, 1.0)},
/*
* TODO: Depth-stencil formats
* Depth-stencil formats
*/
{PIPE_FORMAT_S8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0x00), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_S8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0xff), UNPACKED_1x1(0.0, 255.0, 0.0, 0.0)},
{PIPE_FORMAT_Z16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x3f800000), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24_UNORM_S8_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24_UNORM_S8_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ffffff), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24_UNORM_S8_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), UNPACKED_1x1(0.0, 255.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24_UNORM_S8_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), UNPACKED_1x1(1.0, 255.0, 0.0, 0.0)},
{PIPE_FORMAT_S8_USCALED_Z24_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_S8_USCALED_Z24_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffff00), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_S8_USCALED_Z24_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), UNPACKED_1x1(0.0, 255.0, 0.0, 0.0)},
{PIPE_FORMAT_S8_USCALED_Z24_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), UNPACKED_1x1(1.0, 255.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_Z24X8_UNORM