Code: Select all
*** ASSERTION FAILURE ***
Assertion "0" failed at pvr_prim.c:98 in `pvr_poly_compile': Invalid texture U size
Code: Select all
*** ASSERTION FAILURE ***
Assertion "0" failed at pvr_prim.c:98 in `pvr_poly_compile': Invalid texture U size
Code: Select all
DEBUG 0x8c4a5870: Loaded /cd/sample_data/crate.png into GL texture 5 (/simulant/simulant/texture.cpp:107)
DEBUG 0x8c4a5870: Texture 5 has dimensions, W:256 H:256 (/simulant/simulant/texture.cpp:134)
DEBUG 0x8c4a5870: Texture uploaded (/simulant/simulant/texture.cpp:191)
DEBUG 0x8c4a5870: Binding texture 5 to texture unit 0 (/simulant/simulant/renderers/gl1x/gl1x_render_queue_visitor.cpp:82)
DEBUG 0x8c4a5870: Disabling texture unit 1 (/simulant/simulant/renderers/gl1x/gl1x_render_queue_visitor.cpp:86)
DEBUG 0x8c4a5870: Allocating HW buffer of size 1344 (/simulant/simulant/renderers/gl1x/gl1x_buffer_manager.cpp:19)
DEBUG 0x8c4a5870: Allocating HW buffer of size 72 (/simulant/simulant/renderers/gl1x/gl1x_buffer_manager.cpp:19)
*** ASSERTION FAILURE ***
Assertion "0" failed at pvr_prim.c:98 in `pvr_poly_compile': Invalid texture U size
arch: shutting down kernel
maple: final stats -- device count = 1, vbl_cntr = 139, dma_cntr = 139
vid_set_mode: 640x480IL NTSC
Code: Select all
for(uint32_t i = 0; i < MAX_TEXTURE_UNITS; ++i) {
auto current_tex = current_group_->texture_id[i];
if(!last_group || last_group->texture_id[i] != current_tex) {
GLCheck(glActiveTextureARB, GL_TEXTURE0_ARB + i);
if(current_tex) {
L_DEBUG(_F("Binding texture {0} to texture unit {1}").format(current_tex, i));
GLCheck(glEnable, GL_TEXTURE_2D);
GLCheck(glBindTexture, GL_TEXTURE_2D, current_tex);
} else {
L_DEBUG(_F("Disabling texture unit {0}").format(i));
GLCheck(glBindTexture, GL_TEXTURE_2D, 0);
GLCheck(glDisable, GL_TEXTURE_2D);
}
}
}
Code: Select all
L_DEBUG(_F("Texture {0} has dimensions, W:{1} H:{2}").format(gl_tex_, width_, height_));
GLCheck(glTexImage2D,
GL_TEXTURE_2D,
0, internalFormat,
width_, height_, 0,
format,
GL_UNSIGNED_BYTE, &data_[0]
);
Code: Select all
The value zero is reserved to represent the default texture for each texture target.
Take a look and give your opinion. I'll take a look when I get a chance (I'm away for the next few days) and give any final approval to it.bogglez wrote:Thanks for the patch set, kazade!
I think I'll have some free time tomorrow to look at these patches, if BlueCrab doesn't want to do it.
OK, I think actually it should be GLenum and initialized to zero, because aside from initialization it's always used to store a GLenum (which was being truncated, that was the bug)bogglez wrote:I had a cursory look.
The nehe examples still work the same.
Looking at the code:
- Why is GL_KOS_CULL_FUNC short not byte now? Values are between 0 and 3
I think everywhere GL_DOUBLE could be passed is already being checked, I only added it for completeness - but actually you're probably right, if we can't support it it would probably be safer to remove it from the case statement.- sizeof(GLdouble) will return sizeof(float), not sizeof(double) due to gcc configure flags for KOS. It's not safe to assume that sizeof(GLdouble) will be 4 and this may lead to wrong offset calculations. Either we support double properly or we need to have to handle this explicitly (and convert from double to float in the code).
Sorry, I didn't realize.. the original code was casting to GLfloat*, I just changed it to GLubyte*- don't cast from GLvoid* to GLubyte* explicitly in C, you could hide errors in the future.
Isn't that only true if someone passes an invalid stride? I don't see we have any other choice as the same buffer can be used for glVertexPointer and glColorPointer (for example) with float data and unsigned bytes.- _glKosArraysTransform*:
- unsafe to read from unaligned address (now possible due to GLubyte*), e.g. float at address 0x0001 instead of 0x0004 should throw a bad read error, I think?
- dest pointer is now always the same, instead of looping through a dest array?