ARB_shader_image_size not started
ARB_shader_storage_buffer_object not started
ARB_stencil_texturing not started
-ARB_texture_buffer_range DONE (nv50, nvc0)
+ARB_texture_buffer_range DONE (nv50, nvc0, i965)
ARB_texture_query_levels DONE (i965)
ARB_texture_storage_multisample DONE (i965)
ARB_texture_view not started
ctx->Const.NativeIntegers = true;
ctx->Const.UniformBooleanTrue = 1;
+
+ /* From the gen4 PRM, volume 4 page 127:
+ *
+ * "For SURFTYPE_BUFFER non-rendertarget surfaces, this field specifies
+ * the base address of the first element of the surface, computed in
+ * software by adding the surface base address to the byte offset of
+ * the element in the buffer."
+ *
+ * However, unaligned accesses are slower, so enforce buffer alignment.
+ */
ctx->Const.UniformBufferOffsetAlignment = 16;
+ ctx->Const.TextureBufferOffsetAlignment = 16;
if (brw->gen >= 6) {
ctx->Const.MaxVarying = 32;
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_buffer_object *intel_obj =
intel_buffer_object(tObj->BufferObject);
- drm_intel_bo *bo = intel_obj ? intel_obj->buffer : NULL;
+ uint32_t size = tObj->BufferSize;
+ drm_intel_bo *bo = NULL;
gl_format format = tObj->_BufferObjectFormat;
uint32_t brw_format = brw_format_for_mesa_format(format);
int texel_size = _mesa_get_format_bytes(format);
- int w = intel_obj ? intel_obj->Base.Size / texel_size : 0;
+
+ if (intel_obj) {
+ bo = intel_obj->buffer;
+ size = MIN2(size, intel_obj->Base.Size);
+ }
if (brw_format == 0 && format != MESA_FORMAT_RGBA_FLOAT32) {
_mesa_problem(NULL, "bad format %s for texture buffer\n",
_mesa_get_format_name(format));
}
- gen4_emit_buffer_surface_state(brw, surf_offset, bo, 0,
+ gen4_emit_buffer_surface_state(brw, surf_offset, bo,
+ tObj->BufferOffset,
brw_format,
- w, texel_size);
+ size / texel_size,
+ texel_size);
}
static void
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_buffer_object *intel_obj =
intel_buffer_object(tObj->BufferObject);
- drm_intel_bo *bo = intel_obj ? intel_obj->buffer : NULL;
+ uint32_t size = tObj->BufferSize;
+ drm_intel_bo *bo = NULL;
+
+ if (intel_obj) {
+ bo = intel_obj->buffer;
+ size = MIN2(size, intel_obj->Base.Size);
+ }
+
gl_format format = tObj->_BufferObjectFormat;
uint32_t surface_format = brw_format_for_mesa_format(format);
}
int texel_size = _mesa_get_format_bytes(format);
- int w = intel_obj ? intel_obj->Base.Size / texel_size : 0;
gen7_emit_buffer_surface_state(brw,
surf_offset,
bo,
- 0,
+ tObj->BufferOffset,
surface_format,
- w,
+ size / texel_size,
texel_size,
0 /* mocs */);
}
ctx->Extensions.ARB_shading_language_420pack = true;
ctx->Extensions.ARB_texture_buffer_object = true;
ctx->Extensions.ARB_texture_buffer_object_rgb32 = true;
+ ctx->Extensions.ARB_texture_buffer_range = true;
ctx->Extensions.ARB_texture_cube_map_array = true;
ctx->Extensions.OES_depth_texture_cube_map = true;
ctx->Extensions.ARB_shading_language_packing = true;