#include "util/u_format_s3tc.h"
#include "util/u_math.h"
#include "util/u_memory.h"
-#include "util/u_mm.h"
#include "pipe/p_screen.h"
/* S3TC formats. */
if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
- if (!util_format_s3tc_enabled) {
- return ~0; /* Unsupported. */
- }
-
switch (format) {
case PIPE_FORMAT_DXT1_RGB:
case PIPE_FORMAT_DXT1_RGBA:
/* Create the backing buffer if needed. */
if (!tex->buf) {
+ /* Only use the first domain for allocation. Multiple domains are not allowed. */
+ unsigned alloc_domain =
+ tex->domain & RADEON_DOMAIN_VRAM ? RADEON_DOMAIN_VRAM :
+ RADEON_DOMAIN_GTT;
+
tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048,
- tex->domain, RADEON_FLAG_NO_SUBALLOC);
+ alloc_domain,
+ RADEON_FLAG_NO_SUBALLOC |
+ /* Use the reusable pool: */
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!tex->buf) {
goto fail;
return NULL;
}
- buffer = rws->buffer_from_handle(rws, whandle, &stride, NULL);
+ buffer = rws->buffer_from_handle(rws, whandle, 0, &stride, NULL);
if (!buffer)
return NULL;
surface->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
- surface->buf = tex->buf;
surface->buf = tex->buf;
/* Prefer VRAM if there are multiple domains to choose from. */