Commit cb26d59d authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

05/49: wined3d: Only add line numbers for new lines in shader_addline().

parent b28bd67f
...@@ -57,9 +57,18 @@ int shader_addline( ...@@ -57,9 +57,18 @@ int shader_addline(
return -1; return -1;
} }
if (buffer->newline) {
TRACE("GL HW (%u, %u) : %s", buffer->lineNo + 1, buffer->bsize, base);
buffer->newline = FALSE;
} else {
TRACE(base);
}
buffer->bsize += rc; buffer->bsize += rc;
buffer->lineNo++; if (buffer->buffer[buffer->bsize-1] == '\n') {
TRACE("GL HW (%u, %u) : %s", buffer->lineNo, buffer->bsize, base); buffer->lineNo++;
buffer->newline = TRUE;
}
return 0; return 0;
} }
......
...@@ -832,6 +832,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateShader( ...@@ -832,6 +832,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateShader(
#endif #endif
buffer.bsize = 0; buffer.bsize = 0;
buffer.lineNo = 0; buffer.lineNo = 0;
buffer.newline = TRUE;
if (This->baseShader.shader_mode == SHADER_GLSL) { if (This->baseShader.shader_mode == SHADER_GLSL) {
......
...@@ -715,6 +715,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( ...@@ -715,6 +715,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
#endif #endif
buffer.bsize = 0; buffer.bsize = 0;
buffer.lineNo = 0; buffer.lineNo = 0;
buffer.newline = TRUE;
if (This->baseShader.shader_mode == SHADER_GLSL) { if (This->baseShader.shader_mode == SHADER_GLSL) {
......
...@@ -1491,6 +1491,7 @@ typedef struct SHADER_BUFFER { ...@@ -1491,6 +1491,7 @@ typedef struct SHADER_BUFFER {
char* buffer; char* buffer;
unsigned int bsize; unsigned int bsize;
unsigned int lineNo; unsigned int lineNo;
BOOL newline;
} SHADER_BUFFER; } SHADER_BUFFER;
/* Undocumented opcode controls */ /* Undocumented opcode controls */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment