summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/glX_proto_send.py
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2008-12-09 14:43:09 -0800
committerIan Romanick <ian.d.romanick@intel.com>2008-12-14 18:46:17 -0800
commit0f73302d24f4201813da2939742c5bcb6964b3b1 (patch)
tree0e1790cedfdd1b5f9cdaa45d25996c555f57515c /src/mesa/glapi/glX_proto_send.py
parent8be02fc8c67433bd2647f59abece5e8111859e40 (diff)
GLX: Fix protocol for glTexSubImage#D
The TexSubImage commands do not have the "NULL image" flag that was introduced with glTexImage3D. However, there is a CARD32 pad element where that flag would be. Removing the img_null_flag causes the flag to be removed from the protocol. This changes the protocol and breaks everything. In order to prevent needing to hand-code all of the TexSubImage functions, a new attribute was added to the param element. This new attribute, called "padding," is a boolean flag that selects whether or not the parameter is a real parameter (default / false) or is protocol padding (true) that does not appear in the function's parameter list. This change resulted in a number of changes to other Python scripts. In almost all cases parameters with the is_padding flag set should not be emitted. This patch only changes the the XML, the DTD, and the generator scripts. It does NOT include the resulting changes to the generated code. Generated code in the X server is also changed by the script / XML changes in this patch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/glapi/glX_proto_send.py')
-rw-r--r--src/mesa/glapi/glX_proto_send.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py
index b00b8a1ba6..501706acc7 100644
--- a/src/mesa/glapi/glX_proto_send.py
+++ b/src/mesa/glapi/glX_proto_send.py
@@ -333,7 +333,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
if image.img_pad_dimensions:
do_it = 1
break
-
+
if do_it:
[h, n] = hash_pixel_function(func)
@@ -422,7 +422,10 @@ generic_%u_byte( GLint rop, const void * ptr )
else:
src_ptr = "&" + p.name
- if not extra_offset:
+ if p.is_padding:
+ print '(void) memset((void *)(%s + %u), 0, %s);' \
+ % (pc, p.offset + adjust, p.size_string() )
+ elif not extra_offset:
print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \
% (pc, p.offset + adjust, src_ptr, p.size_string() )
else:
@@ -472,6 +475,10 @@ generic_%u_byte( GLint rop, const void * ptr )
else:
dim_str = str(dim)
+ if param.is_padding:
+ print '(void) memset((void *)(%s + %u), 0, %s);' \
+ % (pc, (param.offset - 4) + adjust, param.size_string() )
+
if param.img_null_flag:
if large:
print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset - 4) + adjust)
@@ -739,6 +746,9 @@ generic_%u_byte( GLint rop, const void * ptr )
p_string = ""
for param in f.parameterIterateGlxSend():
+ if param.is_padding:
+ continue
+
p_string += ", " + param.name
if param.is_image():