X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fnouveau%2Fnvc0%2Fnvc0_state.c;h=2f00bd1c9377811bad326323a521903f03d7e40e;hb=6e52c6dfcc93aa801d1ac86796492fc325d997d2;hp=5cb07609daed43f7966710e25ec283edcaf433f6;hpb=2d489f76f48095799392a915dcedc074bbb5e52a;p=mesa.git diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 5cb07609dae..2f00bd1c937 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -616,6 +616,7 @@ nvc0_sp_state_create(struct pipe_context *pipe, prog->translated = nvc0_program_translate( prog, nvc0_context(pipe)->screen->base.device->chipset, + nvc0_context(pipe)->screen->base.disk_shader_cache, &nouveau_context(pipe)->debug); return (void *)prog; @@ -755,6 +756,7 @@ nvc0_cp_state_create(struct pipe_context *pipe, prog->translated = nvc0_program_translate( prog, nvc0_context(pipe)->screen->base.device->chipset, + nvc0_context(pipe)->screen->base.disk_shader_cache, &nouveau_context(pipe)->debug); return (void *)prog; @@ -1355,14 +1357,9 @@ nvc0_set_global_handle(uint32_t *phandle, struct pipe_resource *res) { struct nv04_resource *buf = nv04_resource(res); if (buf) { - uint64_t limit = (buf->address + buf->base.width0) - 1; - if (limit < (1ULL << 32)) { - *phandle = (uint32_t)buf->address; - } else { - NOUVEAU_ERR("Cannot map into TGSI_RESOURCE_GLOBAL: " - "resource not contained within 32-bit address space !\n"); - *phandle = 0; - } + uint64_t address = buf->address + *phandle; + /* even though it's a pointer to uint32_t that's fine */ + memcpy(phandle, &address, 8); } else { *phandle = 0; } @@ -1379,6 +1376,9 @@ nvc0_set_global_bindings(struct pipe_context *pipe, unsigned i; const unsigned end = start + nr; + if (!nr) + return; + if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) { const unsigned old_size = nvc0->global_residents.size; if (util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end)) {