aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-30 13:41:12 +0200
committermarha <marha@users.sourceforge.net>2014-08-30 13:43:25 +0200
commite21655632e3fd40b7f6a5cc3c7f3c379d54557c4 (patch)
tree46054f4b20f70afd1c7743e54aa48471e2ded483 /mesalib/src/gallium
parent6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (diff)
downloadvcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.gz
vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.bz2
vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.zip
xserver libxtrans libxcb xcb-proto libX11 mesa git update 30 Aug 2014
xserver commit 3a51418b2db353519a1779cf3cebbcc9afba2520 libxcb commit b0e6c2de09c7474868dd7185674fa113a5c2e0aa libxcb/xcb-proto commit dc0c544fe044ddeb4917bba0c2fed66c70e6db43 libX11 commit 6101b967b641355dd863fd1ce52c6a7d58bcbe68 libxtrans commit 17491de45c352c833442cccf17a9bd65909889db mesa commit 932b0ef1ceecf873213447a8778e5cbe1b3b6be7
Diffstat (limited to 'mesalib/src/gallium')
-rw-r--r--mesalib/src/gallium/Automake.inc2
-rw-r--r--mesalib/src/gallium/Makefile.am17
-rw-r--r--mesalib/src/gallium/SConscript1
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf.c187
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf.h11
5 files changed, 121 insertions, 97 deletions
diff --git a/mesalib/src/gallium/Automake.inc b/mesalib/src/gallium/Automake.inc
index 74053eb2d..c43f735c3 100644
--- a/mesalib/src/gallium/Automake.inc
+++ b/mesalib/src/gallium/Automake.inc
@@ -16,6 +16,7 @@ GALLIUM_DRIVER_CFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
+ -I$(top_srcdir)/src/gallium/winsys \
$(DEFINES) \
$(VISIBILITY_CFLAGS)
@@ -26,6 +27,7 @@ GALLIUM_DRIVER_CXXFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
+ -I$(top_srcdir)/src/gallium/winsys \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
diff --git a/mesalib/src/gallium/Makefile.am b/mesalib/src/gallium/Makefile.am
index 1e1fd43d5..e4ef00346 100644
--- a/mesalib/src/gallium/Makefile.am
+++ b/mesalib/src/gallium/Makefile.am
@@ -109,6 +109,15 @@ if NEED_WINSYS_WRAPPER
SUBDIRS += winsys/sw/wrapper
endif
+##
+## Don't forget to bundle the remaining (non autotools) winsys'
+##
+
+EXTRA_DIST = \
+ winsys/sw/android \
+ winsys/sw/gdi \
+ winsys/sw/hgl
+
##
## Gallium state trackers and their users (targets)
@@ -164,6 +173,14 @@ SUBDIRS += state_trackers/xvmc targets/xvmc
endif
##
+## Don't forget to bundle the remaining (non autotools) state-trackers/targets
+##
+
+EXTRA_DIST += \
+ state_trackers/hgl targets/haiku-softpipe
+
+
+##
## Gallium tests
##
diff --git a/mesalib/src/gallium/SConscript b/mesalib/src/gallium/SConscript
index 98d017e4d..977e3fbf4 100644
--- a/mesalib/src/gallium/SConscript
+++ b/mesalib/src/gallium/SConscript
@@ -85,6 +85,7 @@ if not env['embedded']:
if env['platform'] == 'haiku':
SConscript([
+ 'state_trackers/hgl/SConscript',
'targets/haiku-softpipe/SConscript',
])
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf.c b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
index c475ee1b3..650df9f6a 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf.c
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
@@ -191,47 +191,114 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
const struct pipe_vertex_element *attribs);
static void u_vbuf_delete_vertex_elements(struct u_vbuf *mgr, void *cso);
+static const struct {
+ enum pipe_format from, to;
+} vbuf_format_fallbacks[] = {
+ { PIPE_FORMAT_R32_FIXED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R32G32_FIXED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R32G32B32_FIXED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R32G32B32A32_FIXED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R16_FLOAT, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R16G16B16_FLOAT, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R16G16B16A16_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R64_FLOAT, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R64G64_FLOAT, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R64G64B64_FLOAT, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R64G64B64A64_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R32_UNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R32G32_UNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R32G32B32_UNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R32G32B32A32_UNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R32_SNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R32G32_SNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R32G32B32_SNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R32G32B32A32_SNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R32_USCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R32G32_USCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R32G32B32_USCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R32G32B32A32_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R32_SSCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R32G32_SSCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R32G32B32_SSCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R32G32B32A32_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R16_UNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R16G16_UNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R16G16B16_UNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R16G16B16A16_UNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R16_SNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R16G16_SNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R16G16B16_SNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R16G16B16A16_SNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R16_USCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R16G16_USCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R16G16B16_USCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R16G16B16A16_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R16_SSCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R16G16_SSCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R16G16B16_SSCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R16G16B16A16_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R8_UNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R8G8_UNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R8G8B8_UNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R8G8B8A8_UNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R8_SNORM, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R8G8_SNORM, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R8G8B8_SNORM, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R8G8B8A8_SNORM, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R8_USCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R8G8_USCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R8G8B8_USCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R8G8B8A8_USCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+ { PIPE_FORMAT_R8_SSCALED, PIPE_FORMAT_R32_FLOAT },
+ { PIPE_FORMAT_R8G8_SSCALED, PIPE_FORMAT_R32G32_FLOAT },
+ { PIPE_FORMAT_R8G8B8_SSCALED, PIPE_FORMAT_R32G32B32_FLOAT },
+ { PIPE_FORMAT_R8G8B8A8_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
+};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
+boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
{
- caps->format_fixed32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- caps->format_float16 =
- screen->is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- caps->format_float64 =
- screen->is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- caps->format_norm32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER) &&
- screen->is_format_supported(screen, PIPE_FORMAT_R32_SNORM, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- caps->format_scaled32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_USCALED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER) &&
- screen->is_format_supported(screen, PIPE_FORMAT_R32_SSCALED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
+ unsigned i;
+ boolean fallback = FALSE;
+
+ /* I'd rather have a bitfield of which formats are supported and a static
+ * table of the translations indexed by format, but since we don't have C99
+ * we can't easily make a sparsely-populated table indexed by format. So,
+ * we construct the sparse table here.
+ */
+ for (i = 0; i < PIPE_FORMAT_COUNT; i++)
+ caps->format_translation[i] = i;
+
+ for (i = 0; i < Elements(vbuf_format_fallbacks); i++) {
+ enum pipe_format format = vbuf_format_fallbacks[i].from;
+
+ if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0,
+ PIPE_BIND_VERTEX_BUFFER)) {
+ caps->format_translation[format] = vbuf_format_fallbacks[i].to;
+ fallback = TRUE;
+ }
+ }
caps->buffer_offset_unaligned =
!screen->get_param(screen,
- PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY);
-
+ PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY);
caps->buffer_stride_unaligned =
- !screen->get_param(screen,
+ !screen->get_param(screen,
PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY);
-
caps->velem_src_offset_unaligned =
!screen->get_param(screen,
- PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY);
-
+ PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY);
caps->user_vertex_buffers =
screen->get_param(screen, PIPE_CAP_USER_VERTEX_BUFFERS);
+
+ if (!caps->buffer_offset_unaligned ||
+ !caps->buffer_stride_unaligned ||
+ !caps->velem_src_offset_unaligned ||
+ !caps->user_vertex_buffers) {
+ fallback = TRUE;
+ }
+
+ return fallback;
}
struct u_vbuf *
@@ -664,9 +731,6 @@ static void u_vbuf_translate_end(struct u_vbuf *mgr)
}
}
-#define FORMAT_REPLACE(what, withwhat) \
- case PIPE_FORMAT_##what: format = PIPE_FORMAT_##withwhat; break
-
static void *
u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
const struct pipe_vertex_element *attribs)
@@ -695,62 +759,7 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
ve->noninstance_vb_mask_any |= 1 << ve->ve[i].vertex_buffer_index;
}
- /* Choose a native format.
- * For now we don't care about the alignment, that's going to
- * be sorted out later. */
- if (!mgr->caps.format_fixed32) {
- switch (format) {
- FORMAT_REPLACE(R32_FIXED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_FIXED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_FIXED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_FIXED, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_float16) {
- switch (format) {
- FORMAT_REPLACE(R16_FLOAT, R32_FLOAT);
- FORMAT_REPLACE(R16G16_FLOAT, R32G32_FLOAT);
- FORMAT_REPLACE(R16G16B16_FLOAT, R32G32B32_FLOAT);
- FORMAT_REPLACE(R16G16B16A16_FLOAT, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_float64) {
- switch (format) {
- FORMAT_REPLACE(R64_FLOAT, R32_FLOAT);
- FORMAT_REPLACE(R64G64_FLOAT, R32G32_FLOAT);
- FORMAT_REPLACE(R64G64B64_FLOAT, R32G32B32_FLOAT);
- FORMAT_REPLACE(R64G64B64A64_FLOAT, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_norm32) {
- switch (format) {
- FORMAT_REPLACE(R32_UNORM, R32_FLOAT);
- FORMAT_REPLACE(R32G32_UNORM, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_UNORM, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_UNORM, R32G32B32A32_FLOAT);
- FORMAT_REPLACE(R32_SNORM, R32_FLOAT);
- FORMAT_REPLACE(R32G32_SNORM, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_SNORM, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_SNORM, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_scaled32) {
- switch (format) {
- FORMAT_REPLACE(R32_USCALED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_USCALED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_USCALED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_USCALED,R32G32B32A32_FLOAT);
- FORMAT_REPLACE(R32_SSCALED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_SSCALED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_SSCALED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_SSCALED,R32G32B32A32_FLOAT);
- default:;
- }
- }
+ format = mgr->caps.format_translation[format];
driver_attribs[i].src_format = format;
ve->native_format[i] = format;
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf.h b/mesalib/src/gallium/auxiliary/util/u_vbuf.h
index a608184e5..9e8b135fb 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf.h
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf.h
@@ -35,19 +35,14 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
+#include "pipe/p_format.h"
struct cso_context;
struct u_vbuf;
/* Hardware vertex fetcher limitations can be described by this structure. */
struct u_vbuf_caps {
- /* Vertex format CAPs. */
- /* TRUE if hardware supports it. */
- unsigned format_fixed32:1; /* PIPE_FORMAT_*32*_FIXED */
- unsigned format_float16:1; /* PIPE_FORMAT_*16*_FLOAT */
- unsigned format_float64:1; /* PIPE_FORMAT_*64*_FLOAT */
- unsigned format_norm32:1; /* PIPE_FORMAT_*32*NORM */
- unsigned format_scaled32:1; /* PIPE_FORMAT_*32*SCALED */
+ enum pipe_format format_translation[PIPE_FORMAT_COUNT];
/* Whether vertex fetches don't have to be 4-byte-aligned. */
/* TRUE if hardware supports it. */
@@ -60,7 +55,7 @@ struct u_vbuf_caps {
};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps);
+boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps);
struct u_vbuf *
u_vbuf_create(struct pipe_context *pipe,